Exemplo n.º 1
0
        public int AddOis(OperationalIntervalVm ois)
        {
            var oisRepo = new OperationalIntervalRepository();
            var oisId   = oisRepo.AddOis(ois);

            return(oisId);
        }
Exemplo n.º 2
0
        public ActionResult UpdateOis(OperationalIntervalVm oisVm)
        {
            var oisService = new OperationalIntervalService();

            oisService.UpdateOperationalInterval(oisVm);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        public ActionResult AddOis(OperationalIntervalVm ois)
        {
            var oisService = new OperationalIntervalService();

            oisService.AddOis(ois);

            return(RedirectToAction("Index"));
        }
        public void UpdateOperationalInterval(OperationalIntervalVm ois)
        {
            using (Oblig1Context db = new Oblig1Context())
            {
                var oisDb = db.OperationalIntervals.Where(a => a.Id == ois.Id).FirstOrDefault();

                oisDb.Name      = ois.Name;
                oisDb.StartDate = ois.StartDate;
                oisDb.EndDate   = ois.EndDate;
                oisDb.Monday    = ois.Monday;
                oisDb.Tuesday   = ois.Tuesday;
                oisDb.Wednesday = ois.Wednesday;
                oisDb.Thursday  = ois.Thursday;
                oisDb.Friday    = ois.Friday;
                oisDb.Saturday  = ois.Saturday;
                oisDb.Sunday    = ois.Sunday;

                db.SaveChanges();
            }
        }
        public int AddOis(OperationalIntervalVm oisVm)
        {
            var ois = new OperationalInterval
            {
                Name      = oisVm.Name,
                StartDate = oisVm.StartDate,
                EndDate   = oisVm.EndDate,
                Monday    = oisVm.Monday,
                Tuesday   = oisVm.Tuesday,
                Wednesday = oisVm.Wednesday,
                Thursday  = oisVm.Thursday,
                Friday    = oisVm.Friday,
                Saturday  = oisVm.Saturday,
                Sunday    = oisVm.Sunday
            };

            using (Oblig1Context db = new Oblig1Context())
            {
                db.OperationalIntervals.Add(ois);
                db.SaveChanges();
            }

            return(ois.Id);
        }
Exemplo n.º 6
0
        public void UpdateOperationalInterval(OperationalIntervalVm ois)
        {
            var oisRepo = new OperationalIntervalRepository();

            oisRepo.UpdateOperationalInterval(ois);
        }