public OperationResult Update(UpdatePROD_PHOTOModel model) { var entity = PROD_PHOTOList.First(t => t.ID == model.ID); entity.ID = model.ID; entity.PhotoTitle = model.PhotoTitle; entity.FilePath = model.FilePath; entity.IsDefault = model.IsDefault; entity.PhotoType = model.PhotoType; entity.EntityID = model.EntityID; entity.SmallPic = model.SmallPic; entity.BigPic = model.BigPic; entity.MiddlePic = model.MiddlePic; entity.CreateDate = model.CreateDate; entity.ModiDate = model.ModiDate; entity.Creator = model.Creator; entity.Modifier = model.Modifier; entity.DisplayOrder = model.DisplayOrder; entity.Status = model.Status; entity.Item01 = model.Item01; entity.Item02 = model.Item02; entity.Item03 = model.Item03; entity.Item04 = model.Item04; entity.Item05 = model.Item05; PROD_PHOTORepository.Update(entity); return(new OperationResult(OperationResultType.Success, "update completed")); }
public ActionResult Edit(string ID) { var model = new UpdatePROD_PHOTOModel(); var entity = PROD_PHOTOService.PROD_PHOTOList.FirstOrDefault(t => t.ID == ID); if (null != entity) { model = new UpdatePROD_PHOTOModel { ID = entity.ID, PhotoTitle = entity.PhotoTitle, FilePath = entity.FilePath, IsDefault = entity.IsDefault, PhotoType = entity.PhotoType, EntityID = entity.EntityID, SmallPic = entity.SmallPic, BigPic = entity.BigPic, MiddlePic = entity.MiddlePic, CreateDate = entity.CreateDate, ModiDate = entity.ModiDate, Creator = entity.Creator, Modifier = entity.Modifier, DisplayOrder = entity.DisplayOrder, Status = entity.Status, Item01 = entity.Item01, Item02 = entity.Item02, Item03 = entity.Item03, Item04 = entity.Item04, Item05 = entity.Item05 }; } return(PartialView(model)); }
public ActionResult Edit(UpdatePROD_PHOTOModel model) { if (ModelState.IsValid) { this.UpdateBaseData <UpdatePROD_PHOTOModel>(model); OperationResult result = PROD_PHOTOService.Update(model); if (result.ResultType == OperationResultType.Success) { return(Json(result)); } else { return(PartialView(model)); } } else { return(PartialView(model)); } }