Exemplo n.º 1
0
    /// <summary>
    /// When MRF is approved its status is changed and comment is saved
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSaveApprove_Click(object sender, EventArgs e)
    {
        try
        {
            //Assign the session value to object
            mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDETAIL_APPREJMRF];
            //Assign the reason of approval to object
            mrfDetail.CommentReason = txtComment.Text.ToString();
            //set the MRF status to Closed
            mrfDetail.Status = Common.CommonConstants.MRFStatus_Closed;

            //concurrency check STRAT Mahendra Issue 33860
            Rave.HR.BusinessLayer.MRF.MRFDetail objMRFDetails = new Rave.HR.BusinessLayer.MRF.MRFDetail();
            DataSet dsMRFAllocated = objMRFDetails.checkConcurrencyResourceAllocation(mrfDetail);
            // Rajan Kumar : Issue 46252: 12/02/2014 : Starts
            // Desc : In MRF history need to implemented in all cases in RMS.
            //Pass Email to know who is going to modified the data
            AuthorizationManager authoriseduser = new AuthorizationManager();
            mrfDetail.LoggedInUserEmail = authoriseduser.getLoggedInUserEmailId();
            // Rajan Kumar : Issue 46252: 12/02/2014 : END


            if (dsMRFAllocated != null && dsMRFAllocated.Tables[0].Rows.Count == 0)
            {
                //concurrency check END Mahendra Issue 33860

                //Approve the MRF
                SetReasonOfApproveRejectMRF();

                ApprovalMail();
            }
            /*MRF Closure mail should not be sent as discussed on 21/01/2010 with sawita*/
            //MrfClosedMail();

            pnlApprove.Visible = false;

            lblMandatory.Visible           = false;
            lblConfirmationMessage.Visible = true;
            lblConfirmationMessage.Text    = CommonConstants.MSG_APPROVAL_OF_FINANCE;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "btnSaveApprove_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }