protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Edit": Response.Redirect("mstgapokdtl.aspx?action=edt&id=" + e.CommandArgument); break; case "Delete": MST_GAPOK_DAL _dalMST_GAPOK_DAL = null; Hashtable _htParameters = null; try { _dalMST_GAPOK_DAL = new MST_GAPOK_DAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = e.CommandArgument.ToString(); _dalMST_GAPOK_DAL.Delete(_htParameters); this.BindGrid(); Response.Redirect("mstgapoklist.aspx"); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; } }
private void SaveData() { MST_GAPOK_DAL _dalMST_GAPOK_DAL = null; Hashtable _htParameters = null; int iNextID = 0; try { _dalMST_GAPOK_DAL = new MST_GAPOK_DAL(); _htParameters = new Hashtable(); MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters); Utility.ApplyDefaultProp(_htParameters); if (Request.Params["action"] == "add") { _dalMST_GAPOK_DAL.Insert(_htParameters, ref iNextID); } else { _dalMST_GAPOK_DAL.Update(_htParameters); iNextID = Int32.Parse(lblID.Text); } Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "mstgapokdtl.aspx?action=edt&id=" + iNextID.ToString()); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null); } }
private void BindGrid() { MST_GAPOK_DAL _dalMST_GAPOK_DAL = null; Hashtable _htParameters = null; try { _dalMST_GAPOK_DAL = new MST_GAPOK_DAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = txtSearch.Text; _htParameters["p_tahun"] = ddlTahun.SelectedValue; gvwList.DataSource = _dalMST_GAPOK_DAL.GetRows(_htParameters); gvwList.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null); } }
private void LoadData() { MST_GAPOK_DAL _dalMST_GAPOK_DAL = null; Hashtable _htParameters = null; try { _dalMST_GAPOK_DAL = new MST_GAPOK_DAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = Request.Params["id"]; DataTable _dt = _dalMST_GAPOK_DAL.GetRow(_htParameters); _dt.Rows[0]["NOMINAL"] = string.Format("{0:0,0.00}", Convert.ToDecimal(_dt.Rows[0]["NOMINAL"])); 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 BindTahun() { MST_GAPOK_DAL _dalMST_GAPOK_DAL = null; Hashtable _htParameters = null; try { _dalMST_GAPOK_DAL = new MST_GAPOK_DAL(); _htParameters = new Hashtable(); _htParameters["p_keywords"] = ""; ddlTahun.DataSource = _dalMST_GAPOK_DAL.GetRowsTahun(_htParameters); ddlTahun.DataValueField = "TAHUN"; ddlTahun.DataTextField = "TAHUN"; ddlTahun.DataBind(); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } }