Beispiel #1
0
 private void gridView1_Click(object sender, EventArgs e)
 {
     if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.FocusedColumn).ToString() != "")
     {
         string ngay = DateTime.Parse(thang + "/" + gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.FocusedColumn).ToString() + "/" + nam).ToString();
         if (tsbt == "tsbtbktdng")
         {
             Frm_rpcongno rp = new Frm_rpcongno();
             rp.getngaychungtu(ngay);
             rp.gettsbt(tsbt);
             rp.Show();
         }
         else if (tsbt == "tsbtpttm")
         {
             DataSet ds = new DataSet();
             ds.Tables.Add(gen.GetTable("select RefNo as 'Số phiếu',b.CustomField5 as 'Số phiếu đơn vị',DebitAccount as 'TK nợ',CreditAccount as 'TK có',d.AccountingObjectCode as 'Người nộp',d.AccountingObjectName as 'Tên người nộp',b.JournalMemo as 'Lý do',c.AccountingObjectCode as 'Đối tượng',c.AccountingObjectName as 'Tên đối tượng',Amount as 'Số tiền',b.Contactname as 'Đội',Note as 'Ghi chú' from CAReceiptDetail a, CAReceipt b, AccountingObject c, AccountingObject d  where b.AccountingObjectID=d.AccountingObjectID and a.AccountingObjectID=c.AccountingObjectID and a.RefID=b.RefID and Cast(RefDate as date)= cast('" + ngay + "' as date) and b.StockID in (select StockID from MSC_UserJoinStock where UserID='" + userid + "') order by RefNo,d.AccountingObjectCode,c.AccountingObjectCode"));
             gen.CreateExcel(ds, "Bangkephieuthu_" + String.Format("{0:dd-MM-yyyy}", DateTime.Parse(ngay)) + ".xlsx");
         }
         else if (tsbt == "bctqtkho")
         {
             Frm_rpcongno F = new Frm_rpcongno();
             F.gettsbt(tsbt);
             F.getngaychungtu(ngay);
             F.getkho(kho);
             F.ShowDialog();
         }
         else
         {
             thtk.loadton(gridView1, account, accountname, tsbt, ngay);
         }
     }
 }