Ejemplo n.º 1
0
        public ActionResult EditRosterSave(FormCollection form)
        {
            int noOfDays = Convert.ToInt16(Request.Form["noOfDays"].ToString());
            List <RosterAttributes> rosters = new List <RosterAttributes>();
            int _RotaAppID = Convert.ToInt32(Request.Form["RotaAppID"].ToString());

            DeleteRosterList(_RotaAppID);
            for (int i = 1; i < noOfDays; i++)
            {
                rosters.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()])
                });
            }
            SaveEditRosterEntries(rosters, _RotaAppID);

            ViewBag.ErrorList = "";
            CreateHelper();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
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"));
        }