private bool ExitsNum(string num) { EtNet_BLL.ProductManager productTypeBLL = new EtNet_BLL.ProductManager(); DataTable dt = productTypeBLL.GetList(string.Format("ProdNo = '{0}'", num)); return(dt.Rows.Count > 0 ? true : false); }
//添加项目 private bool AddProd(string typeID) { EtNet_BLL.ProductManager proBLL = new EtNet_BLL.ProductManager(); EtNet_Models.Product proModel = new EtNet_Models.Product(); proModel.Brief = hidHtml.Value; proModel.FlagMain = chkMain.Checked; proModel.ProdName = txtName.Value; proModel.ProdNo = MakeNum(typeID); proModel.ProdTypeID = typeID; proModel.Remark = txtMark.Value; try { if (proBLL.Add(proModel) != null) { return(true); } else { return(false); } } catch { return(false); } }
private void InitData(int id) { EtNet_BLL.ProductManager proBLL = new EtNet_BLL.ProductManager(); EtNet_Models.Product proModel = proBLL.GetModel(id); txtBrief.Value = Server.UrlDecode(proModel.Brief); txtMark.Value = proModel.Remark; txtName.Value = proModel.ProdName; chkMain.Checked = proModel.FlagMain; EtNet_BLL.ProductTypeManager proType = new EtNet_BLL.ProductTypeManager(); txtType.Value = proType.GetModel(proModel.ProdTypeID).ProdTypeName; }
//添加项目 private bool AddProd(int id) { EtNet_BLL.ProductManager proBLL = new EtNet_BLL.ProductManager(); EtNet_Models.Product proModel = new EtNet_Models.Product(); proModel = proBLL.GetModel(id); proModel.Brief = hidHtml.Value; proModel.FlagMain = chkMain.Checked; proModel.ProdName = txtName.Value; proModel.Remark = txtMark.Value; try { return(proBLL.Update(proModel)); } catch { return(false); } }