示例#1
0
    private void LoadData()
    {
        EmpExclaimDAL _dalEmpExclaimDAL = null;
        Hashtable     _htParameters     = null;

        try
        {
            //System.Diagnostics.Debugger.Break();
            //ddlSPD_Code.SelectedValue = SessionKey.CURRENT_USER_HRMS_EMP_CODE.ToString();
            txtTrx_Date.Text = Utility.CurrentDate;
            //GET ROLE Response.Write(Session[SessionKey.CURRENT_USER_HRMS_ROLE]);

            _dalEmpExclaimDAL = new EmpExclaimDAL();
            _htParameters     = new Hashtable();

            if (Request.Params["action"] == "edt")
            {
                _htParameters["p_ID"] = Request.Params["id"];
                pnlshow.Visible       = true;
                panelDetail.Visible   = false;
                DataTable _dt = _dalEmpExclaimDAL.GetRow(_htParameters);
                MPF23.Shared.Mapper.DBToUI.Map(pnlBody.Controls, _dt.Rows[0]);
                BindGridClaim();
                if (ddlStatus.SelectedValue == "0")
                {
                    btnSave.Visible = true;
                    btnAddExpenseClaimDetail.Visible = true;
                    grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 1].Visible = true;
                    grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 2].Visible = true;
                }
                else
                {
                    if (ddlStatus.SelectedValue == "1" && Session[SessionKey.CURRENT_USER_HRMS_ROLE].ToString() == "2")
                    {
                        btnSave.Visible = true;
                        btnAddExpenseClaimDetail.Visible = true;
                        grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 1].Visible = true;
                        grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 2].Visible = true;
                    }
                    else
                    {
                        btnSave.Visible = false;
                        btnAddExpenseClaimDetail.Visible = false;
                        grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 1].Visible = false;
                        grvExpenseClaimDetail.Columns[grvExpenseClaimDetail.Rows[0].Cells.Count - 2].Visible = false;
                    }
                }
            }
            else
            {
                pnlshow.Visible = false;
                //txtEmployee_Code.Text = Session[SessionKey.CURRENT_USER_HRMS_EMP_CODE].ToString().Trim();
                //txtEmployee_Name.Text = Session[SessionKey.CURRENT_USER_HRMS_EMP_NAME].ToString().Trim();
            }
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
        }
    }
示例#2
0
    private void LoadData()
    {
        EmpExclaimDAL _dalEmpExclaimDAL = null;
        Hashtable     _htParameters     = null;

        try
        {
            _dalEmpExclaimDAL = new EmpExclaimDAL();
            _htParameters     = new Hashtable();

            if (Request.Params["action"] == "edt")
            {
                _htParameters["p_ID"] = Request.Params["id"];
                DataTable _dt = _dalEmpExclaimDAL.GetRow(_htParameters);
                MPF23.Shared.Mapper.DBToUI.Map(pnlBody.Controls, _dt.Rows[0]);
                BindGridClaim();
            }
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null);
        }
    }