Beispiel #1
0
        public ActionResult Add()
        {
            var model = new AddVanBanViewModel();
            var init  = InitViewModel();

            model.CoQuanBanHanhVanBanInfos = init.CoQuanBanHanhVanBanInfos;
            model.LoaiVanBanInfos          = init.LoaiVanBanInfos;
            model.LinhVucVanBanInfos       = init.LinhVucVanBanInfos;

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Add(AddVanBanViewModel model)
        {
            var dataSave = new VanBanResult
            {
                TenVanBan       = model.SoVanBan,
                NoiDung         = model.NoiDungVanBan,
                TrichYeu        = model.TrichYeuVanBan,
                LinhVucVanBanId = model.LinhVucVanBanId,
                LoaiVanBanId    = model.LoaiVanBanId,
                CoQuanBanHanhId = model.CoQuanBanhHanhVanBanId,
                NgayBanHanh     = model.NgayBanHanh,
                SoVanBan        = model.SoVanBan,
                CreatedBy       = UserName,
            };

            var result = VanBanRepository.Add(dataSave);

            if (result == Services.SaveResult.SUCCESS && dataSave.Id > 0)
            {
                SaveFiles(dataSave.Id, model.Files);
            }

            return(RedirectToRoute(UrlLink.VANBAN_EDIT, new { sovanban = dataSave.SoVanBan.RejectMarks(), id = dataSave.Id }));
        }