Exemplo n.º 1
0
        public JsonResult DeleteOrigin(int Id)
        {
            var  dao    = new OriginDAO();
            bool check  = dao.CheckUsed(Id);
            int  result = 2;

            if (check == false)
            {
                result = dao.DeleteOrigin(Id);
                return(Json(new { res = result }));
            }
            return(Json(new { res = result }));
        }
Exemplo n.º 2
0
        public JsonResult ChangeStatus(int Id)
        {
            var  dao   = new OriginDAO();
            bool check = dao.CheckUsed(Id);

            if (check == false)
            {
                bool?res = dao.ChangeStatus(Id);
                return(Json(new { res = res, used = check, }));
            }
            else
            {
                return(Json(new { used = check, }));
            }
        }