Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        //改
        #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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 public static IQueryable CustomerCxx(string CtName)
 {
     return(CustomerServicer.CustomerCxx(CtName));
 }
Exemplo n.º 6
0
 public static int CustomerAdd(Customer C)
 {
     return(CustomerServicer.CustomerAdd(C));
 }
Exemplo n.º 7
0
 public static int Rows()
 {
     return(CustomerServicer.Rows());
 }
Exemplo n.º 8
0
 public static PageList CustomerAll(int pageindex, int pageSize)
 {
     return(CustomerServicer.CustomerAll(pageindex, pageSize));
 }