private void Bind() { if (!Id.Equals(Guid.Empty)) { ProductItem bll = new ProductItem(); var model = bll.GetModelByJoin(Id); if (model != null) { hProductItemId.Value = model.Id.ToString(); txtName.Value = model.Named; txtSort.Value = model.Sort.ToString(); imgProductItemPicture.Src = string.IsNullOrWhiteSpace(model.MPicture) ? "../../Images/nopic.gif" : model.MPicture; hImgProductItemPictureId.Value = model.PictureId.ToString(); txtEnableStartTime_ProductItem.Value = model.EnableStartTime == DateTime.MinValue ? "" : model.EnableStartTime.ToString("yyyy-MM-dd HH:mm:ss"); txtEnableEndTime_ProductItem.Value = model.EnableStartTime == DateTime.MinValue ? "" : model.EnableStartTime.ToString("yyyy-MM-dd HH:mm:ss"); var li = rbtnIsEnableList_ProductItem.Items.FindByValue(model.IsEnable.ToString().ToLower()); if (li != null) { li.Selected = true; } li = rbtnList_ProductItem.Items.FindByValue(model.IsDisable.ToString().ToLower()); if (li != null) { li.Selected = true; } } } }
private void Bind() { if (!Id.Equals(Guid.Empty)) { Page.Title = "编辑商品"; ProductItem piBll = new ProductItem(); var model = piBll.GetModelByJoin(Id); if (model != null) { txtProductName.Value = model.ProductName; txtSubTitle.Value = model.SubTitle; txtOriginalPrice.Value = model.OriginalPrice.ToString("N"); txtProductPrice.Value = model.ProductPrice.ToString("N"); txtDiscount.Value = model.Discount.ToString(); txtDiscountDescri.Value = model.DiscountDescri; txtStockNum.Value = model.StockNum.ToString(); txtContent.Value = model.Descr; hId.Value = Id.ToString(); ProductPicture ppBll = new ProductPicture(); myDataAppend += "<div id=\"myDataForModel\">["; myDataAppend += "{\"ProductPictureId\":\"" + model.ProductPictureId + "\",\"ImageUrl\":\"" + model.ImageUrl + "\",\"OtherPicture\":" + ppBll.GetJson(model.OtherPicture) + ",\"SizeItem\":" + model.SizeItem + ",\"SizePicture\":\"" + model.SizePicture + "\",\"CategoryId\":\"" + model.CategoryId + "\",\"BrandId\":\"" + model.BrandId + "\",\"CustomMenuId\":\"" + model.CustomMenuId.ToString().Replace(Guid.Empty.ToString(), "") + "\"}"; myDataAppend += "]</div>"; } } }