示例#1
0
    private void SaveData()
    {
        reff_jenis_usahaDAL _dalreff_jenis_usahaDAL = null;
        Hashtable           _htParameters           = null;
        int iNextID = 0;

        try
        {
            _dalreff_jenis_usahaDAL = new reff_jenis_usahaDAL();
            _htParameters           = new Hashtable();

            MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters);
            Utility.ApplyDefaultProp(_htParameters);

            if (Request.Params["action"] == "add")
            {
                _dalreff_jenis_usahaDAL.Insert(_htParameters, ref iNextID);
            }
            else
            {
                _dalreff_jenis_usahaDAL.Update(_htParameters);
                iNextID = Int32.Parse(lblid.Text);
            }

            Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "jenusahadtl.aspx?action=edt&id=" + iNextID.ToString());
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null);
        }
    }
示例#2
0
    protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Edit":
            Response.Redirect("jenusahadtl.aspx?action=edt&id=" + e.CommandArgument);
            break;

        case "Delete":
            reff_jenis_usahaDAL _dalreff_jenis_usahaDAL = null;
            Hashtable           _htParameters           = null;

            try
            {
                _dalreff_jenis_usahaDAL = new reff_jenis_usahaDAL();
                _htParameters           = new Hashtable();

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

                _dalreff_jenis_usahaDAL.Delete(_htParameters);
                this.BindGrid();
                Response.Redirect("jenusahalst.aspx");
            }
            catch (Exception ex)
            {
                Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
            }
            break;
        }
    }
示例#3
0
    private void BindGrid()
    {
        reff_jenis_usahaDAL _dalreff_jenis_usahaDAL = null;
        Hashtable           _htParameters           = null;

        try
        {
            _dalreff_jenis_usahaDAL = new reff_jenis_usahaDAL();
            _htParameters           = new Hashtable();

            _htParameters["p_keywords"] = txtSearch.Text;

            gvwList.DataSource = _dalreff_jenis_usahaDAL.GetRows(_htParameters);
            gvwList.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
示例#4
0
    private void LoadData()
    {
        reff_jenis_usahaDAL _dalreff_jenis_usahaDAL = null;
        Hashtable           _htParameters           = null;

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

            _dalreff_jenis_usahaDAL = new reff_jenis_usahaDAL();
            _htParameters           = new Hashtable();

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