void FillLabels() { lDate.Text = " с " + Start.SelectedDate.ToLongDateString() + " по " + End.SelectedDate.ToLongDateString(); if (IsAllSelected(IdU)) { lU.Text = " любой"; } else { lU.Text = GetSelected(IdU); } if (IsAllSelected(IdM)) { lM.Text = " любой"; } else { lM.Text = GetSelected(IdM); } if (IsAllSelected(IdL)) { lL.Text = " любой"; } else { lL.Text = GetSelected(IdL); } if (IsAllSelected(Address)) { if (GetSelectedTitles(IdU).Count == 1 && GetSelectedTitles(IdM).Count == 1) { KOS.App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); List <string> ls = db.GetAddress(GetSelectedTitles(IdU)[0], GetSelectedTitles(IdM)[0]); lAddress.Text = string.Empty; foreach (string s in ls) { if (!string.IsNullOrEmpty(lAddress.Text)) { lAddress.Text += ", "; } lAddress.Text += s; } } else { lAddress.Text = " любой"; } } else { lAddress.Text = GetSelected(Address); } if (IsAllSelected(Category)) { lCategory.Text = " любая"; } else { lCategory.Text = GetSelected(Category); } if (IsAllSelected(Done)) { lDone.Text = " любые"; } else { lDone.Text = GetSelected(Done); } }
void FillLabels() { lPrinyalDate.Text = " с " + CalendarStart.SelectedDate.ToLongDateString() + " по " + CalendarStartEnd.SelectedDate.ToLongDateString(); if (HourStart.IsAllSelected()) { lPHours.Text = " все"; } else { List <int> sel = HourStart.GetSelectedTitles(); lPHours.Text = string.Empty; foreach (int i in sel) { if (string.IsNullOrEmpty(lPHours.Text)) { lPHours.Text += i.ToString(); } else { lPHours.Text += ", " + i.ToString(); } } } if (MinuteStart.IsAllSelected()) { lPMinutes.Text = " все"; } else { List <int> sel = MinuteStart.GetSelectedTitles(); lPMinutes.Text = string.Empty; foreach (int i in sel) { if (string.IsNullOrEmpty(lPMinutes.Text)) { lPMinutes.Text += i.ToString(); } else { lPMinutes.Text += ", " + i.ToString(); } } } if (_role != "Worker") { lVypolnilDate.Text = " с " + CalendarFinish.SelectedDate.ToLongDateString() + " по " + CalendarFinishEnd.SelectedDate.ToLongDateString(); } else { lVypolnilDate.Text = " в любое время"; } if (HourFinish.IsAllSelected()) { lVHours.Text = " все"; } else { List <int> sel = HourFinish.GetSelectedTitles(); lVHours.Text = string.Empty; foreach (int i in sel) { if (string.IsNullOrEmpty(lVHours.Text)) { lVHours.Text += i.ToString(); } else { lVHours.Text += ", " + i.ToString(); } } } if (MinuteFinish.IsAllSelected()) { lVMinutes.Text = " все"; } else { List <int> sel = MinuteFinish.GetSelectedTitles(); lVMinutes.Text = string.Empty; foreach (int i in sel) { if (string.IsNullOrEmpty(lVMinutes.Text)) { lVMinutes.Text += i.ToString(); } else { lVMinutes.Text += ", " + i.ToString(); } } } if (IsAllSelected(IdU)) { lU.Text = " любой"; } else { lU.Text = GetSelected(IdU); } if (IsAllSelected(IdM)) { lM.Text = " любой"; } else { lM.Text = GetSelected(IdM); } if (IsAllSelected(IdL)) { lL.Text = " любой"; } else { lL.Text = GetSelected(IdL); } if (IsAllSelected(Address)) { if (GetSelectedTitles(IdU).Count == 1 && GetSelectedTitles(IdM).Count == 1) { KOS.App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); List <string> ls = db.GetAddress(GetSelectedTitles(IdU)[0], GetSelectedTitles(IdM)[0]); lAddress.Text = string.Empty; foreach (string s in ls) { if (!string.IsNullOrEmpty(lAddress.Text)) { lAddress.Text += ", "; } lAddress.Text += s; } } else { lAddress.Text = " любой"; } } else { lAddress.Text = GetSelected(Address); } if (IsAllSelected(Category)) { lCategory.Text = " любая"; } else { lCategory.Text = GetSelected(Category); } if (IsAllSelected(From)) { lSource.Text = " любой"; } else { lSource.Text = GetSelected(From); } if (IsAllSelected(Prinyal)) { lPrinyal.Text = " любой"; } else { lPrinyal.Text = GetSelected(Prinyal); } if (_role == "Worker") { App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); App_Code.Base.UserInfo ui = db.GetUserInfo(Page.User.Identity.Name); lWorker.Text = ui.Family + " " + ui.IO; } else if (IsAllSelected(Worker)) { lWorker.Text = " любой"; } else { lWorker.Text = GetSelected(Worker); } }
void FillLabels() { lPrinyalDate.Text = " с " + Calendar.SelectedDate.ToLongDateString() + " по " + CalendarEnd.SelectedDate.ToLongDateString(); if (IsAllSelected(IdU)) { lU.Text = " любой"; } else { List <string> ls = GetSelectedTitles(IdU); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lU.Text = ls[i]; } else { lU.Text += ", " + ls[i]; } } } if (IsAllSelected(IdM)) { lM.Text = " любой"; } else { List <string> ls = GetSelectedTitles(IdM); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lM.Text = ls[i]; } else { lM.Text += ", " + ls[i]; } } } if (IsAllSelected(IdL)) { lL.Text = " любой"; } else { List <string> ls = GetSelectedTitles(IdL); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lL.Text = ls[i]; } else { lL.Text += ", " + ls[i]; } } } if (IsAllSelected(Address)) { if (GetSelectedTitles(IdU).Count == 1 && GetSelectedTitles(IdM).Count == 1) { KOS.App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); List <string> ls = db.GetAddress(GetSelectedTitles(IdU)[0], GetSelectedTitles(IdM)[0]); lAddress.Text = string.Empty; foreach (string s in ls) { if (!string.IsNullOrEmpty(lAddress.Text)) { lAddress.Text += ", "; } lAddress.Text += s; } } else { lAddress.Text = " любой"; } } else { List <string> ls = GetSelectedTitles(Address); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lAddress.Text = ls[i]; } else { lAddress.Text += ", " + ls[i]; } } } if (IsAllSelected(WorkType)) { lWorkType.Text = " любой"; } else { List <string> ls = GetSelectedTitles(WorkType); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lWorkType.Text = ls[i]; } else { lWorkType.Text += ", " + ls[i]; } } } if (_role == "Worker") { App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); App_Code.Base.UserInfo ui = db.GetUserInfo(Page.User.Identity.Name); lWorker.Text = ui.Family + " " + ui.IO; } else if (IsAllSelected(Worker)) { lWorker.Text = " любой"; } else { List <string> ls = GetSelectedTitles(Worker); for (int i = 0; i < ls.Count; i++) { if (i == 0) { lWorker.Text = ls[i]; } else { lWorker.Text += ", " + ls[i]; } } } if (IsAllSelected(Done)) { lDone.Text = " любое состояние"; } else { List <string> ls = GetSelectedTitles(Done); if (ls.Count > 0) { lDone.Text = ls[0]; } } }