private void frmDetailed_Load(object sender, EventArgs e) { dtpbegin.Text = iLoginEx.ReadUserProfileValue("SO321", "dtpbegind"); dtpend.Text = iLoginEx.ReadUserProfileValue("SO321", "dtpendd"); cbDetail.Checked = iLoginEx.ReadUserProfileValue("SO321", "cbDetail") == "1" ? true : false; string sql = ""; switch (zz_Index) { case 10: //业务员 sql = "and c.cPersonName ='" + cPersonName + "' and cy.addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31'"; break; case 1: //客户 sql = "and b.ccusname ='" + cPersonName + "' and cy.addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31'"; break; case 9: //成品分类 if (cPersonName == "配件") { sql = "and cy.cinvccode ='' and cy.addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31'"; } else if (cPersonName == "硬盘") { sql = "and cy.cinvccode ='H' and cy.addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31'"; } else { sql = "and cls.cInvCName ='" + cPersonName + "' and cy.addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31'"; } break; } dgvLoadInfo(sql); }
private void frmRemoveTheSuit_Load(object sender, EventArgs e) { SLbAccID.Text = iLoginEx.AccID(); //固定格式 SLbAccName.Text = iLoginEx.AccName(); //固定格式 SLbServer.Text = iLoginEx.DBServerHost(); //固定格式 SLbYear.Text = iLoginEx.iYear(); //固定格式 SLbUser.Text = iLoginEx.UserId() + "[" + iLoginEx.UserName() + "]"; //固定格式 dgvLoadInfo(); }
private void frmEndless_Load(object sender, EventArgs e) { SLbAccID.Text = iLoginEx.AccID(); SLbAccName.Text = iLoginEx.AccName(); SLbServer.Text = iLoginEx.DBServerHost(); SLbYear.Text = iLoginEx.iYear(); SLbUser.Text = iLoginEx.UserId() + "[" + iLoginEx.UserName() + "]"; this.tssldateTime.Text = "当前时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss.fff"); this.tirTime.Interval = 1; this.tirTime.Start();//backups }
public FrmMCoding(string[] args) { try { InitializeComponent(); iLoginEx.Initialize(args, AuthID);//必须先初始化LoginEx //固定格式 SLbAccID.Text = iLoginEx.AccID(); //固定格式 SLbAccName.Text = iLoginEx.AccName(); //固定格式 SLbServer.Text = iLoginEx.DBServerHost(); //固定格式 SLbYear.Text = iLoginEx.iYear(); //固定格式 SLbUser.Text = iLoginEx.UserId() + "[" + iLoginEx.UserName() + "]"; //固定格式 } catch (Exception ex) { frmMessege frmmsg = new frmMessege(ex.ToString(), "Form1()"); frmmsg.ShowDialog(this); } }
private void btnSalesCost_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); OLEDBHelper.iLoginEx = iLoginEx; string selectSQL = "select zs.Yr as 年份,zs.aCsocode as 订单号,zs.ztCinvcode as 存货编码,ic.cinvCName as 存货分类 ,zs.ztCinvName as 存货名称,zs.ztCinvstd as 规格型号,zs.addate as 日期,zs.Costs as 成本,zs.sales as 销售额,zs.Number as 数量 \r\n"; selectSQL += " from zhrs_t_SaleaCosts zs left join \r\n"; selectSQL += " Inventoryclass ic on zs.cinvCCode=ic.cinvccode \r\n"; selectSQL += " where zs.sales<zs.Costs and zs.Yr='" + iLoginEx.iYear() + "' \r\n"; selectSQL += " and zs.cinvCCode=case when left(zs.cInvCCode,2) in ('CB','SG') \r\n"; selectSQL += " then zs.cInvCCode else case when zs.cInvCCode='0507' then zs.cInvCCode end end \r\n"; dt = OLEDBHelper.GetDataTalbe(selectSQL, CommandType.Text); dgvcostError.DataSource = dt; dgvcostError.DefaultCellStyle.WrapMode = DataGridViewTriState.True; dgvcostError.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; for (int i = 7; i < 10; i++) { dgvcostError.Columns[i].DefaultCellStyle.Format = "#,###0.0000"; dgvcostError.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; } lblsalescost.Text = "总记录数:" + dt.Rows.Count; s = "成本高于销售额"; }
private void frmSoAddInfo_Load(object sender, EventArgs e) { this.Text += " " + System.Windows.Forms.Application.ProductVersion; SLbAccID.Text = iLoginEx.AccID(); SLbAccName.Text = iLoginEx.AccName(); SLbServer.Text = iLoginEx.DBServerHost(); SLbYear.Text = iLoginEx.iYear(); SLbUser.Text = iLoginEx.UserId() + "[" + iLoginEx.UserName() + "]"; txtCinvcode.Text = Cinvcode; txtCsocode.Text = Csocode; lblnum.Text = Siquantity.ToString(); LoadDataGridView(); }
public frmPUR442Main(string[] args) { try { InitializeComponent(); //37:442-到货单查询(按请购单分类) iLoginEx.Initialize(args, AuthID);//必须先初始化LoginEx SLbAccID.Text = iLoginEx.AccID(); SLbAccName.Text = iLoginEx.AccName(); SLbServer.Text = iLoginEx.DBServerHost(); SLbYear.Text = iLoginEx.iYear(); SLbUser.Text = iLoginEx.UserId() + "[" + iLoginEx.UserName() + "]"; } catch (Exception ex) { frmMessege frmmsg = new frmMessege(ex.ToString(), "frmPUR442Main()"); frmmsg.ShowDialog(this); } }
private void btnCompare_Click(object sender, EventArgs e) { if (i_lst_1.Count > 0) { i_lst_1.Clear(); } OLEDBHelper.iLoginEx = iLoginEx; string selectSQL = "select a.Csocode as 'aCsocode', sum(a.iSum*a.iexchrate/(a.itaxrate/100+1)) as 'sales',sum(a.iPrice) as 'Costs' \r\n"; selectSQL += " from (select b.Csocode,b.Cinvcode,k.cInvCCode,h.ccuscode,k.iPrice,k.CinvName,k.Cinvstd, \r\n"; selectSQL += " b.iorderrowno,b.iquantity ,b.itaxrate,b.iSum,h.ddate,c.iexchrate,b.isosid from kcsaleoutH h \r\n"; selectSQL += " left join kcsaleoutb k on h.id=k.id \r\n"; selectSQL += " left join Sales_FHD_W b on k.iDLsID=b.iDLsID \r\n"; selectSQL += " left join Sales_FHD_T c on b.DLID=c.DLID \r\n"; selectSQL += " where h.ddate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31' and k.cInvCCode like 'CB%')a group by Csocode \r\n"; OleDbDataReader dr = OLEDBHelper.ExecuteReader(selectSQL, CommandType.Text); while (dr.Read()) { i_lst.Add(new aCsocodeSales() { aCsocode = dr["aCsocode"].ToString(), sales = Convert.ToDecimal(dr["sales"] == DBNull.Value ? 0 : dr["sales"]), }); } dr.Close(); OLEDBHelper.CloseCon(); decimal sum_1 = 0; string aCsocode_1 = "不存在订单"; foreach (aCsocodeSales u in i_lst) { selectSQL = "select count(*) from zhrs_t_SaleaCosts where aCsocode='" + u.aCsocode + "'"; int n = Convert.ToInt32(OLEDBHelper.ExecuteScalar(selectSQL, CommandType.Text)); if (n > 0) { selectSQL = "select sum(sales) as 'sales_1',aCsocode from zhrs_t_SaleaCosts where aCsocode='" + u.aCsocode + "' and addate between '" + iLoginEx.iYear() + "-01-01' and '" + iLoginEx.iYear() + "-12-31' group by aCsocode"; OleDbDataReader dr_1 = OLEDBHelper.ExecuteReader(selectSQL, CommandType.Text); if (dr_1.Read()) { sum_1 = Convert.ToDecimal(dr_1["sales_1"] == DBNull.Value ? 0 : dr_1["sales_1"]); aCsocode_1 = dr_1["aCsocode"].ToString(); } dr_1.Close(); OLEDBHelper.CloseCon(); decimal dec = Convert.ToDecimal(u.sales.ToString("####0.00")); decimal dec_1 = Convert.ToDecimal(sum_1.ToString("####0.00")); if (!dec.Equals(dec_1)) { aCsocodeSales ia = new aCsocodeSales(); ia.aCsocode = u.aCsocode; ia.sales = u.sales; ia.aCsocode_1 = aCsocode_1; ia.sales_1 = sum_1; ia.Difference = u.sales - sum_1; i_lst_1.Add(ia); } } else { aCsocodeSales ia_1 = new aCsocodeSales(); ia_1.aCsocode = u.aCsocode; ia_1.sales = u.sales; ia_1.aCsocode_1 = aCsocode_1; ia_1.sales_1 = sum_1; i_lst_1.Add(ia_1); } } dgvSc.DataSource = i_lst_1; lblCount.Text = "记录数:" + i_lst_1.Count; }