Пример #1
0
 [Authorize(Roles = "Admin,Personnel")]  //Personnel
 public JsonResult Get_ReadCH(string Idproduct)
 {
     try
     {
         var data = connect_entity.Get_DientuCauhinh().Where(x => x.IdProduct == Idproduct).ToList();
         Resurt = 1; //trạng thái thành công
         return(Json(data, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json("", JsonRequestBehavior.AllowGet));
     }
 }
Пример #2
0
 public JsonResult AjaxDientuchitiethinh(string Idmau, string Iddungluong, string IdProduct)
 {
     try
     {
         var data = connect_entity.Get_DientuCauhinh().FirstOrDefault(x => x.Idmau == Idmau && x.Iddungluong == Iddungluong && x.IdProduct == IdProduct);
         if (data != null)
         {
             return(Json(data, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(1, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json("", JsonRequestBehavior.AllowGet));
     }
 }