Exemplo n.º 1
0
        public OperationResult Update(UpdatePROD_RELATED_PROPERTYModel model)
        {
            var entity = PROD_RELATED_PROPERTYList.First(t => t.ProductNo == model.ProductNo && t.PropertyID == model.PropertyID);

            entity.ProductNo  = model.ProductNo;
            entity.PropertyID = model.PropertyID;
            entity.CLevel     = model.CLevel;

            PROD_RELATED_PROPERTYRepository.Update(entity);
            return(new OperationResult(OperationResultType.Success, "update completed"));
        }
        public ActionResult Edit(string ProductNo, string PropertyID)
        {
            var model  = new UpdatePROD_RELATED_PROPERTYModel();
            var entity = PROD_RELATED_PROPERTYService.PROD_RELATED_PROPERTYList.FirstOrDefault(t => t.ProductNo == ProductNo && t.PropertyID == PropertyID);

            if (null != entity)
            {
                model = new UpdatePROD_RELATED_PROPERTYModel
                {
                    ProductNo = entity.ProductNo, PropertyID = entity.PropertyID, CLevel = entity.CLevel
                };
            }
            return(PartialView(model));
        }
 public ActionResult Edit(UpdatePROD_RELATED_PROPERTYModel model)
 {
     if (ModelState.IsValid)
     {
         this.UpdateBaseData <UpdatePROD_RELATED_PROPERTYModel>(model);
         OperationResult result = PROD_RELATED_PROPERTYService.Update(model);
         if (result.ResultType == OperationResultType.Success)
         {
             return(Json(result));
         }
         else
         {
             return(PartialView(model));
         }
     }
     else
     {
         return(PartialView(model));
     }
 }