Esempio n. 1
0
 private void LoadDataCost()
 {
     try
     {
         Shared.BindGrvEmpSPDCost(grvCost, txtSPD_No.Text);
     }
     catch (Exception ex)
     {
         Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
     }
 }
Esempio n. 2
0
    protected void grvCost_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "EditRow":
            try
            {
                GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);

                int RowIndex = gvr.RowIndex;
                txtCost_Code.Text        = gvr.Cells[1].Text;
                txtCost_Description.Text = gvr.Cells[2].Text;
                txtCost_Value.Text       = gvr.Cells[3].Text;
                txtQty.Text        = gvr.Cells[4].Text;
                txtTotal_Cost.Text = gvr.Cells[5].Text;
                lblIDCost.Text     = e.CommandArgument.ToString();
                //mdlPopupGetCost.Show();
                lbljudulCost.Text   = "Ubah";
                panelDetail.Visible = true;
            }
            catch (Exception ex)
            {
                Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
            }
            break;

        case "DeleteRow ":
            try
            {
                EmpSPDCostDAL _dalEmpSPDCostDAL = null;
                Hashtable     _htParameters     = null;

                _dalEmpSPDCostDAL = new EmpSPDCostDAL();
                _htParameters     = new Hashtable();

                _htParameters["p_ID"] = e.CommandArgument.ToString();

                _dalEmpSPDCostDAL.Delete(_htParameters);

                Shared.BindGrvEmpSPDCost(grvCost, txtSPD_No.Text);
                Utility.ShowMessageBox(this, Utility.DELETE_VALIDATION_SUCCESS_MESSAGE, null, "spddtl.aspx?action=edt&page=2&id=" + Request.Params["id"]);
            }
            catch (Exception ex)
            {
                Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
            }
            break;
        }
    }