Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request["isAjax"]) && (base.Request["isAjax"] == "true"))
     {
         string str5;
         string str  = base.Request["Mode"].ToString();
         string str2 = "";
         string str3 = "false";
         if (((str5 = str) != null) && (str5 == "Add"))
         {
             str2 = "保险公司名称不允许为空";
             if (!string.IsNullOrEmpty(base.Request["TagValue"].Trim()))
             {
                 str2 = "添加保险公司名称失败,请确认保险公司名是否已存在";
                 int num = CatalogHelper.AddInsuranceCompany(Globals.HtmlEncode(base.Request["TagValue"].ToString()));
                 if (num > 0)
                 {
                     str3 = "true";
                     str2 = num.ToString();
                 }
             }
             base.Response.Clear();
             base.Response.ContentType = "application/json";
             base.Response.Write("{\"Status\":\"" + str3 + "\",\"msg\":\"" + str2 + "\"}");
             base.Response.End();
         }
     }
     this.btnaddtag.Click          += new EventHandler(this.btnaddtag_Click);
     this.btnupdatetag.Click       += new EventHandler(this.btnupdatetag_Click);
     this.rp_prducttag.ItemCommand += new RepeaterCommandEventHandler(this.rp_prducttag_ItemCommand);
     if (!base.IsPostBack)
     {
         this.ProductTagsBind();
     }
 }
Exemplo n.º 2
0
        protected void btnaddtag_Click(object sender, EventArgs e)
        {
            string str = Globals.HtmlEncode(this.txtaddtagname.Text.Trim());

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("保险公司名称不允许为空!", false);
            }
            else if (CatalogHelper.AddInsuranceCompany(str) > 0)
            {
                this.ShowMsg("添加保险公司成功!", true);
                this.ProductTagsBind();
            }
            else
            {
                this.ShowMsg("添加保险公司失败,请确认是否存在重名保险公司名称", false);
            }
        }