public ActionResult Forbid(int id) { Response _resp = new Response(); if (id < 1) { _resp.Status = 0; _resp.Message = "错误!参数不正确."; return(Json(_resp)); } CustomerServicer _cust = _cusomerServiceManger.Find(id); if (_cust == null) { _resp.Status = 0; _resp.Message = "错误!终端客户不存在."; return(Json(_resp)); } _cust.active = !_cust.active; _resp = _cusomerServiceManger.Update(_cust); if (_resp.Status == 1) { _resp.Message = "恭喜!客服帐号已禁用"; } return(Json(_resp)); }
public ActionResult Edit(int id, FormCollection fcs) { Response _resp = new Response(); CustomerServicer _cust = _cusomerServiceManger.Find(id); if (_cust == null) { _resp.Status = 0; _resp.Message = "错误!终端用户不存在"; return(Json(_resp)); } TryUpdateModel(_cust, new string[] { "Area" }); if (!ModelState.IsValid) { _resp.Status = 0; _resp.Message = General.GetModelErrorString(ModelState); return(Json(_resp)); } _resp = _cusomerServiceManger.Update(_cust); if (_resp.Status == 1) { _resp.Message = "恭喜!修改客服帐号数据成功"; } return(Json(_resp)); }
//改 #region //改 public ActionResult Edit(int id = 0) { CustomerServicer _cust = _cusomerServiceManger.Find(id); if (_cust == null) { //id的终端不存在 Prompt _prm = new Prompt(); _prm.Title = "修改出错!"; _prm.Message = "出错啦!不存在对应该ID的客服帐号"; return(View("ErrorPop", _prm)); } return(View(_cust)); }
public ActionResult add(CustomerServicer cust) { Response _resp = new Response(); if (ModelState.IsValid) { if (_cusomerServiceManger.HasAccounts(cust.username)) { _resp.Status = 0; _resp.Message = "帐号已存在"; } else { CustomerServicer _cust = new CustomerServicer(); _cust.username = cust.username; _cust.password = Security.SHA256(cust.password); _cust.active = true; _cust.CreateTime = DateTime.Now; _cust.LoginIP = ""; _cust.LoginTime = DateTime.Now; _cust.Area = cust.Area; _resp.Message = "恭喜您!账号注册成功!"; _resp.Url = Url.Action("login"); _resp = _cusomerServiceManger.Add(_cust); } } else { _resp.Status = 0; _resp.Message = General.GetModelErrorString(ModelState); } return(Json(_resp)); }
public static IQueryable CustomerCxx(string CtName) { return(CustomerServicer.CustomerCxx(CtName)); }
public static int CustomerAdd(Customer C) { return(CustomerServicer.CustomerAdd(C)); }
public static int Rows() { return(CustomerServicer.Rows()); }
public static PageList CustomerAll(int pageindex, int pageSize) { return(CustomerServicer.CustomerAll(pageindex, pageSize)); }