protected void btnSubmit_Click(object sender, EventArgs e) { ATTMeetingStatus status = new ATTMeetingStatus(); status.MeetingStatusName = this.txtMeetingStatus.Text; if (this.lstMeetingStatus.SelectedIndex < 0) { status.MeetingStatusID = 0; status.MeetingStatusColor = this.ColorPicker.Color; status.Action = "A"; } else { status.MeetingStatusID = ((List <ATTMeetingStatus>)Session["MeetingStatusLst"])[this.lstMeetingStatus.SelectedIndex].MeetingStatusID; status.MeetingStatusColor = this.ColorPicker.Color; status.Action = "E"; } ObjectValidation result = BLLMeetingStatus.Validate(status); if (result.IsValid == false) { this.lblStatusMessage.Text = result.ErrorMessage; this.programmaticModalPopup.Show(); return; } try { BLLMeetingStatus.AddMeetingStatus(status); List <ATTMeetingStatus> lst = ((List <ATTMeetingStatus>)Session["MeetingStatusLst"]); if (status.Action == "A") { lst.Add(status); } else { lst[this.lstMeetingStatus.SelectedIndex] = status; } this.lstMeetingStatus.DataSource = lst; this.lstMeetingStatus.DataTextField = "MeetingStatusName"; this.lstMeetingStatus.DataValueField = "MeetingStatusID"; this.lstMeetingStatus.DataBind(); this.ClearME(); this.lstMeetingStatus.SelectedIndex = -1; this.lblStatusMessage.Text = "Meeting status successfully saved."; this.programmaticModalPopup.Show(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
void LoadMeetingStatus() { Session["MeetingStatusLst"] = BLLMeetingStatus.GetMeetingStatusList(null, false); this.lstMeetingStatus.DataSource = Session["MeetingStatusLst"]; this.lstMeetingStatus.DataTextField = "MeetingStatusName"; this.lstMeetingStatus.DataValueField = "MeetingStatusID"; this.lstMeetingStatus.DataBind(); }
void LoadMeetingStatus() { try { List <ATTMeetingStatus> lst = BLLMeetingStatus.GetMeetingStatusList(null, true); this.ddlStatus.DataSource = lst; this.ddlStatus.DataTextField = "MeetingStatusName"; this.ddlStatus.DataValueField = "MeetingStatusID"; this.ddlStatus.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }