看完這段影片
豬寶寶深深覺得台灣是個好地方..

More »


寫這個..要時時刻刻提醒自己,做事要盡心盡力,同時也為台灣悲哀

禮記:禮運大同篇

大道之行也天下為公,選賢與能,講信修睦,故人不獨親其親,不獨子其子,使老有所終,壯有所用,幼有所長,鰥寡孤獨廢疾者皆有所養。

我們做到了嗎?

More »



未分類
0 Comments

function TFrmMain.GetSum(Gird1:TWDBGrid;FieldName:String;NeedDJ02:boolean):Double;
var
  bm:Tbookmark;
  i:Integer;
  Sum:Double;
begin
  Result := 0;
  If Gird1.DataSource.DataSet.IsEmpty Then Exit;
  Bm := Gird1.DataSource.DataSet.GetBookmark;
  Sum := 0;
  if Gird1.SelectedRows.Count = 0 Then Gird1.SelectedRows.CurrentRowSelected := True;
  for i := 0 To Gird1.SelectedRows.Count -1 Do
  Begin
    Gird1.DataSource.DataSet.GotoBookmark(TBookmark(Gird1.SelectedRows[i]));
    if NeedDJ02 then begin
       if Gird1.DataSource.DataSet.fieldbyName(‘DJ02′).AsString=’國內購買’ then
        Sum := Sum +
           Gird1.DataSource.DataSet.fieldbyName(FieldName).AsFloat
       else
        Sum := Sum –
           Gird1.DataSource.DataSet.fieldbyName(FieldName).AsFloat;
    end else
        Sum := Sum +
           Gird1.DataSource.DataSet.fieldbyName(FieldName).AsFloat;
  End;
  Result := Sum;
End;