Пример #1
0
        public VacationList GetListVacaton(DateTime dateTime, int dias)
        {
            VacationList list     = new VacationList();
            DateTime     baseTime = dateTime.AddDays(1);

            if (AddDay(baseTime))
            {
                list.AddDAY(new Dia()
                {
                    Day = baseTime
                });
                dias--;
            }

            for (int i = 0; i < dias;)
            {
                baseTime = baseTime.AddDays(1);
                if (AddDay(baseTime))
                {
                    list.AddDAY(new Dia()
                    {
                        Day = baseTime
                    });
                    i++;
                }
            }
            list.RemainDays();
            return(list);
        }
        public void BindVacationList()
        {
            if (VacationList == null || VacationList.Count < 1)
            {
                tbVacationList.Visible = false;
            }
            else
            {
                tbVacationList.Visible = true;
                //排序
                Vacation            vacation = new Vacation();
                SortList <Vacation> sortList =
                    new SortList <Vacation>(vacation, "VacationEndDate", ReverserInfo.Direction.DESC);
                VacationList.Sort(sortList);

                gdVacationList.DataSource = VacationList;
                gdVacationList.DataBind();
            }
        }
Пример #3
0
 public IActionResult addVacationlist([FromBody] VacationList T)
 {
     return(Ok(vacationRepository.AddVacationList(T.myList)));
 }
Пример #4
0
 public Employee()
 {
     Vacations = new VacationList();
 }
Пример #5
0
        public void Creating_VacationList_Date_Today()
        {
            var VacationList = new VacationList();

            Assert.True(VacationList.AddedOn.Date == DateTime.Today.Date);
        }