Esempio n. 1
0
        private void xrTableCell27_PreviewClick(object sender, PreviewMouseEventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("bccnhtdbk");
            F.getngay(ngay);
            F.ShowDialog();
        }
Esempio n. 2
0
        private void pnvlpg_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("hdmhvosl");
            F.getrole(role);
            F.ShowDialog();
        }
Esempio n. 3
0
        private void tsbtin_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("pxhmtlbienbantra");
            F.getrole(role);
            F.ShowDialog();
        }
Esempio n. 4
0
        private void tsbtin_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt(pt);
            F.getrole(role);
            F.Show();
        }
Esempio n. 5
0
        private void toolddh_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("tsbthdmhkpnphieu");
            F.getrole(role);
            F.ShowDialog();
        }
Esempio n. 6
0
        private void hdmhpnk_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("pnk");
            F.getrole(gen.GetString("select ShippingMethodID from PUInvoice where RefID='" + role + "'"));
            F.ShowDialog();
        }
Esempio n. 7
0
        private void tsbtin_ButtonClick(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt(pt + "lpg");
            F.getrole(role);
            F.getcongty("CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
            F.ShowDialog();
        }
Esempio n. 8
0
        private void toolbbgnh_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt("tsbthdmhkpnbienban");
            F.getrole(role);
            F.getkho("0");
            F.ShowDialog();
        }
Esempio n. 9
0
        public void loadbangkebanhangtheongay(string ngaychungtu, string ngaycuoi, string manhanvien)
        {
            manhanvien = gen.GetString("select AccountingObjectID from AccountingObject where AccountingObjectID='" + manhanvien + "'");
            DataTable    temp = gen.GetTable("select substring(RefNo,4,12) as 'Số phiếu',JournalMemo as 'Đơn hàng', AccountingObjectCode as 'Mã khách', a.AccountingObjectName as 'Tên khách' ,a.AccountingObjectAddress as 'Địa chỉ',TotalAmountOC+TotalAmount-(TotalFreightAmount/(1+Cast(Tax as money)/100)) as 'Số tiền' from INOutward a, AccountingObject b where a.AccountingObjectID=b.AccountingObjectID and RefDate>='" + ngaychungtu + "' and RefDate<='" + ngaycuoi + "' and EmployeeIDSA='" + manhanvien + "' order by AccountingObjectCode");
            Frm_nhapxuat F    = new Frm_nhapxuat();

            F.getdata(temp);
            F.getngay(ngaychungtu);
            F.getrole(manhanvien);
            F.gettsbt("bkthbhtnvkd");
            F.ShowDialog();
        }
Esempio n. 10
0
        public void gettieude(string phieu, string tsbt, string loai, Frm_nhapxuat F)
        {
            roleID = phieu;
            tsbtID = tsbt;
            loaiID = loai;
            ThisF  = F;

            DataTable temp = new DataTable();

            xrLabel14.Text = gen.GetString("select Top 1 CompanyName from Center");
            //xrLabel20.Text = gen.GetString("select Top 1 Phone from Center");
            xrLabel20.Text = "02923.830.582 - Fax: 02923.731.505";

            if (tsbt == "tsbtddhphieumn")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,b.Address,Tel,Fax,JournalMemo,RefDate,ShippingNo,Cancel,CustomField6,DocumentIncluded,CustomField3,CustomField1,a.AccountingObjectID,RefType,a.ContactName from DDHNCC a, AccountingObject b where a.AccountingObjectID=b.AccountingObjectID and RefID='" + phieu + "'");
            }
            xrLabel3.Text = "Ngày  " + String.Format("{0:dd}", DateTime.Parse(temp.Rows[0][6].ToString())) + " tháng " + String.Format("{0:MM}", DateTime.Parse(temp.Rows[0][6].ToString())) + " năm " + String.Format("{0:yyyy}", DateTime.Parse(temp.Rows[0][6].ToString()));
            xrLabel9.Text = temp.Rows[0][0].ToString();

            if (temp.Rows[0][14].ToString() == "0")
            {
                xrLabel34.Text = "[X]";
            }
            else
            {
                if (temp.Rows[0][8].ToString() == "True")
                {
                    xrLabel30.Text = "[X]";
                }
                else
                {
                    xrLabel32.Text = "[X]";
                }
            }

            xrLabel26.Text    = temp.Rows[0][7].ToString();
            xrLabel13.Text    = temp.Rows[0][9].ToString();
            xrLabel22.Text    = temp.Rows[0][10].ToString();
            xrLabel18.Text    = temp.Rows[0][11].ToString();
            xrTableCell3.Text = temp.Rows[0][15].ToString();

            //xrLabel24.Text = temp.Rows[0][12].ToString();
            xrLabel45.Text = "Nơi nhận hàng: " + temp.Rows[0][12].ToString();

            try
            {
                xrLabel29.Text = gen.GetString("select Top 1 a.ParentContract from contractB a,(select ParentContract, MAX(SignedDate) as  SignedDate from contractB where AccountingObjectID='" + temp.Rows[0][13].ToString() + "' and SignedDate<='" + temp.Rows[0][6].ToString() + "'and EffectiveDate>='" + temp.Rows[0][6].ToString() + "' and Inactive=1 group by ParentContract) b where a.ParentContract=b.ParentContract and a.SignedDate=b.SignedDate");;
            }
            catch { }
        }
Esempio n. 11
0
        private void insl_Click(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            if (pt == "pnkvtddh")
            {
                F.gettsbt("pnkvosl");
                F.getrole(gen.GetString("select RefID from INInwardSU where RefNo='" + txtsct.Text + "'"));
            }
            else
            {
                F.gettsbt(pt + "vosl");
                F.getrole(role);
            }
            F.ShowDialog();
        }
Esempio n. 12
0
        private void xrLabel7_PreviewClick(object sender, PreviewMouseEventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.gettsbt(tsbtID);
            F.getrole(roleID);
            if (loaiID == "0")
            {
                F.getkho("1");
            }
            else
            {
                F.getkho("0");
            }
            F.ShowDialog();
            ThisF.Close();
        }
Esempio n. 13
0
        private void tsbtin_ButtonClick(object sender, EventArgs e)
        {
            Frm_nhapxuat F = new Frm_nhapxuat();

            if (pt == "pnkvtddh")
            {
                F.gettsbt("pnkvo");
                F.getrole(gen.GetString("select RefID from INInwardSU where RefNo='" + txtsct.Text + "'"));
            }
            else
            {
                F.gettsbt(pt + "vo");
                F.getrole(role);
            }
            F.getcongty("CÔNG TY CỔ PHẦN VẬT TƯ HẬU GIANG");
            F.ShowDialog();
        }
Esempio n. 14
0
        public void loadbangkehangtheongayin(string ngaychungtu, string userid)
        {
            DataTable dt   = new DataTable();
            DataTable temp = new DataTable();

            dt.Columns.Add("Mã hàng", Type.GetType("System.String"));
            dt.Columns.Add("Tên hàng", Type.GetType("System.String"));
            dt.Columns.Add("Số lượng", Type.GetType("System.Double"));
            dt.Columns.Add("Trọng lượng", Type.GetType("System.Double"));
            dt.Columns.Add("Khuyến mãi", Type.GetType("System.Double"));
            dt.Columns.Add("Đơn vị tính", Type.GetType("System.String"));
            string manhanvien = null;

            temp = gen.GetTable("select InventoryItemCode,InventoryItemName,SUM(Quantity),SUM(QuantityConvert),UnitPriceOC,sum(AmountOC),case when Quantity=0 then c.ConvertUnit else c.Unit end as loai,EmployeeIDSACode from INOutward a,INOutwardDetail b, InventoryItem c, (select * from OpeningAccountEntry131TT where EmployeeIDSAName='" + userid + "') d where a.RefNo=d.RefNo and a.RefID=b.RefID and b.InventoryItemID=c.InventoryItemID and RefType<>'1' group by InventoryItemCode,InventoryItemName,UnitPriceOC,EmployeeIDSACode,case when Quantity=0 then c.ConvertUnit else c.Unit end order by UnitPriceOC DESC,SUBSTRING(InventoryItemCode,8,2),InventoryItemCode");

            for (int i = 0; i < temp.Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = temp.Rows[i][0];
                dr[1] = temp.Rows[i][1];
                if (Double.Parse(temp.Rows[i][4].ToString()) != 0)
                {
                    dr[2] = temp.Rows[i][2];
                    dr[3] = temp.Rows[i][3];
                }
                else
                {
                    dr[4] = temp.Rows[i][3];
                }
                dr[5]      = temp.Rows[i][6];
                manhanvien = temp.Rows[i][7].ToString();
                dt.Rows.Add(dr);
            }
            if (manhanvien != null)
            {
                manhanvien = gen.GetString("select AccountingObjectID from AccountingObject where AccountingObjectCode='" + manhanvien + "'");
                Frm_nhapxuat F = new Frm_nhapxuat();
                F.getdata(dt);
                F.getngay(ngaychungtu);
                F.getrole(manhanvien);
                F.gettsbt("bkthbhtnvkdintong");
                F.ShowDialog();
            }
        }
Esempio n. 15
0
        private void xrTableCell15_PreviewClick(object sender, PreviewMouseEventArgs e)
        {
            baocaocongno131 bccn = new baocaocongno131();

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                if (dt1.Rows[i][0].ToString() == e.Brick.Text)
                {
                    if (gen.GetString("select Top 1 CompanyTaxCode from Center") == "1801115004" && kho1.ToUpper() == "E074A43F-0D0E-4D8F-BE2C-BFA6B32DBD5F")
                    {
                        Frm_nhapxuat F = new Frm_nhapxuat();
                        F.gettsbt("tsbtbccn131bienbanxacnhannochitiet");
                        F.getngay(tungay1);
                        F.getdenngay(denngay1);
                        F.getrole(e.Brick.Text);
                        if (dt1.Rows[i][6].ToString() != "")
                        {
                            F.getcongty(dt1.Rows[i][6].ToString());
                        }
                        else
                        {
                            F.getcongty("-" + dt1.Rows[i][7].ToString());
                        }
                        F.getdauky(dt1.Rows[i][5].ToString());
                        F.getkho(kho1);
                        F.ShowDialog();
                    }
                    else
                    {
                        if (dt1.Rows[i][2].ToString() != "")
                        {
                            bccn.loadchitietnothucte(e.Brick.Text, tungay1, denngay1, kho1, dt1.Rows[i][2].ToString(), loai);
                        }
                        else
                        {
                            bccn.loadchitietnothucte(e.Brick.Text, tungay1, denngay1, kho1, "-" + dt1.Rows[i][3].ToString(), loai);
                        }
                    }
                }
            }
        }
Esempio n. 16
0
        public void loadbangkehangtheongayin(string ngaychungtu, string ngaycuoi, string manhanvien)
        {
            DataTable dt   = new DataTable();
            DataTable temp = new DataTable();

            dt.Columns.Add("Mã hàng", Type.GetType("System.String"));
            dt.Columns.Add("Tên hàng", Type.GetType("System.String"));
            dt.Columns.Add("Số lượng", Type.GetType("System.Double"));
            dt.Columns.Add("Trọng lượng", Type.GetType("System.Double"));
            dt.Columns.Add("Khuyến mãi", Type.GetType("System.Double"));
            dt.Columns.Add("Đơn vị tính", Type.GetType("System.String"));

            temp = gen.GetTable("select InventoryItemCode,InventoryItemName,SUM(Quantity),SUM(QuantityConvert),UnitPriceOC,sum(AmountOC),case when Quantity=0 then c.ConvertUnit else c.Unit end as loai from INOutward a,INOutwardDetail b, InventoryItem c where a.RefID=b.RefID and b.InventoryItemID=c.InventoryItemID and RefDate>='" + ngaychungtu + "' and RefDate<='" + ngaycuoi + "' and EmployeeIDSA='" + manhanvien + "' and RefType<>'1' group by InventoryItemCode,InventoryItemName,UnitPriceOC,case when Quantity=0 then c.ConvertUnit else c.Unit end order by UnitPriceOC DESC,SUBSTRING(InventoryItemCode,8,2),InventoryItemCode");

            for (int i = 0; i < temp.Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = temp.Rows[i][0];
                dr[1] = temp.Rows[i][1];
                if (Double.Parse(temp.Rows[i][4].ToString()) != 0)
                {
                    dr[2] = temp.Rows[i][2];
                    dr[3] = temp.Rows[i][3];
                }
                else
                {
                    dr[4] = temp.Rows[i][3];
                }
                dr[5] = temp.Rows[i][6];
                dt.Rows.Add(dr);
            }
            Frm_nhapxuat F = new Frm_nhapxuat();

            F.getdata(dt);
            F.getngay(ngaychungtu);
            F.getrole(manhanvien);
            F.gettsbt("bkthbhtnvkdintong");
            F.ShowDialog();
        }
Esempio n. 17
0
        public void gettieude(string phieu, string loai, string tsbt, Frm_nhapxuat F)
        {
            roleID = phieu;
            tsbtID = tsbt;
            ThisF  = F;
            loaiID = loai;
            DataTable temp = new DataTable();

            if (tsbt == "pxhtbienban")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,Case when b.ContactName='' then b.ContactAddress else b.ContactName end,ContactTitle,IdentificationNumber,IssueDate,RefDate,ContactOfficeTel,c.FullName,c.JobTitle,c.HomePhone,c.MobilePhone,c.HomeAddress from OUTdeficit a, AccountingObject b, MSC_User c where a.AccountingObjectID=b.AccountingObjectID and a.EmployeeID=c.UserID and RefID='" + phieu + "'");
            }
            else if (tsbt == "tsbthdmhkpnbienban")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,Case when b.ContactName='' then b.ContactAddress else b.ContactName end,ContactTitle,b.IdentificationNumber,b.IssueDate,PURefDate,ContactOfficeTel,c.FullName,c.JobTitle,c.HomePhone,c.MobilePhone,c.HomeAddress from PUInvoice a, AccountingObject b, MSC_User c where a.AccountingObjectID=b.AccountingObjectID and a.UserID=c.UserID and RefID='" + phieu + "'");
            }
            else if (tsbt == "tsbthddhbienbanhp")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,Case when b.ContactName='' then b.ContactAddress else b.ContactName end,ContactTitle,b.IdentificationNumber,b.IssueDate,RefDate,ContactOfficeTel,c.FullName,c.JobTitle,c.HomePhone,c.MobilePhone,c.HomeAddress from DDHNCC a, AccountingObject b, MSC_User c where a.AccountingObjectID=b.AccountingObjectID and a.EmployeeID=c.UserID and RefID='" + phieu + "'");
            }
            else if (tsbt == "tsbthdbhkpnbienban")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,Case when b.ContactName='' then b.ContactAddress else b.ContactName end,ContactTitle,b.IdentificationNumber,b.IssueDate,PURefDate,ContactOfficeTel,c.FullName,c.JobTitle,c.HomePhone,c.MobilePhone,c.HomeAddress from SSInvoice a, AccountingObject b, MSC_User c where a.AccountingObjectID=b.AccountingObjectID and a.UserID=c.UserID and RefID='" + phieu + "'");
            }
            else if (tsbt == "tsbtpnkttbienban")
            {
                temp = gen.GetTable("select RefNo,b.AccountingObjectName,Case when b.ContactName='' then b.ContactAddress else b.ContactName end,ContactTitle,IdentificationNumber,IssueDate,RefDate,ContactOfficeTel,c.FullName,c.JobTitle,c.HomePhone,c.MobilePhone,c.HomeAddress from INInwardTT a, AccountingObject b, MSC_User c where a.AccountingObjectID=b.AccountingObjectID and a.EmployeeID=c.UserID and RefID='" + phieu + "'");
            }

            xrLabel5.Text = "Cần Thơ, ngày  " + String.Format("{0:dd}", DateTime.Parse(temp.Rows[0][6].ToString())) + " tháng " + String.Format("{0:MM}", DateTime.Parse(temp.Rows[0][6].ToString())) + " năm " + String.Format("{0:yyyy}", DateTime.Parse(temp.Rows[0][6].ToString()));
            xrLabel7.Text = "Căn cứ theo hợp đồng thuê kho, quản lý, bốc xếp số: ";
            string tenkhach = temp.Rows[0][1].ToString();

            xrLabel10.Text = "Bên giao: " + tenkhach.ToUpper();
            xrLabel16.Text = temp.Rows[0][2].ToString();
            xrLabel19.Text = temp.Rows[0][3].ToString();
            if (temp.Rows[0][4].ToString() != "")
            {
                xrLabel14.Text = temp.Rows[0][4].ToString();
                xrLabel20.Text = String.Format("{0:dd/MM/yyyy}", DateTime.Parse(temp.Rows[0][5].ToString()));
            }
            xrLabel15.Text = temp.Rows[0][7].ToString();

            xrLabel27.Text = temp.Rows[0][8].ToString();
            xrLabel30.Text = temp.Rows[0][9].ToString();
            xrLabel25.Text = temp.Rows[0][10].ToString();
            xrLabel26.Text = temp.Rows[0][11].ToString();
            xrLabel31.Text = temp.Rows[0][12].ToString();
            if (tsbt == "pxhtbienban")
            {
                temp = gen.GetTable("select top 1 ContractCode,SignedDate  from OUTdeficit a, ContractB b  where a.AccountingObjectID=b.AccountingObjectID and ContractName=N'Cho thuê kho' and SignedDate<=RefDate and EffectiveDate>=RefDate and b.No=0 and RefID='" + phieu + "' order by b.SignedDate");
            }
            else if (tsbt == "tsbthdmhkpnbienban")
            {
                temp = gen.GetTable("select top 1 ContractCode,SignedDate  from PUInvoice a, ContractB b  where a.AccountingObjectID=b.AccountingObjectID and ContractName=N'Cho thuê kho' and SignedDate<=PURefDate and EffectiveDate>=PURefDate and b.No=0 and RefID='" + phieu + "' order by b.SignedDate");
            }
            else if (tsbt == "tsbthddhbienbanhp")
            {
                temp = gen.GetTable("select top 1 ContractCode,SignedDate  from DDHNCC a, ContractB b  where a.AccountingObjectID=b.AccountingObjectID and ContractName=N'Cho thuê kho' and SignedDate<=RefDate and EffectiveDate>=RefDate and b.No=0 and RefID='" + phieu + "' order by b.SignedDate");
            }
            else if (tsbt == "tsbthdbhkpnbienban")
            {
                temp = gen.GetTable("select top 1 ContractCode,SignedDate  from SSInvoice a, ContractB b  where a.AccountingObjectID=b.AccountingObjectID and ContractName=N'Cho thuê kho' and SignedDate<=PURefDate and EffectiveDate>=PURefDate and b.No=0 and RefID='" + phieu + "' order by b.SignedDate");
            }
            else if (tsbt == "tsbtpnkttbienban")
            {
                temp = gen.GetTable("select top 1 ContractCode,SignedDate  from INInwardTT a, ContractB b  where a.AccountingObjectID=b.AccountingObjectID and ContractName=N'Cho thuê kho' and SignedDate<=RefDate and EffectiveDate>=RefDate and b.No=0 and RefID='" + phieu + "' order by b.SignedDate");
            }

            try { xrLabel7.Text = xrLabel7.Text + temp.Rows[0][0].ToString() + " ký ngày " + String.Format("{0:dd/MM/yyyy}", DateTime.Parse(temp.Rows[0][1].ToString())); }
            catch { }
            xrLabel7.Text = xrLabel7.Text + " giữa " + tenkhach + " và Công ty Cổ phần Vật tư Hậu Giang";

            if (loai == "0")
            {
                if (tsbt == "pxhtbienban")
                {
                    temp = gen.GetTable("select sum(QuantityConvert) from OUTdeficitDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthdmhkpnbienban")
                {
                    temp = gen.GetTable("select sum(QuantityConvert) from PUInvoiceDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthddhbienbanhp")
                {
                    temp = gen.GetTable("select sum(QuantityConvert) from DDHNCCDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthdbhkpnbienban")
                {
                    temp = gen.GetTable("select sum(QuantityConvert) from SSInvoiceDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbtpnkttbienban")
                {
                    temp = gen.GetTable("select sum(QuantityConvert) from INInwardDetailTT a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                xrLabel35.Text = "Bằng chữ: " + doi.ChuyenSo(Math.Round(Double.Parse(temp.Rows[0][0].ToString()), 0).ToString()).Replace("đồng", "kg");
            }
            else
            {
                if (tsbt == "pxhtbienban")
                {
                    temp = gen.GetTable("select sum(Quantity) from OUTdeficitDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthdmhkpnbienban")
                {
                    temp = gen.GetTable("select sum(Quantity) from PUInvoiceDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthddhbienbanhp")
                {
                    temp = gen.GetTable("select sum(Quantity) from DDHNCCDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbthdbhkpnbienban")
                {
                    temp = gen.GetTable("select sum(Quantity) from SSInvoiceDetail a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                else if (tsbt == "tsbtpnkttbienban")
                {
                    temp = gen.GetTable("select sum(Quantity) from INInwardDetailTT a, InventoryItem b where a.InventoryItemID=b.InventoryItemID and RefID='" + phieu + "'");
                }
                xrLabel35.Text = "Bằng chữ: " + doi.ChuyenSo(Math.Round(Double.Parse(temp.Rows[0][0].ToString()), 0).ToString()).Replace("đồng", "cây");
            }
        }