Exemplo n.º 1
0
        public JsonResult DeleteCustomer(string Cusguid)
        {
            string a         = "";
            string power     = Session["Power"].ToString();
            string empid     = Session["LoginId"].ToString();
            var    sa        = new SAViewModel();
            var    userpower = new List <string>();

            userpower = _powerCheckProvider.CheckPower(power);
            sa        = _powerCheckProvider.CheckSAuser(empid);
            if (sa.EmpId != null)
            {
                _customerProvider.DeleteCustomer(Cusguid.Trim());
                a = "删除成功";
            }
            else
            {
                if (userpower.Contains("403"))
                {
                    _customerProvider.DeleteCustomer(Cusguid.Trim());
                    a = "删除成功";
                }
                else
                {
                    a = "权限不足";
                }
            }

            return(Json(a, JsonRequestBehavior.AllowGet));
        }
        public bool DeleteCustomer(int customerID)
        {
            bool result = false;

            result = _customerProvider.DeleteCustomer(customerID);
            return(result);
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await _provider.DeleteCustomer(id);

            if (!result.Value)
            {
                return(NotFound());
            }
            if (result == null)
            {
                return(StatusCode(500, "A problem occurred while handling your request."));
            }
            return(NoContent());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Cancel(string id)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                await _customerProvider.DeleteCustomer(id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemplo n.º 5
0
 public async Task <ActionResult <HttpStatusCode> > DeleteCustomer(string customerID)
 {
     return(await customerProvider.DeleteCustomer(customerID));
 }