protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId)) { return; } SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId); if (shipper == null) { return; } this.litStoreName = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreName"); this.litStoreOwnerName = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreOwnerName"); this.litStoreAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreAddress"); this.SupplierADImg = (System.Web.UI.WebControls.Image) this.FindControl("SupplierADImg"); this.litStoreName.Text = string.IsNullOrWhiteSpace(shipper.ShopName) ? shipper.SupplierName : shipper.ShopName; //shipper.SupplierName; this.litStoreOwnerName.Text = shipper.ShopOwner; this.litStoreAddress.Text = RegionHelper.GetFullRegion(shipper.County, ""); if (!string.IsNullOrWhiteSpace(shipper.PCImage)) { this.SupplierADImg.ImageUrl = shipper.PCImage; } }
private void BindSupplier() { this.ddlSupplier.DataSource = SupplierHelper.GetSupplier(); this.ddlSupplier.DataTextField = "SupplierName"; this.ddlSupplier.DataValueField = "SupplierId"; this.ddlSupplier.DataBind(); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId)) { base.GotoResourceNotFound(); return; } SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId); if (shipper == null) { base.GotoResourceNotFound(); return; } this.rptProducts = (ThemedTemplatedRepeater)this.FindControl("rptProducts"); this.hotSale = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale");//销售排行 this.pager = (Pager)this.FindControl("pager"); this.litSearchResultPage = (System.Web.UI.WebControls.Literal) this.FindControl("litSearchResultPage"); if (!this.Page.IsPostBack) { this.BindSearch(); } }
protected override void AttachChildControls() { this.serach_text = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_text"); this.search_Subtext = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_Subtext"); this.rptProducts = (ThemedTemplatedRepeater)this.FindControl("rptProducts"); this.pager = (Pager)this.FindControl("pager"); this.litProductCount = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCount"); this.litSupplierDescribe = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierDescribe"); if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId)) { base.GotoResourceNotFound(); return; } SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId); if (shipper == null) { base.GotoResourceNotFound(); return; } else { litSupplierDescribe.Text = shipper.Description; } if (!this.Page.IsPostBack) { this.BindSearch(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["SupplierId"], out this.supplierId)) { base.GotoResourceNotFound(); return; } this.btnSave.Click += new System.EventHandler(this.btnEditShipper_Click); if (!this.Page.IsPostBack) { SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId); if (shipper == null) { base.GotoResourceNotFound(); return; } Globals.EntityCoding(shipper, false); this.txtSupplierName.Text = shipper.SupplierName; this.txtShopName.Text = shipper.ShopName; this.txtSupplierCode.Text = shipper.SupplierCode; this.txtWarehouseName.Text = shipper.ShipWarehouseName; this.ddlReggion.SetSelectedRegionId(new int?(shipper.County)); this.txtAddress.Text = shipper.Address; this.txtPhone.Text = shipper.Phone; this.txtMobile.Text = shipper.Mobile; this.txtAddress.Text = shipper.Address; this.txtDescription.Text = shipper.Description; this.ckbApproveKey.Checked = shipper.ApproveKey; this.littlepic1.Src = shipper.Logo; this.fmSrc1.Value = shipper.Logo; this.littlepic2.Src = shipper.PCImage; this.fmSrc2.Value = shipper.PCImage; this.littlepic3.Src = shipper.MobileImage; this.fmSrc3.Value = shipper.MobileImage; this.txtSupplierOwnerName.Text = shipper.ShopOwner; txtContact.Text = shipper.Contact; txtEmail.Text = shipper.Email; txtFax.Text = shipper.Fax; txtCategory.Text = shipper.Category; txtBeneficiaryName.Text = shipper.BeneficiaryName; txtSwiftCode.Text = shipper.SwiftCode; txtBankAccount.Text = shipper.BankAccount; txtBankName.Text = shipper.BankName; txtBankAddress.Text = shipper.BankAddress; txtIBAN.Text = shipper.IBAN; TtxtRemark.Text = shipper.Remark; } }
/// <summary> /// 绑定供货商 /// </summary> private void BindSupplier() { DataTable supplierdt = SupplierHelper.GetSupplier(); ddcSupplier.DataTextField = "SupplierName"; ddcSupplier.DataValueField = "SupplierId"; ddcSupplier.DataSource = supplierdt; ddcSupplier.DataBind(); }
private void BindSupplier() { DbQueryResult productTypes = SupplierHelper.GetSupplier(new SupplierQuery { SupplierName = this.searchkey, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize }); this.grdSupplier.DataSource = productTypes.Data; this.grdSupplier.DataBind(); this.pager.TotalRecords = productTypes.TotalRecords; }
/// <summary> /// 绑定供应商 /// </summary> private void BindSySupplier() { this.dllSupper.Items.Clear(); this.dllSupper.Items.Add(new System.Web.UI.WebControls.ListItem("全部", string.Empty)); DataTable dt = SupplierHelper.GetSupplier(); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { this.dllSupper.Items.Add(new ListItem(dr["SupplierName"].ToString(), dr["SupplierId"].ToString())); } } }
public void BindDataBind() { this.Items.Clear(); this.Items.Add(new ListItem(this.NullToDisplay, string.Empty)); DataTable supplierdt = SupplierHelper.GetSupplier(); if (supplierdt != null && supplierdt.Rows.Count > 0) { for (int i = 0; i < supplierdt.Rows.Count; i++) { string itemValue = supplierdt.Rows[i]["SupplierId"].ToString(); ListItem item = new ListItem(Globals.HtmlDecode(supplierdt.Rows[i]["SupplierName"].ToString()), itemValue); this.Items.Add(item); } } }
protected void Page_Load(object sender, System.EventArgs e) { supplierId = CheckSupplierRole(); if (supplierId <= 0) { base.GotoResourceNotFound(); return; } this.btnSave.Click += new System.EventHandler(this.btnEditShipper_Click); if (!this.Page.IsPostBack) { SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId); if (shipper == null) { base.GotoResourceNotFound(); return; } Globals.EntityCoding(shipper, false); this.txtSupplierName.Text = shipper.SupplierName; this.txtShopName.Text = shipper.ShopName; this.txtSupplierCode.Text = shipper.SupplierCode; this.txtWarehouseName.Text = shipper.ShipWarehouseName; this.ddlReggion.SetSelectedRegionId(new int?(shipper.County)); this.txtAddress.Text = shipper.Address; this.txtPhone.Text = shipper.Phone; this.txtMobile.Text = shipper.Mobile; this.txtAddress.Text = shipper.Address; this.txtDescription.Text = shipper.Description; this.ckbApproveKey.Checked = shipper.ApproveKey; this.ckbApproveKey.Enabled = false; this.littlepic1.Src = shipper.Logo; this.fmSrc1.Value = shipper.Logo; this.littlepic2.Src = shipper.PCImage; this.fmSrc2.Value = shipper.PCImage; this.littlepic3.Src = shipper.MobileImage; this.fmSrc3.Value = shipper.MobileImage; this.txtSupplierOwnerName.Text = shipper.ShopOwner; } }
public override void DataBind() { this.Items.Clear(); this.Items.Add(new ListItem(this.NullToDisplay, string.Empty)); DataTable supplierdt = SupplierHelper.GetSupplier(); if (supplierdt != null && supplierdt.Rows.Count > 0) { for (int i = 0; i < supplierdt.Rows.Count; i++) { string itemValue = supplierdt.Rows[i]["SupplierId"].ToString(); string code = Globals.HtmlDecode(supplierdt.Rows[i]["SupplierCode"].ToString()); if (string.IsNullOrEmpty(code)) { code = "0"; } itemValue += "|" + code; ListItem item = new ListItem(Globals.HtmlDecode(supplierdt.Rows[i]["SupplierName"].ToString()), itemValue); //item.Attributes.Add("Code", Globals.HtmlDecode(supplierdt.Rows[i]["SupplierCode"].ToString())); this.Items.Add(item); } } }
public IHttpActionResult CollectSupplier(JObject request) { Logger.WriterLogger("Supplier.CollectSupplier, Params: " + request.ToString(), LoggerType.Info); ParamCollectSupplier param = new ParamCollectSupplier(); try { param = request.ToObject <ParamCollectSupplier>(); } catch { // 参数无效 return(base.JsonFaultResult(new CommonException(40100).GetMessage(), request.ToString())); } string accessToken = param.accessToken; // 验证令牌 int accessTookenCode = VerifyAccessToken(accessToken); if (accessTookenCode > 0) { return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), request.ToString())); } string userId = param.UserId; int channel = param.channel; int platform = param.platform; string ver = param.ver; // 保存访问信息 base.SaveVisitInfo(userId, channel, platform, ver); Member member = GetMember(userId.ToSeesionId()); if (member != null) { if (SupplierHelper.GetSupplier(param.SupplierId) == null) { StandardResult <string> result = new StandardResult <string>() { code = 1, msg = "供应商不存在", data = "" }; return(base.JsonActionResult(result)); } if (SupplierHelper.SupplierIsCollect(member.UserId, param.SupplierId)) { StandardResult <string> result = new StandardResult <string>() { code = 1, msg = "不可重复收藏", data = "" }; return(base.JsonActionResult(result)); } SupplierCollectInfo info = new SupplierCollectInfo(); info.Remark = ""; info.SupplierId = param.SupplierId; info.UserId = member.UserId; int id = SupplierHelper.CollectSupplier(info); if (id > 0) { StandardResult <string> result = new StandardResult <string>() { code = 0, msg = "店铺收藏成功", data = "" }; return(base.JsonActionResult(result)); } else { StandardResult <string> result = new StandardResult <string>() { code = 1, msg = "店铺收藏失败", data = "" }; return(base.JsonActionResult(result)); } } else { return(base.JsonFaultResult(new CommonException(40201).GetMessage(), request.ToString())); } }
/// <summary> /// 收藏店铺 /// </summary> /// <param name="context"></param> public void CollectSupplier(System.Web.HttpContext context) { StringBuilder stringBuilder = new StringBuilder(); context.Response.ContentType = "application/json"; int supplierId; if (!int.TryParse(context.Request["supplierId"], out supplierId)) { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":0,"); stringBuilder.Append("\"msg\":\"supplierid错误\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } Member member = HiContext.Current.User as Member; if (member != null) { if (SupplierHelper.GetSupplier(supplierId) == null) { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":-1,"); stringBuilder.Append("\"msg\":\"店铺不存在\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } if (SupplierHelper.SupplierIsCollect(member.UserId, supplierId)) { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":-2,"); stringBuilder.Append("\"msg\":\"店铺已收藏\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } SupplierCollectInfo info = new SupplierCollectInfo(); info.Remark = ""; info.SupplierId = supplierId; info.UserId = member.UserId; int id = SupplierHelper.CollectSupplier(info); if (id > 0) { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":1,"); stringBuilder.Append("\"msg\":\"店铺收藏成功\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } else { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":-3,"); stringBuilder.Append("\"msg\":\"店铺收藏失败\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } } else { stringBuilder.Append("{"); stringBuilder.Append("\"Success\":-4,"); stringBuilder.Append("\"msg\":\"您还未登陆\""); stringBuilder.Append("}"); this.message = stringBuilder.ToString(); return; } }