void LoadRegistrationType() { try { Session["RegistrationType"] = BLLRegistrationType.GetRegistrationType(null, null, 0); List <ATTRegistrationType> RegTypeList = (List <ATTRegistrationType>)Session["RegistrationType"]; this.grdRegType.DataSource = RegTypeList; this.grdRegType.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtRegTypeName_RQD.Text == "") { lblStatusMessage.Text = "दर्ताको किसिम लेख्नुस"; programmaticModalPopup.Show(); return; } ATTRegistrationType objRegTypeList = new ATTRegistrationType(int.Parse(this.hdnFldRegTypeID.Value), this.txtRegTypeName_RQD.Text.Trim(), this.chkActive.Checked == true ? "Y" : "N"); objRegTypeList.EntryBy = strUser; if (this.lstRegistrationType.SelectedIndex > -1) { objRegTypeList.Action = "E"; } else { objRegTypeList.Action = "A"; } try { List <ATTRegistrationType> ListRgTypeList = (List <ATTRegistrationType>)Session["RegistrationType"]; BLLRegistrationType.SaveRegistrationType(objRegTypeList); if (this.lstRegistrationType.SelectedIndex > -1) { ListRgTypeList[this.lstRegistrationType.SelectedIndex].RegTypeID = objRegTypeList.RegTypeID; ListRgTypeList[this.lstRegistrationType.SelectedIndex].RegTypeName = objRegTypeList.RegTypeName; ListRgTypeList[this.lstRegistrationType.SelectedIndex].Active = objRegTypeList.Active; } else { ListRgTypeList.Add(objRegTypeList); } ClearControls(); this.lstRegistrationType.DataSource = ListRgTypeList; this.lstRegistrationType.DataBind(); this.lblStatusMessage.Text = "Registration Type Successfully Saved."; this.programmaticModalPopup.Show(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }