Esempio 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 }));
        }
Esempio 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, }));
            }
        }