protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "cmdEdit") { Response.Redirect("OperatorEdit.aspx?operatorId=" + e.CommandArgument.ToString()); } else if (e.CommandName == "cmdDelete") { try { int i = OperatorsManager.DeleteOperatorByid(e.CommandArgument.ToString()); if (i == 2) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('您不能删除自己!'); </script>"); return; } Response.Redirect("OperatorsManagment.aspx"); } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('请删除客服的聊天记录'); window.location='ChatAnnal.aspx';</script>"); return; } } }
protected void btnSave_Click(object sender, EventArgs e) { Operator op = new Operator(); op.OperatorId = operatorId; op.Account = oper.Account; op.LoginName = this.txtLoginName.Text; op.Department = DepartmentManager.GetDepartmentById(this.ddlDepartment.SelectedValue); op.Password = this.txtPwd.Text; op.NickName = this.txtNickName.Text; op.Email = this.txtEmail.Text; op.AVChatStatus = "Offline"; op.IsAdmin = false; bool b = OperatorsManager.UpdateOperator(op); if (b) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('修改成功');window.location='OperatorsManagment.aspx';</script>"); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('修改失败'); </script>"); return; } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string accountNumber = this.txtNumber.Text; string loginName = this.UserName.Text; string loginPwd = this.Password.Text; Operator oper = OperatorsManager.Login(accountNumber, loginName, loginPwd); if (oper != null) { Session["User"] = oper; if (Request.QueryString["redirect"] != null) { Response.Redirect(Request.QueryString["redirect"].ToString()); } else { this.Response.Redirect("~/AccountAdmin/AccountHome.aspx"); } } else { this.FailureText.Text = "您的登录尝试不成功。请重试。"; } }
//搜索在线客服 protected void ibtnSearch_Click(object sender, ImageClickEventArgs e) { List <Operator> list = OperatorsManager.GetLiveSupportOnlineOperator(this.ddlOnline.SelectedValue, ddlAccount1.SelectedValue, this.txtOnline.Text); operatorList = list; OpageIndex = 0; DataBindOperator(list); }
public ContinuousConfiguration( IWhiteSource whiteCache, OperatorsManager operatorsManager, IRootFactory <SessionConfiguration> sessionConfigurationFactory) { _whiteCache = whiteCache; _sessionConfigurationFactory = sessionConfigurationFactory; operatorsManager.GetOperators(); }
public ContinuousConfiguration( IWhiteSource whiteCache, OperatorsManager operatorsManager, IRootFactory<SessionConfiguration> sessionConfigurationFactory) { _whiteCache = whiteCache; _sessionConfigurationFactory = sessionConfigurationFactory; operatorsManager.GetOperators(); }
public override void DataBind() { OperatorsManager oMgr = new OperatorsManager(); if (MemberId != null) { this.DataItem = oMgr.GetOperatorsV(string.Format("MemberId={0}", memberId)).Table.Rows[0]; } base.DataBind(); }
public string GetOperatorNameById(string id) { if (OperatorsManager.GetOperatorByOperatorId(id) != null) { return(OperatorsManager.GetOperatorByOperatorId(id).NickName); } else { return(""); } }
//增加 protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { try { if (this.ddlDepartment.Items.Count <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('请先添加部门');window.location='AddDepartment.aspx';</script>"); return; } if (this.txtLoginName.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('请输入坐席用户名');</script>"); return; } if (this.txtPwd.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('请输入密码');</script>"); return; } if (this.txtPwd.Text != this.txtPwds.Text) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('重置密码与密码不相同,请从新输入...');</script>"); return; } Operator op = new Operator(); op.Account = oper.Account; op.LoginName = this.txtLoginName.Text; op.Password = this.txtPwd.Text; op.NickName = this.txtNickName.Text; op.IsAdmin = false; op.Department = DepartmentManager.GetDepartmentById(this.ddlDepartment.SelectedValue); op.Status = (OperatorStatus)Enum.Parse((typeof(OperatorStatus)), OperatorStatus.Offline.ToString()); op.AVChatStatus = OperatorStatus.Offline.ToString(); op.Email = this.txtEmail.Text; bool b = OperatorsManager.NewOperator(op); if (b) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('添加成功!');window.location='OperatorsManagment.aspx';</script>"); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('已经存在此客服ID');</script>"); return; } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('添加失败');</script>"); return; } }
public void DataBindOperator(string accountId) { List <Operator> list = OperatorsManager.GetOperatorByAccountId(accountId); if (list != null) { this.ddlOperator.DataSource = list; this.ddlOperator.DataTextField = "LoginName"; this.ddlOperator.DataValueField = "OperatorId"; this.ddlOperator.DataBind(); } }
protected void btnGet_Click(object sender, ImageClickEventArgs e) { try { if (Session["createRandom"] != null) { if (this.txtRandom.Text == Session["createRandom"].ToString()) { Operator oper = OperatorsManager.GetPasswordByAccountNumberLoginNameAndEmail(this.txtAccountNumber.Text.Trim(), this.txtOperatorLoginName.Text.Trim(), this.txtEmail.Text.Trim()); if (oper != null) { string toEmail = this.txtEmail.Text; string email = ConfigurationManager.AppSettings["Email"]; string emailPwd = ConfigurationManager.AppSettings["Password"]; string emailSmtp = ConfigurationManager.AppSettings["SMTPServer"]; string title = "互动科技LiveSpport在线客服系统提示您:"; string content = "尊敬的客服 " + oper.NickName + " 您好!\n 您公司ID为:" + oper.Account.AccountNumber + ",您的账号为:" + oper.LoginName + ",您的密码为:" + oper.Password + ",请您牢记,感谢您一直以来对我们公司产品的支持与厚爱!\n \n \n \n \n \n \n \n 如需帮助请浏览我们公司的官方网站 http://www.hudongsoft.cn"; bool b = LiveSupport.BLL.Utils.Util.SendEmailAsync(toEmail, email, emailPwd, emailSmtp, title, content); if (b) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('您的密码已经发送至您的Email中,请您查阅...');window.location='index.aspx';</script>"); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('发送失败,从稍候从试...');</script>"); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('您的账号或Email错误!');</script>"); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('验证码输入错误!');</script>"); } } } catch (Exception ex) { } }
private void button11_Click(object sender, EventArgs e) { for (int i = 0; i < 500; i++) { Account at = AccountService.FindAccountByAccountNumber(i.ToString()); Operator op = new Operator(); op.Account = at; op.LoginName = "admin" + (i + 1000); op.Password = "******" + (i + 1000); op.NickName = "admin" + (i + 1000) + "客服"; op.IsAdmin = false; op.Department = DepartmentManager.GetDepartmentByAccountId(at.AccountId)[0]; op.Status = (OperatorStatus)Enum.Parse((typeof(OperatorStatus)), OperatorStatus.Offline.ToString()); op.AVChatStatus = OperatorStatus.Offline.ToString(); op.Email = "*****@*****.**"; bool b = OperatorsManager.NewOperator(op); } }
//密码修改 protected void btnSave_Click(object sender, EventArgs e) { if (this.txtNickname.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('昵称不能为空');</script>"); return; } if (this.txtAgoPwd.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('原始密码不能为空');</script>"); return; } if (this.txtAgoPwd.Text != oper.Password) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('原始密码不正确');</script>"); return; } if (this.txtPwd.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('新密码不能为空');</script>"); return; } if (this.txtPwds.Text != this.txtPwd.Text) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('确认密码与新密码不一致');</script>"); return; } oper.NickName = this.txtNickname.Text; oper.Password = this.txtPwds.Text; bool b = OperatorsManager.UpdateOperator(oper); if (b) { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('修改成功!');window.location='../Login.aspx';</script>"); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('修改失败!');</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["adminUser"] != null) { chatList = ChatManager.LookupChat("", "", ""); operatorList = OperatorsManager.GetLiveSupportOnlineOperator("", "", ""); user = Session["adminUser"] as AdminUser; if (!IsPostBack) { DataBindOperator(operatorList); DataBindChat(chatList); } } else { this.Response.Write("<script>alert('登陆超时,请从新登陆...');window.location='Default.aspx';</script>"); return; } }
//绑定客服信息 public void DataBindOperator(string operatorId) { Operator op = OperatorsManager.GetOperatorByOperatorId(operatorId); this.txtCompanyName.Text = oper.Account.CompanyName; this.ddlDepartment.SelectedValue = op.Department.DepartmentId; this.txtLoginName.Text = op.LoginName; this.txtNickName.Text = op.NickName; this.txtPwd.Text = op.Password; this.txtEmail.Text = op.Email; if (op.IsAdmin) { this.btnSave.Enabled = false; } else { this.btnSave.Enabled = true; } }
public bool TryLogIn(string UserName, string Password) { OperatorsManager op = new OperatorsManager(); System.Data.DataView dv = op.GetOperatorsV(string.Format("UserName='******' or Email='{0}'", StringUtils.SQLEncode(UserName))); if (dv.Count > 0) { MembersManager mMgr = new MembersManager(); string _Password = dv[0]["Password"].ToString(); int stat = (int)UserStatus.Enabled | (int)UserStatus.Modified; if (_Password.Equals(mMgr.EncryptPassword(Password)) && ((int)dv[0]["Status"] & stat) != 0) { lw.Members.Security.User.LoginUser(mMgr.GetMember((int)dv[0]["MemberId"])); LoginOp(dv[0]["GroupName"].ToString(), dv[0]["GroupName"].ToString()); return(true); } } return(false); }
private void btnAddoperator_Click(object sender, EventArgs e) { for (int i = 0; i < 500; i++) { //Random ran = new Random(); //int num = ran.Next(100000, 999999); //添加 Account at = new Account(); at.AccountId = Guid.NewGuid().ToString(); at.AccountNumber = i.ToString(); at.CompanyName = i + "公司"; at.Url = "http://www.www" + i + ".com"; at.Phone = i.ToString();; at.ContactName = i + ""; at.Email = i.ToString() + "@sina.com"; at.Province = "江西省"; at.City = "南昌市"; at.Industry = "计算机"; at.OperatorCount = 1; at.RegisterDate = DateTime.Now; bool b = AccountsManager.AddAccount(at, "admin客服", "admin", "admin"); //Account at = AccountsManager.GetAccountByAccountId(at.AccountId); Operator op = new Operator(); op.Account = at; op.LoginName = "admin" + i; op.Password = "******" + i; op.NickName = "admin1号客服"; op.IsAdmin = false; op.Department = DepartmentManager.GetDepartmentByAccountId(at.AccountId)[0]; op.Status = (OperatorStatus)Enum.Parse((typeof(OperatorStatus)), OperatorStatus.Offline.ToString()); op.AVChatStatus = OperatorStatus.Offline.ToString(); op.Email = "admin" + i + "@sina.com"; bool a = OperatorsManager.NewOperator(op); } }
public OperatorsDataSource() { this.DataLibrary = cte.LibraryName; OrderBy = "MemberId Desc"; oMgr = new OperatorsManager(); }