protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Edit": Response.Redirect("lstblbranchdetail.aspx?action=edt&id=" + e.CommandArgument); break; case "Delete": LStblBranchDAL _dalLSTblBranch = null; Hashtable _htParameters = null; try { _dalLSTblBranch = new LStblBranchDAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = e.CommandArgument.ToString(); _dalLSTblBranch.Delete(_htParameters); this.BindGrid(); Response.Redirect("lstblbranchlist.aspx"); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; } }
private void SaveData() { LStblBranchDAL _dalLSTblBranch = null; Hashtable _htParameters = null; int iNextID = 0; try { _dalLSTblBranch = new LStblBranchDAL(); _htParameters = new Hashtable(); MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters); Utility.ApplyDefaultProp(_htParameters); if (Request.Params["action"] == "add") { _dalLSTblBranch.Insert(_htParameters, ref iNextID); } else { _dalLSTblBranch.Update(_htParameters); iNextID = Int32.Parse(lblBRANCH.Text); } Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "lstblbranchdetail.aspx?action=edt&id=" + iNextID.ToString()); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null); } }
private void BindGrid() { LStblBranchDAL _dalLSTblBranch = null; Hashtable _htParameters = null; try { _dalLSTblBranch = new LStblBranchDAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = txtSearch.Text; gvwList.DataSource = _dalLSTblBranch.GetRows(_htParameters); gvwList.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null); } }
private void LoadData() { LStblBranchDAL _dalLSTblBranch = null; Hashtable _htParameters = null; try { //System.Diagnostics.Debugger.Break(); _dalLSTblBranch = new LStblBranchDAL(); _htParameters = new Hashtable(); _htParameters["p_ls_tblbranchid"] = Request.Params["id"]; DataTable _dt = _dalLSTblBranch.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); } }
//OJK public static void BindDDLHRMSBranch(DropDownList ddl) { LStblBranchDAL _dalLStblBranchDAL = null; Hashtable _htParameters = null; try { _dalLStblBranchDAL = new LStblBranchDAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = ""; ddl.DataSource = _dalLStblBranchDAL.GetRows(_htParameters); ddl.DataValueField = "BranchCode"; ddl.DataTextField = "BranchName"; ddl.DataBind(); } catch (Exception ex) { throw ex; } }