protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Edit":
            Response.Redirect("spddtl.aspx?action=edt&id=" + e.CommandArgument);
            break;

        case "Delete":
            HR_PELAMARDAL _DALpelamar   = null;
            Hashtable     _htParameters = null;

            try
            {
                _DALpelamar   = new HR_PELAMARDAL();
                _htParameters = new Hashtable();

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

                _DALpelamar.Delete(_htParameters);
                this.BindGrid();
                Response.Redirect("pegawailist.aspx");
            }
            catch (Exception ex)
            {
                Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
            }
            break;
        }
    }
    private void BindGrid()
    {
        HR_PELAMARDAL _DALpelamar   = null;
        Hashtable     _htParameters = null;

        try
        {
            _DALpelamar   = new HR_PELAMARDAL();
            _htParameters = new Hashtable();

            _htParameters["p_keywords"]       = txtSearch.Text;
            _htParameters["p_status_PEGAWAI"] = "0";
            if (Session[SessionKey.CURRENT_USER_HRMS_ROLE].ToString() == "1")
            {
                _htParameters["p_kode"] = lblEmployee_Code.Text;
            }

            gvwList.DataSource = _DALpelamar.GetRows(_htParameters);
            gvwList.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
Beispiel #3
0
    private void SaveData()
    {
        HR_PELAMARDAL _dalhr_pelamar = null;
        Hashtable     _htParameters  = null;
        int           iNextID        = 0;

        try
        {
            _dalhr_pelamar = new HR_PELAMARDAL();
            _htParameters  = new Hashtable();
            MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters);
            Utility.ApplyDefaultProp(_htParameters);

            if (rdbtnJenKel.SelectedValue == "0")
            {
                _htParameters["p_JENIS_KELAMIN"] = true;
            }
            else
            {
                _htParameters["p_JENIS_KELAMIN"] = false;
            }
            _htParameters["p_STATUS_KAWIN"]        = rdbtnStatusNikah.SelectedValue;
            _htParameters["p_JENIS_SIM"]           = ddlJenisSIM.SelectedValue;
            _htParameters["p_KENDARAAN"]           = ddlKendaraan.SelectedValue;
            _htParameters["p_PENDIDIKAN_TERAKHIR"] = ddlPendidikan.SelectedValue;
            _htParameters["p_KODE_AGAMA"]          = DdlAgama.SelectedValue;
            _htParameters["p_STATUS_PEGAWAI"]      = false;
            _htParameters["p_SIAP_LEMBUR"]         = false;
            _htParameters["p_SIAP_LUAR_KOTA"]      = false;
            if (Request.Params["action"] == "add")
            {
                _dalhr_pelamar.Insert(_htParameters, ref iNextID);
            }
            else
            {
                _dalhr_pelamar.Update(_htParameters);
                iNextID = Int32.Parse(lblid.Text.ToString());
            }
            Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "usergroupdetail.aspx?action=edt&id=" + iNextID.ToString());
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null);
        }
    }
Beispiel #4
0
    private void LoadData()
    {
        HR_PELAMARDAL _dalhr_pelamar_DAL = null;
        Hashtable     _htParameters      = null;

        try
        {
            //System.Diagnostics.Debugger.Break();

            _dalhr_pelamar_DAL = new HR_PELAMARDAL();
            _htParameters      = new Hashtable();

            _htParameters["p_ID"] = Request.Params["id"];
            DataTable _dt = _dalhr_pelamar_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);
        }
    }