private void SaveData() { LStblReligionDAL _dalLSTblReligion = null; Hashtable _htParameters = null; int iNextID = 0; try { _dalLSTblReligion = new LStblReligionDAL(); _htParameters = new Hashtable(); MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters); Utility.ApplyDefaultProp(_htParameters); if (Request.Params["action"] == "add") { _dalLSTblReligion.Insert(_htParameters, ref iNextID); } else { _dalLSTblReligion.Update(_htParameters); iNextID = Int32.Parse(lblRELIGION.Text); } Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "lstblreligiondetail.aspx?action=edt&id=" + iNextID.ToString()); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null); } }
protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Edit": Response.Redirect("lstblreligiondetail.aspx?action=edt&id=" + e.CommandArgument); break; case "Delete": LStblReligionDAL _dalLSTblReligion = null; Hashtable _htParameters = null; try { _dalLSTblReligion = new LStblReligionDAL(); _htParameters = new Hashtable(); _htParameters["p_ls_tblreligionid"] = e.CommandArgument.ToString(); _dalLSTblReligion.Delete(_htParameters); this.BindGrid(); Response.Redirect("lstblreligionlist.aspx"); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; } }
private void BindGrid() { LStblReligionDAL _dalLSTblReligion = null; Hashtable _htParameters = null; try { _dalLSTblReligion = new LStblReligionDAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = txtSearch.Text; gvwList.DataSource = _dalLSTblReligion.GetRows(_htParameters); gvwList.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null); } }
private void LoadData() { LStblReligionDAL _dalLSTblReligion = null; Hashtable _htParameters = null; try { //System.Diagnostics.Debugger.Break(); _dalLSTblReligion = new LStblReligionDAL(); _htParameters = new Hashtable(); _htParameters["p_ls_tblreligionid"] = Request.Params["id"]; DataTable _dt = _dalLSTblReligion.GetRow(_htParameters); MPF23.Shared.Mapper.DBToUI.Map(pnlBody.Controls, _dt.Rows[0]); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } }
public static void BindDDLHRMSReligion(DropDownList ddl) { LStblReligionDAL _dalLStblReligionDAL = null; Hashtable _htParameters = null; try { _dalLStblReligionDAL = new LStblReligionDAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = ""; ddl.DataSource = _dalLStblReligionDAL.GetRows(_htParameters); ddl.DataValueField = "ReligionCode"; ddl.DataTextField = "ReligionName"; ddl.DataBind(); } catch (Exception ex) { throw ex; } }