Exemplo n.º 1
0
        public async Task <IActionResult> Add(string returnUrl = null)
        {
            var employees = await _employeeService.GetListOfAllEmployeesAsync();

            var model = new WorkScheduleView()
            {
                CompanyEmployees = employees,
                StartTime        = DateTimeOffset.Now,
                FinishTime       = DateTimeOffset.Now,
                Role             = "Lekarz"
            };

            return(View(model));
        }
Exemplo n.º 2
0
 public void Save(WorkScheduleView viewTable)
 {
     if (viewTable.Id == null)
     {
         var domainTable = new WorkScheduleTable();
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
     else
     {
         var domainTable = Find(viewTable.Id);
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
 }
Exemplo n.º 3
0
 public ActionResult Edit(WorkScheduleView model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _Service.Save(model);
             return(RedirectToAction("Index"));
         }
         catch (Exception e)
         {
             ModelState.AddModelError(string.Empty, e.GetOriginalException().Message);
         }
     }
     return(View(model));
 }
Exemplo n.º 4
0
        public WorkScheduleView GetNewModel()
        {
            var model = new WorkScheduleView();

            return(model);
        }