Exemplo n.º 1
0
        public ActionResult Upload(HolidayCalenderModel Model)
        {
            if (ModelState.IsValid)
            {
                foreach (HolidayCalenderItem data in Model.Details)
                {
                    try
                    {
                        data.CreatedDate = DateTime.Now;
                        data.CreatedBy   = CurrentUser.USERNAME;

                        if (data.ErrorMessage == "" | data.ErrorMessage == null)
                        {
                            var dto = Mapper.Map <HolidayCalenderDto>(data);
                            _HolidayCalenderBLL.Save(dto);
                        }

                        AddMessageInfo(Constans.SubmitMessage.Saved, Enums.MessageInfoType.Success);
                    }
                    catch (Exception exception)
                    {
                        AddMessageInfo(exception.Message, Enums.MessageInfoType.Error);
                        return(View(Model));
                    }
                }
            }
            return(RedirectToAction("Index", "MstHolidayCalender"));
        }
Exemplo n.º 2
0
        public ActionResult Upload()
        {
            var model = new HolidayCalenderModel();

            model.MainMenu     = _mainMenu;
            model.CurrentLogin = CurrentUser;
            return(View(model));
        }
Exemplo n.º 3
0
        //
        // GET: /MstHolidayCalender/

        public ActionResult Index()
        {
            var data  = _HolidayCalenderBLL.GetHolidayCalender();
            var model = new HolidayCalenderModel();

            model.Details           = Mapper.Map <List <HolidayCalenderItem> >(data);
            model.MainMenu          = _mainMenu;
            model.CurrentLogin      = CurrentUser;
            model.CurrentPageAccess = CurrentPageAccess;
            return(View(model));
        }