Пример #1
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();
        }
Пример #2
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);
                }
            }
        }