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)); } }
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)); } }
public CustomLengthAttribute(LengthPos Pos, LengthSize Size) { this.Pos = Pos; this.Size = Size; }