private void LoadDataTask() { try { Shared.BindGrvEmpSPDTask(grvTask, txtSPD_No.Text); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } }
protected void grvTask_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "EditRow": try { GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); int RowIndex = gvr.RowIndex; txtDescription_Task.Text = gvr.Cells[1].Text; txtDepart_Date.Text = gvr.Cells[2].Text; txtArrive_Date.Text = gvr.Cells[3].Text; txtCity_Destination.Text = gvr.Cells[4].Text; txtContact_Person.Text = gvr.Cells[5].Text; lblIDTask.Text = e.CommandArgument.ToString(); mdlPopupGetTask.Show(); lbljudulTask.Text = "Ubah"; } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; case "DeleteRow ": try { EmpSPDTaskDAL _dalEmpSPDTaskDAL = null; Hashtable _htParameters = null; _dalEmpSPDTaskDAL = new EmpSPDTaskDAL(); _htParameters = new Hashtable(); _htParameters["p_ID"] = e.CommandArgument.ToString(); _dalEmpSPDTaskDAL.Delete(_htParameters); Shared.BindGrvEmpSPDTask(grvTask, txtSPD_No.Text); Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "spddtl.aspx?action=edt&page=1&id=" + Request.Params["id"]); } catch (Exception ex) { Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null); } break; } }