protected void btnSave_Click(object sender, EventArgs e) { if (txTameliStatusName.Text.Trim() == "") { lblStatusMessage.Text = "Tameli Status छुट्यो </br>"; this.programmaticModalPopup.Show(); return; } try { List <ATTTameliStatus> tameliStatusLST = (List <ATTTameliStatus>)Session["TameliStatus"]; ATTTameliStatus tameliStatus = new ATTTameliStatus(); tameliStatus.TameliStatusName = txTameliStatusName.Text.Trim(); tameliStatus.Active = (chkTameliStatus.Checked) ? "Y" : "N"; tameliStatus.EntryBy = entryBy; if (lstTameliStatus.SelectedIndex >= 0) { tameliStatus.Action = "E"; tameliStatus.TameliStatusID = tameliStatusLST[lstTameliStatus.SelectedIndex].TameliStatusID; } else { tameliStatus.Action = "A"; } if (BLLTameliStatus.AddEditDeleteTameliStatus(tameliStatus)) { if (lstTameliStatus.SelectedIndex >= 0) { tameliStatusLST[lstTameliStatus.SelectedIndex] = tameliStatus; } else { tameliStatusLST.Add(tameliStatus); } lstTameliStatus.DataSource = tameliStatusLST; lstTameliStatus.DataBind(); lblStatusMessage.Text = "Data Saved Successfully</br>"; this.programmaticModalPopup.Show(); } else { lblStatusMessage.Text = "Problem Occurred while Saving Data </br>"; this.programmaticModalPopup.Show(); } txTameliStatusName.Text = ""; chkTameliStatus.Checked = true; lstTameliStatus.SelectedIndex = -1; } catch (Exception) { lblStatusMessage.Text = "Problem Occurred while Saving Data </br>"; this.programmaticModalPopup.Show(); } }
private void LoadTameliStatus() { try { List <ATTTameliStatus> tameliStatusLIST = BLLTameliStatus.GetTameliStatus(null, null); Session["TameliStatus"] = tameliStatusLIST; lstTameliStatus.DataSource = tameliStatusLIST; lstTameliStatus.DataBind(); lstTameliStatus.SelectedIndex = -1; } catch (Exception) { lblStatusMessage.Text = "Could Not Load Tameli Status </br>"; this.programmaticModalPopup.Show(); } }
private void LoadTameliStatus() { try { List <ATTTameliStatus> tameliStatusLIST = BLLTameliStatus.GetTameliStatus(null, null); tameliStatusLIST.Insert(0, new ATTTameliStatus(0, "Choose", "Y")); ddlTameliStatus.DataSource = tameliStatusLIST; ddlTameliStatus.DataBind(); ddlTameliStatus.SelectedIndex = -1; } catch (Exception) { lblStatusMessage.Text = "Could Not Load Tameli Status </br>"; this.programmaticModalPopup.Show(); } }