private void BindClendarControl() { if (!IsPostBack) { BindViewType(); } BindLabelHeader(); int mask = 0; foreach (ListItem li in cblType.Items) { if (li.Selected) { mask = mask | int.Parse(li.Value); } } DataTable dt; dt = Mediachase.IBN.Business.CalendarView.GetListCalendarEntries(CalendarCtrl.DisplayStartDate, CalendarCtrl.DisplayEndDate, true, false, false, mask, int.Parse(ddlPerson.SelectedValue), ProjectID, true); int fdow = (int)System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; fdow = (int)Math.Pow(2, fdow); CalendarCtrl.FirstDayOfWeek = (CalendarDayOfWeek)fdow; CalendarCtrl.Items.Clear(); CalendarCtrl.DataSource = dt.DefaultView; CalendarCtrl.DataBind(); CalendarCtrl.DayLinkFormat = "../events/eventedit.aspx?ProjectId=" + ProjectID + "&start={0:g}"; pc["ProjectCWrapper_StartDate"] = CalendarCtrl.SelectedDate.ToString("d", culture); }
private void BindClendarControl() { if (!IsPostBack) { BindViewType(); } else { SelectRightTab(CalendarCtrl.ViewType); } BindLabelHeader(); int mask = 0; foreach (ListItem li in cblType.Items) { if (li.Selected) { mask = mask | int.Parse(li.Value); } } int UserID = 0; if (pc["Calendar1_CurrentTab"] != "SharedCalendars") { UserID = Security.CurrentUser.UserID; } else { UserID = int.Parse((string)ViewState["SharedId"]); } DataTable dt = Mediachase.IBN.Business.CalendarView.GetListCalendarEntriesByUser( CalendarCtrl.DisplayStartDate, CalendarCtrl.DisplayEndDate, true, false, false, mask, UserID, true); int fdow = (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; fdow = (int)Math.Pow(2, fdow); CalendarCtrl.FirstDayOfWeek = (CalendarDayOfWeek)fdow; CalendarCtrl.Items.Clear(); CalendarCtrl.DataSource = dt.DefaultView; CalendarCtrl.DataBind(); CalendarCtrl.DayLinkFormat = "../events/eventedit.aspx?start={0:g}"; }