示例#1
0
        public ActionResult Actions()
        {
            var msg = new JsonMessage();
            var url = Request.Form.ToString();

            switch (DoAction)
            {
            case ActionType.Add:
                msg = _categoryApi.Add(url, CodeLogin());
                break;

            case ActionType.Edit:
                msg = _categoryApi.Update(url, CodeLogin());
                break;

            case ActionType.Show:
                msg = _categoryApi.ShowHide(url, true);
                break;

            case ActionType.Hide:
                msg = _categoryApi.ShowHide(url, false);
                break;

            case ActionType.Delete:
                msg = _categoryApi.Delete(url);
                break;

            default:
                msg.Message = "Bạn chưa được phân quyền cho chức năng này.";
                msg.Erros   = true;
                break;
            }
            return(Json(msg, JsonRequestBehavior.AllowGet));
        }