private void xrTableCell27_PreviewClick(object sender, PreviewMouseEventArgs e) { Frm_nhapxuat F = new Frm_nhapxuat(); F.gettsbt("bccnhtdbk"); F.getngay(ngay); F.ShowDialog(); }
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(); }
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(); } }
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); } } } } }
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(); }