public void SaveProduct() { string _productname = Parameters["pproductname"]; string _productlist = Parameters["pproductlist"]; string _productmodule = Parameters["pproductmodule"]; string _productdesc = Parameters["pproductdesc"]; string _briefpath = Parameters["pbriefpath"]; string _path = Parameters["ppath"]; string _briefcontent = Parameters["pbriefcontent"]; string _content = Parameters["pcontent"]; string _seotitle = Parameters["pseotitle"]; string _seokeyword = Parameters["pseokeyword"]; string _seodesc = Parameters["pseodesc"]; PortalProduct item = new PortalProduct(); item.FProductId = 0; item.FProductListID = Convert.ToInt64(_productlist); item.FProductName = _productname; item.FProductModule = _productmodule; item.FProductDesc = _productdesc; item.FProductPic = _path; item.FBriefPic = _briefpath; item.FSEOTitle = _seotitle; item.FSEOKeyWord = _seokeyword; item.FSEODesc = _seodesc; item.FProductBrief = _briefcontent; item.FProductContent = _content; PortalProductBiz biz = new PortalProductBiz(); ErrorEntity ErrInfo = new ErrorEntity(); biz.Insert(item, out ErrInfo); Response.Write(ErrInfo.ToJson()); }
public Int64 Insert(PortalProduct item, out ErrorEntity ErrInfo) { if (item.FProductListID == 0) { ErrInfo = new ErrorEntity(RespCode.Pp01003); return -1; } if (string.IsNullOrEmpty(item.FProductName)) { ErrInfo = new ErrorEntity(RespCode.Pp01004); return -1; } NameValueCollection parameters = new NameValueCollection(); parameters.Add("FProductListID", item.FProductListID.ToString()); parameters.Add("FProductName", item.FProductName); parameters.Add("FProductModule", item.FProductModule); parameters.Add("FProductDesc", item.FProductDesc); parameters.Add("FProductPic", item.FProductPic); parameters.Add("FBriefPic", item.FBriefPic); parameters.Add("FSEOTitle", item.FSEOTitle); parameters.Add("FSEOKeyWord", item.FSEOKeyWord); parameters.Add("FSEODesc", item.FSEODesc); parameters.Add("FProductBrief", item.FProductBrief); parameters.Add("FProductContent", item.FProductContent); return Insert(parameters, out ErrInfo); }
protected void Page_Load(object sender, EventArgs e) { string _id = Parameters["id"]; PortalProduct item = new PortalProduct(); PortalProductBiz biz = new PortalProductBiz(); item = biz.Select(_id); if (item != null) { gsproductname = item.FProductName; gsproductlistid = item.FProductListID.ToString(); gsproductmodule = item.FProductModule; gsproductdesc = item.FProductDesc; gsbriefpic = item.FBriefPic; gspic = item.FProductPic; gsbriefcontent = item.FProductBrief; gscontent = item.FProductContent; gsseotitle = item.FSEOTitle; gsseokeyword = item.FSEOKeyWord; gsseodesc = item.FSEODesc; } }