//获取使用产品情况 private IList <CRMCustomerProd> GetSaveProdInfo() { List <CRMCustomerProd> Lst = new List <CRMCustomerProd>(); DataTable dt = svr.SearchByCriteria("CRMProduct", out recordCount, " and len(code)=6", "code"); for (int i = 0; i < dt.Rows.Count; i++) { TextBox txtUsage = (TextBox)tbProd.FindControl("txtUsage_" + dt.Rows[i]["Code"].ToString()); TextBox txtBrand = (TextBox)tbProd.FindControl("txtBrand_" + dt.Rows[i]["Code"].ToString()); TextBox txtRemark = (TextBox)tbProd.FindControl("txtRemark_" + dt.Rows[i]["Code"].ToString()); if (txtBrand == null || txtUsage == null || txtRemark == null) { continue; } //Usage,Brand其中之一有数据 if (!(string.IsNullOrEmpty(txtUsage.Text) && string.IsNullOrEmpty(txtBrand.Text))) { CRMCustomerProd cp = new CRMCustomerProd(); if (string.IsNullOrEmpty(hidID.Value.Trim()) == false) { cp.CustID = long.Parse(hidID.Value); } else { cp.CustID = 0; } cp.ProdID = long.Parse(dt.Rows[i]["ProdID"].ToString()); cp.Usage = txtUsage.Text; cp.Brand = txtBrand.Text; cp.Remark = txtRemark.Text; Lst.Add(cp); } } return(Lst); }
//获取使用产品情况 private IList<CRMCustomerProd> GetSaveProdInfo() { List<CRMCustomerProd> Lst = new List<CRMCustomerProd>(); DataTable dt = svr.SearchByCriteria("CRMProduct", out recordCount, " and len(code)=6", "code"); for (int i = 0; i < dt.Rows.Count; i++) { TextBox txtUsage = (TextBox)tbProd.FindControl("txtUsage_" + dt.Rows[i]["Code"].ToString()); TextBox txtBrand = (TextBox)tbProd.FindControl("txtBrand_" + dt.Rows[i]["Code"].ToString()); TextBox txtRemark = (TextBox)tbProd.FindControl("txtRemark_" + dt.Rows[i]["Code"].ToString()); if (txtBrand == null || txtUsage == null || txtRemark == null) continue; //Usage,Brand其中之一有数据 if (!(string.IsNullOrEmpty(txtUsage.Text) && string.IsNullOrEmpty(txtBrand.Text))) { CRMCustomerProd cp = new CRMCustomerProd(); if (string.IsNullOrEmpty(hidID.Value.Trim()) == false) cp.CustID = long.Parse(hidID.Value); else cp.CustID = 0; cp.ProdID = long.Parse(dt.Rows[i]["ProdID"].ToString()); cp.Usage = txtUsage.Text; cp.Brand = txtBrand.Text; cp.Remark = txtRemark.Text; Lst.Add(cp); } } return Lst; }