Example #1
0
 protected override void OnPreRender(EventArgs e)
 {
     base.OnPreRender(e);
     if (_role == "ODS" || _role == "Cadry")
     {
         App_Code.Base db    = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         List <string> lifts = db.GetODSLiftList(User.Identity.Name);
         LiftsRep.Set(lifts, new DateTime(_year, _month, 1),
                      new DateTime(_year, _month, DateTime.DaysInMonth(_year, _month)), "Всё", _role); //"Всё"
         if (_month > 1)
         {
             PrevMonth.Text        = KOS.App_Code.Base.months[_month - 2] + " " + _year.ToString();
             PrevMonth.NavigateUrl = "~/Lifts.aspx?y=" + _year.ToString() + "&m=" + (_month - 1).ToString();
         }
         else
         {
             PrevMonth.Text        = KOS.App_Code.Base.months[11] + " " + (_year - 1).ToString();
             PrevMonth.NavigateUrl = "~/Lifts.aspx?y=" + (_year - 1).ToString() + "&m=12";
         }
         if (_month < 12)
         {
             NextMonth.Text        = KOS.App_Code.Base.months[_month] + " " + _year.ToString();
             NextMonth.NavigateUrl = "~/Lifts.aspx?y=" + _year.ToString() + "&m=" + (_month + 1).ToString();
         }
         else
         {
             NextMonth.Text        = KOS.App_Code.Base.months[0] + " " + (_year + 1).ToString();
             NextMonth.NavigateUrl = "~/Lifts.aspx?y=" + (_year + 1).ToString() + "&m=1";
         }
         phGo.Visible = true;
     }
     else
     {
         List <string> lifts = GetSelectedTitles(IdL);
         LiftsRep.Set(lifts, PeriodBeg.SelectedDate, PeriodEnd.SelectedDate.AddDays(1), Type.SelectedValue, _role);
     }
 }