Ejemplo n.º 1
0
        public ActionResult Create2(VMRosterModel vm)
        {
            List <RosterAttributes> rosterAttributeList = new List <RosterAttributes>();
            VAT_Shift _selectedShift = DDService.GetShift().Where(aa => aa.PShiftID == vm.ShiftID).First();
            int       _RotaAppID     = Convert.ToInt32(Request.Form["RotaAppID"].ToString());


            for (int i = 1; i <= vm.NoOfDays; i++)
            {
                rosterAttributeList.Add(new RosterAttributes()
                {
                    DutyTime = ATAssistant.ConvertTime(Request.Form["DT-" + i.ToString()].ToString()),
                    DutyDate = Convert.ToDateTime(Request.Form["Date-" + i.ToString()]),
                    WorkMin  = Convert.ToInt32(Request.Form["WM-" + i.ToString()])
                });
            }
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            RosterService.PostCreate2(vm, rosterAttributeList);
            ViewBag.ErrorList = "";
            CreateHelper();
            return(RedirectToAction("Index"));
        }