示例#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
    protected void gvwList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Edit":
            Response.Redirect("exclaimdtl.aspx?action=edt&id=" + e.CommandArgument);
            break;

        case "Delete":
            EmpExclaimDAL _dalEmpExclaim = null;
            Hashtable     _htParameters  = null;

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

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

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

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

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

            gvwList.DataSource = _dalEmpExclaim.GetRows(_htParameters);
            gvwList.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
    private void Reject_Claim(GridView grv, string TabKe)
    {
        mdlPopupRejectValidate.Hide();
        if (approvemtd(txtPasswordReject.Text) == 1)
        {
            int           adaData           = 0;
            EmpExclaimDAL _dalEmpExclaimDAL = new EmpExclaimDAL();
            Hashtable     _htParameters     = new Hashtable();

            foreach (GridViewRow row in grv.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chb = (CheckBox)row.Cells[1].Controls[1];
                    if (chb.Checked)
                    {
                        try
                        {
                            _htParameters.Clear();

                            _htParameters["p_id"]            = Int32.Parse(grv.DataKeys[row.RowIndex][0].ToString());
                            _htParameters["p_Employee_Code"] = lblEmployee_Code.Text;
                            _dalEmpExclaimDAL.Reject(_htParameters);
                            adaData = +1;
                        }
                        catch (Exception ex)
                        {
                            Utility.ShowMessageBox(this, Utility.REJECT_DATA_FAIL_MESSAGE, ex, null);
                        }
                    }
                }
            }
            if (adaData > 0)
            {
                Utility.ShowMessageBox(this, Utility.REJECT_DATA_SUCCESS_MESSAGE, null, "appexclaimlst.aspx?action=edt&page=" + TabKe + "&id=" + Request.Params["id"]);
            }
        }
        else
        {
            Utility.ShowMessageBox(this, "Wrong Password, or unauthorized user", null, null);
            mdlPopupRejectValidate.Hide();
        }
    }
    private void BindGridRejected()
    {
        EmpExclaimDAL _dalEmpExclaim = null;
        Hashtable     _htParameters  = null;

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

            _htParameters["p_keywords"]      = txtSearchRejected.Text;
            _htParameters["p_status"]        = "9";
            _htParameters["p_Employee_Code"] = lblEmployee_Code.Text;

            gvwListRejected.DataSource = _dalEmpExclaim.GetRowsApproval(_htParameters);
            gvwListRejected.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
示例#6
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);
        }
    }
示例#7
0
    private void SaveData()
    {
        EmpExclaimDAL _dalEmpExclaimDAL = null;
        Hashtable     _htParameters     = null;
        int           iNextID           = 0;

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

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


            if (Request.Params["action"] == "edt")
            {
                string abc = lbl_ID.Text;
                _htParameters["p_TotalClaimAmount"] = grvExpenseClaimDetail.FooterRow.Cells[15].Text;
                _dalEmpExclaimDAL.Update(_htParameters);
                iNextID = Int32.Parse(lbl_ID.Text);
            }
            else
            {
                _htParameters["p_Employee_Code"]    = txtEmployee_Code.Text;
                _htParameters["p_TotalClaimAmount"] = 0;
                _dalEmpExclaimDAL.Insert(_htParameters, ref iNextID);
            }

            Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "exclaimdtl.aspx?action=edt&id=" + iNextID.ToString());
            //Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "Emppermitdtl.aspx?action=edt&id=" + iNextID.ToString());
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
示例#8
0
    public void btnMail_Click(object sender, EventArgs e)
    {
        EmpExclaimDAL _dalEmpExclaimDAL = new EmpExclaimDAL();
        Hashtable     _htParameters     = new Hashtable();

        foreach (GridViewRow row in gvwList.Rows)
        {
            if (row.RowType == DataControlRowType.DataRow)
            {
                CheckBox chb = (CheckBox)row.Cells[1].Controls[1];
                if (chb.Checked)
                {
                    try
                    {
                        _htParameters.Clear();
                        _htParameters["p_ID"]  = Int32.Parse(gvwList.DataKeys[row.RowIndex][0].ToString());
                        _htParameters["p_ACT"] = "EXC";
                        Utility.ApplyDefaultProp(_htParameters);
                        if (row.Cells[8].Text != "Send")
                        {
                            _dalEmpExclaimDAL.Mail(_htParameters);
                            Utility.ShowMessageBox(this, Utility.MAIL_SENDING_SUCCESS_MESSAGE, null, "exclaimlst.aspx");
                        }
                        else
                        {
                            Utility.ShowMessageBoxAnas(this, "Tidak dapat mengirim, <br>Status email saat ini sudah terkirim [send]", "Gagal");
                        }
                    }
                    catch (Exception ex)
                    {
                        Utility.ShowMessageBox(this, Utility.MAIL_SENDING_FAIL_MESSAGE, ex, null);
                    }
                }
            }
        }
    }