Beispiel #1
0
        public ActionResult Edit(int id, EditVanBanViewModel model)
        {
            var data = VanBanRepository.Single(id);

            data.LinhVucVanBanId = model.LinhVucVanBanId;
            data.CoQuanBanHanhId = model.CoQuanBanhHanhVanBanId;
            data.LoaiVanBanId    = model.LoaiVanBanId;
            data.NgayBanHanh     = model.NgayBanHanh;
            data.NoiDung         = model.NoiDungVanBan;
            data.SoVanBan        = model.SoVanBan;
            data.TrichYeu        = model.TrichYeuVanBan;
            data.LastUpdatedBy   = UserName;

            var result = VanBanRepository.Update(data);

            if (result == Services.SaveResult.SUCCESS)
            {
                SaveFiles(id, model.Files);
            }

            return(RedirectToRoute(UrlLink.VANBAN));
        }
Beispiel #2
0
 public ActionResult Edit(int id)
 {
     return(ExecuteWithErrorHandling(() =>
     {
         var data = VanBanRepository.Single(id);
         var init = InitViewModel();
         var model = new EditVanBanViewModel
         {
             CoQuanBanHanhVanBanInfos = init.CoQuanBanHanhVanBanInfos,
             LoaiVanBanInfos = init.LoaiVanBanInfos,
             LinhVucVanBanInfos = init.LinhVucVanBanInfos,
             LinhVucVanBanId = data.LinhVucVanBanId,
             CoQuanBanhHanhVanBanId = data.CoQuanBanHanhId,
             LoaiVanBanId = data.LoaiVanBanId,
             NgayBanHanh = data.NgayBanHanh,
             NoiDungVanBan = data.NoiDung,
             SoVanBan = data.SoVanBan,
             TrichYeuVanBan = data.TrichYeu,
             TapTinVanBanResults = data.Files,
         };
         return View(model);
     }));
 }