Пример #1
0
 public JsonResult CreateLengthSize(LengthSize obj)
 {
     try
     {
         //add
         DataProvider.Entities.LengthSizes.Add(obj);
         DataProvider.Entities.SaveChanges();
         return(Json(new JsonResponse()
         {
             Success = true,
             Message = ConstantData.ResponseMessage.SuccessCreate
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new JsonResponse()
         {
             Success = false,
             Message = ConstantData.ResponseMessage.Error
         }, JsonRequestBehavior.AllowGet));
     }
 }
Пример #2
0
 public JsonResult UpdateLoaiLengthSize(LengthSize obj)
 {
     try
     {
         //update
         var data = DataProvider.Entities.LengthSizes.Find(obj.Id);
         data.OrderNumber = obj.OrderNumber;
         data.LengthSize1 = obj.LengthSize1;
         DataProvider.Entities.SaveChanges();
         return(Json(new JsonResponse()
         {
             Success = true,
             Message = ConstantData.ResponseMessage.SuccessUpdate
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new JsonResponse()
         {
             Success = false,
             Message = ConstantData.ResponseMessage.Error
         }, JsonRequestBehavior.AllowGet));
     }
 }
Пример #3
0
 public CustomLengthAttribute(LengthPos Pos, LengthSize Size)
 {
     this.Pos  = Pos;
     this.Size = Size;
 }