Ejemplo n.º 1
0
        public JsonResult ChangedStatus(int Id)
        {
            var  dao   = new ManufacturerDAO();
            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, }));
            }
        }
Ejemplo n.º 2
0
        public JsonResult DeleteManufacturer(int Id)
        {
            var  dao    = new ManufacturerDAO();
            bool check  = dao.CheckUsed(Id);
            int  result = 2;

            if (check == false)
            {
                int res = dao.DeleteManufacturer(Id);
                return(Json(new { res = result }));
            }
            else
            {
                return(Json(new { res = result }));
            }
        }