protected void Page_Load(object sender, EventArgs e)
 {
     this.btnSubmit.Click += this.btnSubmit_Click;
     if (!int.TryParse(base.Request.QueryString["ServiceId"], out this.ServiceId))
     {
         base.GotoResourceNotFound();
     }
     else if (!base.IsPostBack)
     {
         OnlineServiceInfo onlineServiceInfo = OnlineServiceHelper.GetOnlineServiceInfo(this.ServiceId);
         if (onlineServiceInfo == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             this.txtAccount.Text = onlineServiceInfo.Account;
             TextBox textBox = this.txtImageType;
             int     num     = onlineServiceInfo.ImageType;
             textBox.Text          = num.ToString();
             this.txtNickName.Text = onlineServiceInfo.NickName;
             this.dropServiceType.DataBind();
             this.dropServiceType.SelectedValue = onlineServiceInfo.ServiceType;
             TextBox textBox2 = this.txtOrderId;
             num           = onlineServiceInfo.OrderId;
             textBox2.Text = num.ToString();
             this.radioShowStatus.SelectedValue = (onlineServiceInfo.Status == 1 && true);
         }
     }
 }
Example #2
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (this.hidServiceType.Value.ToInt(0) < 1)
     {
         this.ShowMsg("请选择客服类型", false);
     }
     else
     {
         string text = Globals.StripAllTags(this.txtAccount.Text.Trim());
         if (string.IsNullOrEmpty(text) || text.Length > 50)
         {
             this.ShowMsg("请输入客服帐号,帐号长度必须在50个字符以内", false);
         }
         else
         {
             string text2 = Globals.StripAllTags(this.txtNickName.Text.Trim());
             if (string.IsNullOrEmpty(text2) || text2.Length > 50)
             {
                 this.ShowMsg("请输入显示昵称,昵称长度必须在50个字符以内", false);
             }
             else
             {
                 int imageType = 1;
                 int.TryParse(this.txtImageType.Text, out imageType);
                 int orderId = 0;
                 int.TryParse(this.txtOrderId.Text, out orderId);
                 OnlineServiceInfo onlineServiceInfo = new OnlineServiceInfo();
                 onlineServiceInfo.Account     = text;
                 onlineServiceInfo.ImageType   = imageType;
                 onlineServiceInfo.NickName    = text2;
                 onlineServiceInfo.OrderId     = orderId;
                 onlineServiceInfo.ServiceType = this.hidServiceType.Value.ToInt(0);
                 onlineServiceInfo.Status      = (this.hidShowStatus.Value.ToBool() ? 1 : 0);
                 if (this.hidID.Value.ToInt(0) > 0)
                 {
                     onlineServiceInfo.Id = this.hidID.Value.ToInt(0);
                     if (OnlineServiceHelper.Update(onlineServiceInfo))
                     {
                         this.ShowMsg("成功编辑了一个在线客服", true);
                         this.BindOnlineService();
                     }
                     else
                     {
                         this.ShowMsg("未知错误", false);
                     }
                 }
                 else if (OnlineServiceHelper.SaveOnlineService(onlineServiceInfo))
                 {
                     this.ShowMsg("成功添加了一个在线客服", true);
                     this.BindOnlineService();
                 }
                 else
                 {
                     this.ShowMsg("未知错误", false);
                 }
                 this.Reset();
             }
         }
     }
 }
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            OnlineServiceInfo onlineServiceInfo = OnlineServiceHelper.GetOnlineServiceInfo(this.ServiceId);

            if (onlineServiceInfo == null)
            {
                base.GotoResourceNotFound();
            }
            else if (!this.dropServiceType.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择客服类型", false);
            }
            else
            {
                string text = Globals.StripAllTags(this.txtAccount.Text.Trim());
                if (string.IsNullOrEmpty(text) || text.Length > 50)
                {
                    this.ShowMsg("请输入客服帐号,帐号长度必须在50个字符以内", false);
                }
                else
                {
                    string text2 = Globals.StripAllTags(this.txtNickName.Text.Trim());
                    if (string.IsNullOrEmpty(text2) || text2.Length > 50)
                    {
                        this.ShowMsg("请输入显示昵称,昵称长度必须在50个字符以内", false);
                    }
                    else
                    {
                        int imageType = 1;
                        int.TryParse(this.txtImageType.Text, out imageType);
                        int orderId = 0;
                        int.TryParse(this.txtOrderId.Text, out orderId);
                        onlineServiceInfo.Id          = this.ServiceId;
                        onlineServiceInfo.Account     = text;
                        onlineServiceInfo.ImageType   = imageType;
                        onlineServiceInfo.NickName    = text2;
                        onlineServiceInfo.OrderId     = orderId;
                        onlineServiceInfo.ServiceType = this.dropServiceType.SelectedValue.Value;
                        onlineServiceInfo.Status      = (this.radioShowStatus.SelectedValue ? 1 : 0);
                        if (OnlineServiceHelper.Update(onlineServiceInfo))
                        {
                            this.ShowMsg("成功编辑了一个在线客服", true);
                        }
                        else
                        {
                            this.ShowMsg("未知错误", false);
                        }
                    }
                }
            }
        }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["serviceId"], out this.serviceId))
     {
         base.GotoResourceNotFound();
     }
     else if (!base.IsPostBack)
     {
         OnlineServiceInfo onlineServiceInfo = OnlineServiceHelper.GetOnlineServiceInfo(this.serviceId);
         this.dropServiceType.SelectedValue = onlineServiceInfo.ServiceType;
         this.txtAccount.Text            = onlineServiceInfo.Account;
         this.txtNickName.Text           = onlineServiceInfo.NickName;
         this.txtOrderId.Text            = onlineServiceInfo.OrderId.ToString();
         this.ooShowStatus.SelectedValue = (onlineServiceInfo.Status == 1 && true);
     }
 }
Example #5
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (this.hidServiceType.Value.ToInt(0) < 1)
     {
         this.ShowMsg("请选择客服类型", false);
     }
     else
     {
         string text = Globals.StripAllTags(this.txtAccount.Text.Trim());
         if (string.IsNullOrEmpty(text) || text.Length > 50)
         {
             this.ShowMsg("请输入客服帐号,帐号长度必须在50个字符以内", false);
         }
         else
         {
             string text2 = Globals.StripAllTags(this.txtNickName.Text.Trim());
             if (string.IsNullOrEmpty(text2) || text2.Length > 50)
             {
                 this.ShowMsg("请输入显示昵称,昵称长度必须在50个字符以内", false);
             }
             else
             {
                 int imageType = 1;
                 int orderId   = 0;
                 int.TryParse(this.txtOrderId.Text, out orderId);
                 OnlineServiceInfo onlineServiceInfo = new OnlineServiceInfo();
                 onlineServiceInfo.Account     = text;
                 onlineServiceInfo.ImageType   = imageType;
                 onlineServiceInfo.NickName    = text2;
                 onlineServiceInfo.OrderId     = orderId;
                 onlineServiceInfo.ServiceType = this.hidServiceType.Value.ToInt(0);
                 onlineServiceInfo.Status      = (this.ooShowStatus.SelectedValue ? 1 : 0);
                 if (OnlineServiceHelper.SaveOnlineService(onlineServiceInfo))
                 {
                     base.CloseWindow(null);
                 }
                 else
                 {
                     this.ShowMsg("未知错误", false);
                 }
             }
         }
     }
 }
 public static bool Update(OnlineServiceInfo ServiceInfo)
 {
     return(new OnlineServiceDao().Update(ServiceInfo, null));
 }
 public static bool SaveOnlineService(OnlineServiceInfo info)
 {
     return(new OnlineServiceDao().Add(info, null) > 0);
 }