protected void btnOK_Click(object sender, EventArgs e) { if (!CheckInput()) { return; } var service = new cPos.Admin.Service.Implements.CustomerService(); var obj = new BrandCustomerInfo(); obj.brand_customer_code = this.tbCode.Text.Trim(); obj.brand_customer_name = this.tbName.Text.Trim(); obj.brand_customer_eng = this.tbEng.Text.Trim(); obj.brand_customer_address = this.tbAddress.Text.Trim(); obj.brand_customer_post = this.tbPost.Text.Trim(); obj.brand_customer_contacter = this.tbContacter.Text.Trim(); obj.brand_customer_tel = this.tbTel.Text.Trim(); obj.brand_customer_email = this.tbEmail.Text.Trim(); obj.status = this.ddlStatus.SelectedValue; obj.create_user_id = loggingSessionInfo.CurrentUser.User_Id; obj.create_time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); if (PageHelper.IsCreateOperate(this))//新建 { obj.brand_customer_id = Guid.NewGuid().ToString().Replace("-", string.Empty); Hashtable ht = service.SaveBrandCustomerInfo(obj); if (Convert.ToBoolean(ht["status"])) { this.Redirect("新建成功", InfoType.Info, this.Request.QueryString["from"] ?? "brand_customer_query.aspx"); } else { this.InfoBox.ShowPopError("新建失败!"); } } else { obj.brand_customer_id = this.Request.QueryString["bc_id"]; obj.modify_user_id = loggingSessionInfo.CurrentUser.User_Id; obj.modify_time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); Hashtable ht = service.SaveBrandCustomerInfo(obj); if (Convert.ToBoolean(ht["status"])) { this.Redirect("修改成功", InfoType.Info, this.Request.QueryString["from"] ?? "brand_customer_query.aspx"); } else { this.InfoBox.ShowPopError("修改失败!"); } } }
private void displayBrandCustomer(BrandCustomerInfo obj) { if (obj == null) { return; } this.tbCode.Text = obj.brand_customer_code; ViewState["code"] = obj.brand_customer_code; this.tbName.Text = obj.brand_customer_name; this.tbEng.Text = obj.brand_customer_eng; this.tbAddress.Text = obj.brand_customer_address; this.tbPost.Text = obj.brand_customer_post; this.tbContacter.Text = obj.brand_customer_contacter; this.tbTel.Text = obj.brand_customer_tel; this.tbEmail.Text = obj.brand_customer_email; this.ddlStatus.SelectedValue = obj.status; this.tbCreateTime.Text = obj.create_time; this.tbCreateUser.Text = obj.create_user_name; this.tbModifyTime.Text = obj.modify_time; this.tbModifyUser.Text = obj.modify_user_name; }