private void SaveData() { MST_UNIT_KERJA_DAL _dalMST_UNIT_KERJA_DAL = null; Hashtable _htParameters = null; int iNextID = 0; try { _dalMST_UNIT_KERJA_DAL = new MST_UNIT_KERJA_DAL(); _htParameters = new Hashtable(); MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters); Utility.ApplyDefaultProp(_htParameters); if (Request.Params["action"] == "add") { _dalMST_UNIT_KERJA_DAL.Insert(_htParameters, ref iNextID); } else { _dalMST_UNIT_KERJA_DAL.Update(_htParameters); iNextID = Int32.Parse(lblID.Text); } Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "ukerdtl.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("ukerdtl.aspx?action=edt&id=" + e.CommandArgument); break; case "Delete": MST_UNIT_KERJA_DAL _dalMST_UNIT_KERJA_DAL = null; Hashtable _htParameters = null; try { _dalMST_UNIT_KERJA_DAL = new MST_UNIT_KERJA_DAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = e.CommandArgument.ToString(); _dalMST_UNIT_KERJA_DAL.Delete(_htParameters); this.BindGrid(); Response.Redirect("ukerlist.aspx"); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; } }
//-------------------------- ------------------------------------------- private void BindGridPopUpUnitkerja() { MST_UNIT_KERJA_DAL _dalMST_UNIT_KERJA_DAL = null; Hashtable _htParameters = null; try { _dalMST_UNIT_KERJA_DAL = new MST_UNIT_KERJA_DAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = txtSearchUnitKerja.Text; _htParameters["p_majelis"] = ""; gvwListUnitKerja.DataSource = _dalMST_UNIT_KERJA_DAL.GetRows(_htParameters); gvwListUnitKerja.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null); } }
private void LoadData() { MST_UNIT_KERJA_DAL _dalMST_UNIT_KERJA_DAL = null; Hashtable _htParameters = null; try { //System.Diagnostics.Debugger.Break(); _dalMST_UNIT_KERJA_DAL = new MST_UNIT_KERJA_DAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = Request.Params["id"]; DataTable _dt = _dalMST_UNIT_KERJA_DAL.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); } }
private void BindUnitKerja() { MST_UNIT_KERJA_DAL _dalmst_unit_kerja = null; Hashtable _htParameters = null; try { _dalmst_unit_kerja = new MST_UNIT_KERJA_DAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = ""; ddlUnitKerja.DataSource = _dalmst_unit_kerja.GetRows(_htParameters); ddlUnitKerja.DataValueField = "KODE"; ddlUnitKerja.DataTextField = "nama"; ddlUnitKerja.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } }