private void btnAdd_Click(object sender, System.EventArgs e) { string strPrvdName = this.txtProviderName.Text.Trim(); CMSMStruct.ProviderStockStruct pss1 = new CommCenter.CMSMStruct.ProviderStockStruct(); pss1.strPrvdCode = this.txtProviderID.Text.Trim(); pss1.strGoodsCode = this.txtGoodsCode.Text.Trim(); pss1.strGoodsName = this.txtGoodsName.Text.Trim(); pss1.strProducer = this.txtProducer.Text.Trim(); if (pss1.strPrvdCode == "") { this.Popup("供应商编码为空,无法添加!"); return; } if (this.txtStockPrice.Text.Trim() == "") { this.Popup("供货单价不能为空!"); return; } else if (!this.JudgeIsNum(this.txtStockPrice.Text.Trim())) { this.Popup("供货单价必须是数字!"); return; } else { pss1.dGoodsPrice = Math.Round(double.Parse(this.txtStockPrice.Text.Trim()), 2); } Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; StoBusi = new BusiComm.StorageBusi(strcons); if (pss1.strGoodsCode == "") { this.Popup("供应货品编码为空,无法添加!"); return; } else if (StoBusi.IsExistProvGoods(pss1.strPrvdCode, pss1.strGoodsCode)) { this.Popup("该供应商供应该货品关系已经存在!"); return; } if (pss1.strGoodsName == "") { this.Popup("供应货品名称为空,无法添加!"); return; } CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"]; pss1.strOperName = ls1.strOperName; if (StoBusi.NewProviderStockAdd(pss1)) { this.SetSuccMsgPageBydir("供应商供应货品添加成功!", "Storage/wfmProvGInfo.aspx?pid=" + pss1.strPrvdCode + "&pname=" + strPrvdName); this.dgbind(); } else { this.SetErrorMsgPageBydirHistory("供应商供应货品添加失败!"); } }