Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 2
0
        private void xrTableCell81_PreviewClick(object sender, PreviewMouseEventArgs e)
        {
            Frm_rpcongno F = new Frm_rpcongno();

            F.gettsbt("bcthkh");
            F.getngaychungtu(ngay);
            F.getkho(gen.GetString("select BranchID from Stock where StockCode='02'"));
            F.ShowDialog();
        }
Ejemplo n.º 3
0
        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_rpcongno rp = new Frm_rpcongno();

            rp.getngaychungtu(ngaychungtu);
            rp.getkho(kho);
            rp.getuserid(userid);
            rp.gettenkho(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString());
            rp.gettsbt("tsbtbangkeluongthanhtoan");
            rp.Show();
        }
Ejemplo n.º 4
0
        private void sbok_Click(object sender, EventArgs e)
        {
            if (checkEdit2.EditValue.ToString() == "True")
            {
                if (tsbt == "tsbtthpnxtt" || tsbt == "tsbtthpnxdc")
                {
                    pnht.loadtong(ngaychungtu, userid, tsbt, "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
                else if (tsbt == "tsbtthuedaura" || tsbt == "tsbtthuedauvao")
                {
                    bc.loadthuetong(ngaychungtu, tsbt, "intonghoptheokho", userid);
                }
                else if (tsbt == "tsbtthkqkd")
                {
                    thtk.loadketquakinhdoanh(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), ngaychungtu, ngaycuoi, tsbt + "tct", userid);
                }
                else if (tsbt == "tsbtbkhhnd" || tsbt == "tsbtbkhhxd")
                {
                    thtk.loadbangkehanghoatong(ngaychungtu, ngaycuoi, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "IDS").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho nhập").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho xuất").ToString(), "2");
                }
                else if (tsbt == "tsbtpkt")
                {
                    pkt.loadchitiet(ngaychungtu, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "2", view.GetRowCellValue(view.FocusedRowHandle, "Tên người dùng").ToString(), tsbt + "tong", "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
            }

            else if (checkEdit1.EditValue.ToString() == "True")
            {
                if (tsbt == "tsbtbctcth")
                {
                    if (tsbt == "tsbtbctcth")
                    {
                        thtk.loadbaocaothuchingay(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Tên kho").ToString());
                    }
                }
                else if (tsbt == "tsbtbkhhnd" || tsbt == "tsbtbkhhxd")
                {
                    thtk.loadbangkehanghoatong(ngaychungtu, ngaycuoi, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "IDS").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho nhập").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho xuất").ToString(), "1");
                }
                else if (tsbt == "tsbtthpnxtt" || tsbt == "tsbtthpnxdc")
                {
                    pnht.loadchitiet(ngaychungtu, userid, tsbt, "1", "", "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
                else if (tsbt == "tsbtpkt")
                {
                    pkt.loadchitiet(ngaychungtu, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "0", view.GetRowCellValue(view.FocusedRowHandle, "Tên người dùng").ToString(), tsbt, "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
                else if (tsbt == "tsbtthkqkd")
                {
                    thtk.loadketquakinhdoanh(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), ngaychungtu, ngaycuoi, tsbt + "tdv", userid);
                }
                else if (tsbt == "tsbtghiso")
                {
                    string thang = DateTime.Parse(ngaychungtu).Month.ToString();
                    string nam   = DateTime.Parse(ngaychungtu).Year.ToString();
                    if (XtraMessageBox.Show("Bạn có chắc ghi sổ toàn bộ dữ liệu tháng " + thang + " năm " + nam + " ?", "HAMACO", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        SplashScreenManager.ShowForm(typeof(Frm_wait));
                        gen.ExcuteNonquery("tonghopghiso '" + thang + "','" + nam + "','',1");
                        SplashScreenManager.CloseForm();
                    }
                }
                else if (tsbt == "tsbtboghi")
                {
                    string thang = DateTime.Parse(ngaychungtu).Month.ToString();
                    string nam   = DateTime.Parse(ngaychungtu).Year.ToString();
                    if (XtraMessageBox.Show("Bạn có chắc bỏ ghi toàn bộ dữ liệu tháng " + thang + " năm " + nam + " ?", "HAMACO", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        SplashScreenManager.ShowForm(typeof(Frm_wait));
                        gen.ExcuteNonquery("tonghopghiso '" + thang + "','" + nam + "','',0");
                        SplashScreenManager.CloseForm();
                    }
                }

                else if (tsbt == "tsbtthuedaura" || tsbt == "tsbtthuedauvao")
                {
                    bc.loadthue(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "Mã khu vực").ToString(), "khuvuc", "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG", userid);
                }
                else if (tsbt == "sktth" || tsbt == "sktthtomtat")
                {
                    string name = gen.GetString("select AccountName from Account where AccountNumber='" + userid + "'");
                    thtk.loadchitietsktth(ngaychungtu, ngaycuoi, tsbt, userid, name, "");
                }
                else
                {
                    thtk.loadchitietskttong(ngaychungtu, tsbt, account, accountname, lkno, lkco, cuoino, cuoico);
                }
            }
            else if (checkEdit3.EditValue.ToString() == "True")
            {
                if (tsbt == "tsbtthuedaura" || tsbt == "tsbtthuedauvao")
                {
                    bc.loadthue(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "intonghop", "", userid);
                }
            }
            else
            {
                if (tsbt == "tsbtbctcth")
                {
                    thtk.loadbaocaothuchi(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Tên kho").ToString());
                }
                else if (tsbt == "tsbtbkhhnd" || tsbt == "tsbtbkhhxd")
                {
                    thtk.loadbangkehanghoa(ngaychungtu, ngaycuoi, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "IDS").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho nhập").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Kho xuất").ToString(), "0");
                }
                else if (tsbt == "tsbtpkt")
                {
                    pkt.loadchitiet(ngaychungtu, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "1", view.GetRowCellValue(view.FocusedRowHandle, "Tên người dùng").ToString(), tsbt, "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
                else if (tsbt == "tsbtthpnxtt" || tsbt == "tsbtthpnxdc")
                {
                    pnht.loadchitiet(ngaychungtu, userid, tsbt, "0", view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
                }
                else if (tsbt == "tsbtthkqkd")
                {
                    thtk.loadketquakinhdoanh(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), ngaychungtu, ngaycuoi, tsbt, userid);
                }
                else if (tsbt == "tsbtghiso")
                {
                    string thang = DateTime.Parse(ngaychungtu).Month.ToString();
                    string nam   = DateTime.Parse(ngaychungtu).Year.ToString();
                    if (XtraMessageBox.Show("Bạn có chắc ghi sổ dữ liệu kho " + view.GetRowCellValue(view.FocusedRowHandle, "Mã kho").ToString() + " tháng " + thang + " năm " + nam + " ?", "HAMACO", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        SplashScreenManager.ShowForm(typeof(Frm_wait));
                        gen.ExcuteNonquery("tonghopghiso '" + thang + "','" + nam + "','" + view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString() + "',1");
                        SplashScreenManager.CloseForm();
                    }
                }
                else if (tsbt == "tsbtboghi")
                {
                    string thang = DateTime.Parse(ngaychungtu).Month.ToString();
                    string nam   = DateTime.Parse(ngaychungtu).Year.ToString();
                    if (XtraMessageBox.Show("Bạn có chắc bỏ ghi dữ liệu kho " + view.GetRowCellValue(view.FocusedRowHandle, "Mã kho").ToString() + " tháng " + thang + " năm " + nam + " ?", "HAMACO", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        SplashScreenManager.ShowForm(typeof(Frm_wait));
                        gen.ExcuteNonquery("tonghopghiso '" + thang + "','" + nam + "','" + view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString() + "',0");
                        SplashScreenManager.CloseForm();
                    }
                }
                else if (tsbt == "tsbtthuedaura" || tsbt == "tsbtthuedauvao")
                {
                    bc.loadthue(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), "kho", "CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG", userid);
                }
                else if (tsbt == "sktth" || tsbt == "sktthtomtat")
                {
                    string name = gen.GetString("select AccountName from Account where AccountNumber='" + userid + "'");
                    thtk.loadchitietsktth(ngaychungtu, ngaycuoi, tsbt, userid, name, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString());
                }
                else if (tsbt == "tsbtctlv")
                {
                    thtk.loadchitietlaivay(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Tên kho").ToString());
                }

                else if (tsbt == "tsbtctlvtn")
                {
                    thtk.loadchitietlaivaytheonganh(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Tên kho").ToString());
                }

                else if (tsbt == "tsbtctkqkd" || tsbt == "tsbtctkqkdtt")
                {
                    thtk.loadchitietkinhdoanh(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString());
                }
                else if (tsbt == "bkthbhtnvkdlqh")
                {
                    Frm_rpcongno rp = new Frm_rpcongno();
                    rp.getngaychungtu(ngaycuoi);
                    rp.getkho(userid);
                    rp.getuserid(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString());
                    rp.gettsbt(tsbt);
                    rp.Show();
                }
                else
                {
                    thtk.loadchitietskt(ngaychungtu, tsbt, view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString(), view.GetRowCellValue(view.FocusedRowHandle, "Mã kho").ToString() + " - " + view.GetRowCellValue(view.FocusedRowHandle, "Tên kho").ToString(), account, accountname);
                }
            }
        }