private void SetSupplierCfg(int id) { SupplierConfigInfo info = SupplierConfigHelper.GetSupplierCfgById(this.id); this.ddlSupplier.SelectedValue = info.SupplierId.ToString(); this.txtDesc.Text = info.ShortDesc; this.littlepic.Src = info.ImageUrl; this.fmSrc.Value = info.ImageUrl; }
protected void btnAddSupplier_Click(object sender, System.EventArgs e) { if (this.id == 0) { SupplierConfigInfo info = new SupplierConfigInfo(); info.IsDisable = false; info.ImageUrl = this.fmSrc.Value; info.ShortDesc = this.txtDesc.Text; info.Client = (int)ClientType.App; info.Type = (int)SupplierCfgType.Hot; info.SupplierId = int.Parse(this.ddlSupplier.SelectedValue); if (string.IsNullOrWhiteSpace(info.ImageUrl)) { this.ShowMsg("请上传图片!", false); return; } if (SupplierConfigHelper.SaveSupplierCfg(info) > 0) { this.CloseWindow(); return; } this.ShowMsg("添加错误!", false); } else { SupplierConfigInfo info = SupplierConfigHelper.GetSupplierCfgById(this.id); info.IsDisable = false; info.ImageUrl = this.fmSrc.Value; info.ShortDesc = this.txtDesc.Text; info.SupplierId = int.Parse(this.ddlSupplier.SelectedValue); if (SupplierConfigHelper.UpdateSupplierCfg(info)) { this.CloseWindow(); return; } this.ShowMsg("修改失败!", false); } }