Exemple #1
0
        protected void DaysHollidayPeriodSet_Click(object sender, EventArgs e)
        {
            DaysHollidayPeriodSetting.Visible = false;

            Base.PersonData pd = _workers.Find(delegate(Base.PersonData i)
            {
                return(i.Title == WorkerName.SelectedValue);
            });
            List <App_Code.Base.CheckedLift> list = new List <Base.CheckedLift>();

            App_Code.Base   db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
            List <DateTime> d  = db.GetDaysHolliday(pd.Id, DHStart.SelectedDate, DHEnd.SelectedDate);

            for (DateTime date = DHStart.SelectedDate; date <= DHEnd.SelectedDate; date = date.AddDays(1))
            {
                App_Code.Base.CheckedLift cl = new Base.CheckedLift()
                {
                    Title = date.ToShortDateString()
                };
                if (d.FindIndex(delegate(DateTime i)
                {
                    return(i == date);
                }) >= 0)
                {
                    cl.Checked = true;
                }
                list.Add(cl);
            }
            DaysHolliday.DataSource = list;
            DaysHolliday.DataBind();
            SetDaysHolliday.Visible = true;
        }