Example #1
0
    /// <summary>
    /// Get the Email ID of head count approver by department name for sending to approve mail.
    /// </summary>
    /// <param name="DepartmentName"></param>
    /// <returns></returns>
    private string GetEmailIdForDeptWiseHeadCountApprovalMailTo(string DepartmentName)
    {
        string mailTo = string.Empty;

        try
        {
            Rave.HR.BusinessLayer.MRF.MRFDetail MRFDetailsBL  = new Rave.HR.BusinessLayer.MRF.MRFDetail();
            List <BusinessEntities.MRFDetail>   listMRFDetail = new List <BusinessEntities.MRFDetail>();

            //Get all the data of department wise approver.
            listMRFDetail = MRFDetailsBL.GetEmailIdForHeadCountApproval();
            foreach (BusinessEntities.MRFDetail itemMRF in listMRFDetail)
            {
                //Check whether department name is same then assign approver email id to mailto.
                if (itemMRF.DepartmentName == DepartmentName)
                {
                    //mail should sent only to high priority person, not to all approver of department.
                    //we can give rights to multiple resource bt mail should go to only one.
                    mailTo = itemMRF.EmailId;
                    break;
                }
            }
            return(mailTo);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "GetEmailIdForMailTo", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }