public ActionResult EditVacation(int vacationId)
        {
            UsersService users = new UsersService();
            User u = users.FindUserByUsername(HttpContext.User.Identity.Name);
            ViewBag.BrDana = u.VacationDays;
            ViewBag.Flag = flag;

            TestService ser = new TestService();
            if (ser.FindVacationByUserId(u.UserId, vacationId) == true)
            {
                Vacation vac = (Vacation)db.FindById(vacationId);
                if (vac == null)
                {
                    //...
                    return RedirectToAction("SeeVacations");
                }
                Double numDays = (vac.DateTo - vac.DateFrom).TotalDays;
                daniZaVracanje = Convert.ToInt32(numDays);
                String datum = DateTime.Now.ToString("yyyy-MM-dd");
                ViewBag.Datum = datum;
                ViewBag.Bolestan = vac.IsSickLeave;
                datumProveraZaEdit = vac.DateTo;
                datumProveraZaEditPocetak = vac.DateFrom;
                ViewBag.editDateFrom = vac.DateFrom.ToString("yyyy-MM-dd");
                ViewBag.editDateTo = vac.DateTo.ToString("yyyy-MM-dd");
                flag = 0;
                ViewBag.ProveraDaniZaEdit = daniZaProveruZaEdit;
                ViewBag.FlagZaPozivEdita = flagZaPozivEdita;
                flagZaPozivEdita = 0;
                return View(vac);
            }
            else
            {

                return RedirectToAction("SeeVacations");
            }
        }
        private void revertOldVacationDays(Holiday h)
        {
            TestService vacationService = new TestService();
            UsersService users = new UsersService();
            List<Vacation> vacations = vacationService.GetVacations().ToList();
            double addMoreDaysToVacation = 0;
            foreach (Vacation v in vacations)
            {
                if (v.IsSickLeave) continue;

                //ako se praznik nalazi ceo izmedju, povecaj dane za sve.
                if (h.DateFrom >= v.DateFrom && h.DateFrom <= v.DateTo)
                {
                    if (h.DateTo <= v.DateTo)
                    {
                        addMoreDaysToVacation = (h.DateTo - h.DateFrom).TotalDays;
                    }
                    else
                    {
                        addMoreDaysToVacation = (v.DateTo - h.DateFrom).TotalDays;
                    }
                }
                else if (h.DateFrom <= v.DateFrom && h.DateTo >= v.DateTo)
                {
                    addMoreDaysToVacation = (v.DateTo - v.DateFrom).TotalDays;
                }
                else if (h.DateFrom <= v.DateFrom && h.DateTo <= v.DateTo && h.DateTo >= v.DateFrom)
                {

                    addMoreDaysToVacation = (h.DateTo - v.DateFrom).TotalDays;
                }

                if (addMoreDaysToVacation > 0)
                {
                    User u = (User)users.FindById(v.UserId);
                    u.VacationDays -= Convert.ToInt32(addMoreDaysToVacation);
                    users.Edit(u);
                }
            }
        }