private void btnOK_Click(object sender, System.EventArgs e) { try { string strSql = "select * from tbAdvancePayment where cnnCustID = " + txtCustID.Text; DataTable dt = Helper.Query(strSql); if (dt.Rows.Count == 0 || dt.Rows.Count > 1) { Popup("未找到客户,或客户存在冲突"); return; } AdvancePayment ap = new AdvancePayment(dt); //AdvancePayment ap = new AdvancePayment(); ap.cndFeeDate = DateTime.Parse(txtFeeDate.Text); ap.cndPayDate = DateTime.Parse(txtPayDate.Text); ap.cnnCustID = Convert.ToDecimal(txtCustID.Text); ap.cnnPayFee = Convert.ToDecimal(txtPayFee.Text); ap.cnnPrepayFee = Convert.ToDecimal(txtPrepayFee.Text); ap.cnvcAcctName = txtAcctName.Text; ap.cnvcComments = txtComments.Text; ap.cnvcCustName = txtCustName.Text; ap.cnvcFeeName = txtFeeName.Text; ap.cnvcMgr = txtMgr.Text; ap.cnvcProjectName = txtProjectName.Text; SalesManageFacade.UpdateAdvancePayment(ap, oper); Popup("预收账款修改成功"); } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { string strSql = "select * from tbAdvancePayment where cnnCustID = " + txtCustID.Text; DataTable dt = Helper.Query(strSql); if (dt.Rows.Count > 0) { Popup("客户存在冲突"); return; } if (this.JudgeIsNull(txtCustName.Text, "客户")) { return; } if (this.JudgeIsNull(txtCustName.Text, "客户名称")) { return; } if (this.JudgeIsNull(txtFeeDate.Text, "费用计收时间")) { return; } if (this.JudgeIsNull(txtPayDate.Text, "交款时间")) { return; } AdvancePayment ap = new AdvancePayment(); ap.cndFeeDate = DateTime.Parse(txtFeeDate.Text); ap.cndPayDate = DateTime.Parse(txtPayDate.Text); ap.cnnCustID = Convert.ToDecimal(txtCustID.Text); ap.cnnPayFee = Convert.ToDecimal(txtPayFee.Text); ap.cnnPrepayFee = Convert.ToDecimal(txtPrepayFee.Text); ap.cnvcAcctName = txtAcctName.Text; ap.cnvcComments = txtComments.Text; ap.cnvcCustName = txtCustName.Text; ap.cnvcFeeName = txtFeeName.Text; ap.cnvcMgr = txtMgr.Text; ap.cnvcProjectName = txtProjectName.Text; SalesManageFacade.AddAdvancePayment(ap, oper); Popup("预收账款添加成功"); this.txtCustName.Text = ""; this.txtProjectName.Text = ""; this.txtAcctName.Text = ""; this.txtMgr.Text = ""; this.txtPayDate.Text = ""; this.txtFeeName.Text = ""; this.txtFeeDate.Text = ""; this.txtPayFee.Text = ""; this.txtPrepayFee.Text = ""; this.txtComments.Text = ""; } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.Web.UI.ImageClickEventArgs e) { try { if (txtCustID.Text.Trim() == "" || this.ddlYear.SelectedValue == "") { Popup("请选择客户和年份!"); return; } string strSql = "select * from tbSaleCost where cnnCustID = " + txtCustID.Text.Trim() + " and cnvcYear='" + this.ddlYear.SelectedValue + "'"; DataTable dt = Helper.Query(strSql); if (dt.Rows.Count > 0) { Popup("本销售成本存在冲突"); return; } if (this.JudgeIsNull(txtCustName.Text.Trim(), "客户名称")) { return; } if (this.JudgeIsNull(txtBudgetCost.Text.Trim(), "预算销售成本") || !this.JudgeIsNum(txtBudgetCost.Text.Trim(), "预算销售成本")) { return; } if (this.JudgeIsNull(txtRealSaleCost.Text.Trim(), "实际销售成本合计") || !this.JudgeIsNum(txtRealSaleCost.Text.Trim(), "实际销售成本合计")) { return; } SaleCost cost = new SaleCost(); cost.cnnCustID = decimal.Parse(txtCustID.Text.Trim()); cost.cnvcCustName = txtCustName.Text.Trim(); cost.cnvcYear = ddlYear.SelectedValue; cost.cnnBudgetCost = decimal.Parse(txtBudgetCost.Text.Trim()); cost.cnnRealSaleCost = decimal.Parse(txtRealSaleCost.Text.Trim()); SalesManageFacade.AddSaleCost(cost, oper); Popup("销售成本添加成功"); this.txtCustID.Text = ""; this.txtCustName.Text = ""; this.txtBudgetCost.Text = ""; this.txtRealSaleCost.Text = ""; } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { if (this.JudgeIsNull(txtCustID.Text, "客户")) { return; } if (this.JudgeIsNull(txtCustName.Text, "客户名称")) { return; } if (!this.JudgeIsNum(txtFee.Text, "收入")) { return; } DataTable dt = Helper.Query("select * from tbAccountReceivable where cnnCustID = " + txtCustID.Text); AccountReceivable ar = new AccountReceivable(dt); ar.cnnAcctID = Convert.ToDecimal(txtAcctID.Text); //ar.cnnCustID = Convert.ToDecimal(txtCustID.Text); ar.cnnFee = Convert.ToDecimal(txtFee.Text); ar.cnvcAcctName = txtAcctName.Text; ar.cnvcContractNo = txtContractNo.Text; ar.cnvcCustLevel = ddlCustLevel.SelectedValue; ar.cnvcCustName = txtCustName.Text; ar.cnvcProjectName = txtProjectName.Text; ar.cnvcSvcTypeName = txtSvcTypeName.Text; ar.cnvcTradeType1 = ddlTradeType1.SelectedValue; ar.cnvcTradeType2 = ddlTradeType2.SelectedValue; SalesManageFacade.UpdateAccountReceivable(ar, oper); Popup("成功修改应收"); } catch (Exception ex) { Popup(ex.Message); } }
private void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e) { try { SaleCost cost = new SaleCost(); decimal costsum = 0; //1月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[6].Controls[0]).Text.Trim(), "1月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[6].Controls[0]).Text.Trim(), "1月使用")) { return; } else { cost.cnnUsed1 = decimal.Parse(((TextBox)e.Item.Cells[6].Controls[0]).Text.Trim()); costsum += cost.cnnUsed1; } //2月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[7].Controls[0]).Text.Trim(), "2月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[7].Controls[0]).Text.Trim(), "2月使用")) { return; } else { cost.cnnUsed2 = decimal.Parse(((TextBox)e.Item.Cells[7].Controls[0]).Text.Trim()); costsum += cost.cnnUsed2; } //3月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[8].Controls[0]).Text.Trim(), "3月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[8].Controls[0]).Text.Trim(), "3月使用")) { return; } else { cost.cnnUsed3 = decimal.Parse(((TextBox)e.Item.Cells[8].Controls[0]).Text.Trim()); costsum += cost.cnnUsed3; } //4月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[9].Controls[0]).Text.Trim(), "4月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[9].Controls[0]).Text.Trim(), "4月使用")) { return; } else { cost.cnnUsed4 = decimal.Parse(((TextBox)e.Item.Cells[9].Controls[0]).Text.Trim()); costsum += cost.cnnUsed4; } //5月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim(), "5月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim(), "5月使用")) { return; } else { cost.cnnUsed5 = decimal.Parse(((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim()); costsum += cost.cnnUsed5; } //6月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim(), "6月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim(), "6月使用")) { return; } else { cost.cnnUsed6 = decimal.Parse(((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim()); costsum += cost.cnnUsed6; } //7月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[12].Controls[0]).Text.Trim(), "7月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[12].Controls[0]).Text.Trim(), "7月使用")) { return; } else { cost.cnnUsed7 = decimal.Parse(((TextBox)e.Item.Cells[12].Controls[0]).Text.Trim()); costsum += cost.cnnUsed7; } //8月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[13].Controls[0]).Text.Trim(), "8月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[13].Controls[0]).Text.Trim(), "8月使用")) { return; } else { cost.cnnUsed8 = decimal.Parse(((TextBox)e.Item.Cells[13].Controls[0]).Text.Trim()); costsum += cost.cnnUsed8; } //9月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[14].Controls[0]).Text.Trim(), "9月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[14].Controls[0]).Text.Trim(), "9月使用")) { return; } else { cost.cnnUsed9 = decimal.Parse(((TextBox)e.Item.Cells[14].Controls[0]).Text.Trim()); costsum += cost.cnnUsed9; } //10月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[15].Controls[0]).Text.Trim(), "10月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[15].Controls[0]).Text.Trim(), "10月使用")) { return; } else { cost.cnnUsed10 = decimal.Parse(((TextBox)e.Item.Cells[15].Controls[0]).Text.Trim()); costsum += cost.cnnUsed10; } //11月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[16].Controls[0]).Text.Trim(), "11月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[16].Controls[0]).Text.Trim(), "11月使用")) { return; } else { cost.cnnUsed11 = decimal.Parse(((TextBox)e.Item.Cells[16].Controls[0]).Text.Trim()); costsum += cost.cnnUsed11; } //12月 if (this.JudgeIsNull(((TextBox)e.Item.Cells[17].Controls[0]).Text.Trim(), "12月使用") || !this.JudgeIsNum(((TextBox)e.Item.Cells[17].Controls[0]).Text.Trim(), "12月使用")) { return; } else { cost.cnnUsed12 = decimal.Parse(((TextBox)e.Item.Cells[17].Controls[0]).Text.Trim()); costsum += cost.cnnUsed12; } cost.cnnCustID = decimal.Parse(e.Item.Cells[0].Text.Trim()); cost.cnvcCustName = e.Item.Cells[1].Text.Trim(); cost.cnvcYear = e.Item.Cells[2].Text.Trim(); cost.cnnBudgetCost = decimal.Parse(e.Item.Cells[3].Text.Trim()); cost.cnnRealSaleCost = decimal.Parse(e.Item.Cells[4].Text.Trim()); cost.cnnCostUsed = costsum; SalesManageFacade.UpdateSaleCost(cost, oper); Popup("销售成本修改成功"); string strsql = "select * from tbSaleCost where cnnCustID=" + cost.cnnCustID + " and cnvcYear='" + cost.cnvcYear + "' order by cnnCustID,cnvcYear"; DataTable dtout = Helper.Query(strsql); Session.Remove("QUERY"); Session["QUERY"] = dtout; this.DataGrid1.EditItemIndex = -1; this.DataGrid1.DataSource = dtout; this.DataGrid1.DataBind(); } catch (Exception ex) { Popup(ex.Message); } }
private void AddSaleCost(DataTable dt) { SalesManageFacade.BatchSaleCost(dt, oper); }
private void AddAccountReceivable(DataTable dt) { SalesManageFacade.BatchAccountReceivable(dt, oper); }
private void AddAdvancePayment(DataTable dt) { SalesManageFacade.BatchAdvancePayment(dt, oper); }