private void PopulateData()
    {
        try
        {
            Rave.HR.BusinessLayer.MRF.MRFDetail MrfBL   = new Rave.HR.BusinessLayer.MRF.MRFDetail();
            BusinessEntities.RaveHRCollection   collObj = new BusinessEntities.RaveHRCollection();

            string SkillName = string.Empty;
            if (!string.IsNullOrEmpty(txtSkillsName.Text))
            {
                SkillName = txtSkillsName.Text;
            }
            else
            {
                SkillName = "";
            }

            collObj = MrfBL.GetSkillsList(SkillName);


            grdvListofSkill.DataSource = collObj;
            grdvListofSkill.DataBind();
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "PopulateData", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #2
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);
        }
    }
    //Siddharth 27 March 2015 Start
    private void GetMRFAging(string SortExpressionAndDirection)
    {
        Rave.HR.BusinessLayer.MRF.MRFDetail MRFAgingBL = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        try
        {
            DataSet ds = new DataSet();
            ds = MRFAgingBL.GetMRFAging(SortExpressionAndDirection);

            if (ds.Tables[0].Rows.Count != CommonConstants.ZERO)
            {
                btnExport.Visible = true;

                GVMRFAgingReport.DataSource    = ds.Tables[0];
                Session["MRFAgingReportCount"] = Convert.ToInt32(ds.Tables[0].Rows.Count);
                GVMRFAgingReport.DataBind();
            }
            else
            {
                btnExport.Visible = false;
                ShowHeaderWhenEmptyGrid(ds);
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetMRFAging", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #4
0
    /// <summary>
    /// Fills the Project Name dropdown
    /// </summary>
    private void FillProjectNameDropDown()
    {
        // Initialise Collection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        // Initialise Business layer object
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfProjectName = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        try
        {
            // Call the Business layer method
            raveHRCollection = mrfProjectName.GetProjectName();

            DataSet dsProject = null;
            Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
            dsProject = fourCBAL.GetProjectNameAddCreatorReviewer();

            if (raveHRCollection != null)
            {
                // Assign the data source to dropdown

                ddlProject.DataSource = dsProject;

                //ddlProject.DataTextField = CommonConstants.DDL_DataTextField;
                //ddlProject.DataValueField = CommonConstants.DDL_DataValueField;
                ddlProject.DataTextField  = dsProject.Tables[0].Columns[1].ToString();
                ddlProject.DataValueField = dsProject.Tables[0].Columns[0].ToString();


                // Bind the data to dropdown
                ddlProject.DataBind();

                // Default value of dropdown is "Select"
                ddlProject.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);


                ddlProjectNameFilter.DataSource     = raveHRCollection;
                ddlProjectNameFilter.DataTextField  = CommonConstants.DDL_DataTextField;
                ddlProjectNameFilter.DataValueField = CommonConstants.DDL_DataValueField;

                // Bind the data to dropdown
                ddlProjectNameFilter.DataBind();
                // Default value of dropdown is "Select"
                ddlProjectNameFilter.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

                ddlProjectNameFilter.Enabled = false;
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "FillProjectNameDropDown", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Example #5
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);
        }
    }
Example #6
0
    /// <summary>
    /// btnOk_Click Event Handler
    /// </summary>
    protected void btnOk_Click(object sender, EventArgs e)
    {
        try
        {
            int         selected = (int)ViewState[SELECTED_ROW];
            GridViewRow dr       = grdvListofInternalResource.Rows[selected];
            if (Session[SessionNames.MRFDetail] != null)
            {
                mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
                Label lblEmpId = (Label)dr.Cells[0].FindControl("lblEmployeeId");
                mrfDetail.EmployeeId   = Convert.ToInt32(lblEmpId.Text);
                mrfDetail.EmployeeName = dr.Cells[2].Text.ToString();

                Rave.HR.BusinessLayer.MRF.MRFDetail objMrfDetail = new Rave.HR.BusinessLayer.MRF.MRFDetail();
                int EmpExist = objMrfDetail.GetEmployeeExistCheck(mrfDetail);
                if (EmpExist != 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "SelectAnotherResourceJS",
                                                            "alert('Please Select another resource as " + mrfDetail.EmployeeName + " is already allocated to this project.');", true);
                }
                else
                {
                    Session[SessionNames.MRFDetail]        = mrfDetail;
                    Session[SessionNames.InternalResource] = mrfDetail;
                    //Aarohi : Issue 31826 : 16/12/2011 : Start
                    Session[SessionNames.RESOURCE_JOINED] = mrfDetail.EmployeeName;

                    HiddenField hdJoinigDate = (HiddenField)dr.Cells[0].FindControl("hdEmpJoinigDay");
                    mrfDetail.EmployeeJoiningDate = Convert.ToDateTime(hdJoinigDate.Value);

                    //Aarohi : Issue 31826 : 16/12/2011 : End
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "CloseJS",
                                                            "jQuery.modalDialog.getCurrent().close();", true);
                }
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "btnOk_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #7
0
    /// <summary>
    /// Gets the MRF which are to be displayed in the grid
    /// </summary>
    /// <returns>Collection</returns>
    private BusinessEntities.RaveHRCollection GetApproveRejectMrf()
    {
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfSummaryBL     = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        BusinessEntities.MRFDetail          mrfDetail        = new BusinessEntities.MRFDetail();
        BusinessEntities.RaveHRCollection   raveHRCollection = new BusinessEntities.RaveHRCollection();


        try
        {
            if (gvPendingApprovalOfMrf.BottomPagerRow != null)
            {
                GridViewRow gvrPager = gvPendingApprovalOfMrf.BottomPagerRow;
                TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl("txtPages");
                if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0)
                {
                    objParameter.PageNumber = int.Parse(txtPages.Text);
                    objParameter.PageSize   = 10;
                }
            }
            else
            {
                objParameter.PageNumber = 1;
                objParameter.PageSize   = 10;
            }

            raveHRCollection = mrfSummaryBL.GetApproveRejectMrf(objParameter, ref pageCount);

            Session[SessionNames.PAGE_COUNT_APPREJMRF] = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "GetApproveRejectMrf", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }

        return(raveHRCollection);
    }
Example #8
0
    /// <summary>
    /// Mail for Rejection of MRF
    /// </summary>
    private void RejectionMail()
    {
        mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDETAIL_APPREJMRF];
        BusinessEntities.MRFDetail          mailDetail   = new BusinessEntities.MRFDetail();
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfSummaryBL = new Rave.HR.BusinessLayer.MRF.MRFDetail();

        mailDetail = mrfSummaryBL.GetMailingDetailsOfFunctionalManagerAndReportingTo(mrfDetail);

        //mailDetail = mrfSummaryBL.GetMailingDetails(mrfDetail);
        RaisedByEmailId = mailDetail.RaisedBy;

        if (mrfDetail != null)
        {
            #region Code For New MailFunctionality

            Rave.HR.BusinessLayer.MRF.MRFDetail objBLMRF = new Rave.HR.BusinessLayer.MRF.MRFDetail();
            objBLMRF.SendMailToRPMForInternalResourceRejection(mrfDetail, mailDetail);

            #endregion Code For New MailFunctionality
        }
    }
Example #9
0
    /// <summary>
    /// Fill Recruitment Manager dropdown
    /// </summary>
    private void FillRecruitmentManagerDropDown()
    {
        // Initialise Collection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        // Initialise Business layer object
        Rave.HR.BusinessLayer.MRF.MRFDetail employeeNameBL = new Rave.HR.BusinessLayer.MRF.MRFDetail();

        try
        {
            raveHRCollection = employeeNameBL.GetRecruitmentManager();

            if (raveHRCollection != null)
            {
                // Assign the data source to dropdown
                ddlRecruitmentManager.DataSource = raveHRCollection;

                ddlRecruitmentManager.DataTextField  = CommonConstants.DDL_DataTextField;
                ddlRecruitmentManager.DataValueField = CommonConstants.DDL_DataValueField;

                // Bind the data to dropdown
                ddlRecruitmentManager.DataBind();

                // Default value of dropdown is "Select"
                ddlRecruitmentManager.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);
            }
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "FillRecruitmentManagerDropDown", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }
Example #10
0
    /// <summary>
    /// Raise the Head count for MRF
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            string mrfIdGroup = string.Empty;
            //Get the Recruitment Manager Id
            string recruitmentManagerId = ddlRecruitmentManager.SelectedValue;
            //Aarohi : Issue 30885 : 14/12/2011 : Start
            if ((Session[SessionNames.PURPOSE] != null) && (ddlPurpose.SelectedValue == Convert.ToString((int)Common.MasterEnum.MRFPurpose.Replacement)) || (ddlPurpose.SelectedValue == Convert.ToString((int)Common.MasterEnum.MRFPurpose.SubstituteForMaternityLeave)))
            {
                //Issue Id : 34331 START : Mahendra
                //commented following and added new code to map Arraylist elements
                //txtPurpose.Text = Session[SessionNames.PURPOSE].ToString();
                System.Collections.ArrayList name = (System.Collections.ArrayList)Session[SessionNames.PURPOSE];
                foreach (var item in name)
                {
                    txtPurpose.Text = item.ToString();
                }
                //Issue Id : 34331 END
            }
            //Aarohi : Issue 30885 : 14/12/2011 : End

            //On Click, Change the status of respetive MRF
            if (recruitmentManagerId != CommonConstants.SELECT)
            {
                BusinessEntities.MRFDetail          mrfDetail = new BusinessEntities.MRFDetail();
                Rave.HR.BusinessLayer.MRF.MRFDetail objMrf    = new Rave.HR.BusinessLayer.MRF.MRFDetail();

                //Check if wheather any need of approval of head count.means approver id for this deprtment is 0.
                string mailTo = GetEmailIdForDeptWiseHeadCountApprovalMailTo(hidDepartment.Value);

                //if no approver id found then directly goes for pending external allocation.
                //For Rave consultant department no approval is required.mail is directly sent to Recruiment.
                if (string.IsNullOrEmpty(mailTo))
                {
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingExternalAllocation;
                }
                else
                {
                    //Sent For Finance to approve the head count.
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingHeadCountApprovalOfFinance;

                    //Goes for head count approval & make status Peding Approval Of HeadCount.
                    // mrfDetail.Status = CommonConstants.MRFStatus_PedingApprovalOfHeadCount;
                }
                mrfDetail.EmployeeId          = int.Parse(recruitmentManagerId);
                mrfDetail.ExpectedClosureDate = txtTargetDate.Text;
                mrfDetail.RecruitmentManager  = ddlRecruitmentManager.SelectedItem.Text;
                mrfDetail.MRFCode             = hidMrfCode.Value;
                mrfDetail.ProjectName         = txtProjectName.Text;
                mrfDetail.DepartmentName      = hidDepartment.Value;
                mrfDetail.Role = txtRole.Text;
                mrfDetail.ExpectedClosureDate = txtTargetDate.Text;
                mrfDetail.RecruitersId        = ddlRecruitmentManager.SelectedValue;
                // 57877-Venkatesh-  29042016 : Start
                // Add sai email if while raising headcount for nis projects
                if (HfldProjectId.Value != "SELECT")
                {
                    mrfDetail.ProjectId = Convert.ToInt32(HfldProjectId.Value);
                }
                // 57877-Venkatesh-  29042016 : End
                //Adding Purpose and PurposeDescription fileds

                if (ddlPurpose.SelectedItem.Text != Common.CommonConstants.SELECT)
                {
                    mrfDetail.MRFPurposeId = Convert.ToInt32(ddlPurpose.SelectedValue);
                }
                else
                {
                    mrfDetail.MRFPurposeId = CommonConstants.ZERO;
                }

                if (mrfDetail.MRFPurposeId == Convert.ToInt32(MasterEnum.MRFPurpose.MarketResearchfeasibility))
                {
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingExternalAllocation;
                }

                if (txtPurpose.Visible == true && !string.IsNullOrEmpty(txtPurpose.Text))
                {
                    mrfDetail.MRFPurposeDescription = txtPurpose.Text.Trim();
                }
                if (ddlDepartment.Visible == true && ddlDepartment.SelectedIndex > 0)
                {
                    mrfDetail.MRFPurposeDescription = ddlDepartment.SelectedItem.Text;
                }

                // Rakesh -  Issue : 57942  to Set Dropdown Value to Object
                if (ddlPurpose.SelectedItem != null)
                {
                    mrfDetail.MRFPurpose = ddlPurpose.SelectedItem.Text;
                }
                //end

                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    mrfIdGroup = Session[SessionNames.MRFRaiseHeadCOuntGroup].ToString();
                }
                string[] newMrfId = mrfIdGroup.Split(',');

                // Rajan Kumar : Issue 46252: 10/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: 10/02/2014 : END



                //Rakesh : Actual vs Budget 06/06/2016 Begin
                if (!string.IsNullOrEmpty(ddlCostCode.SelectedValue) && ddlCostCode.SelectedValue != CommonConstants.SELECT)
                {
                    mrfDetail.CostCodeId = ddlCostCode.SelectedValue.CastToInt32();
                }
                //End


                //If Session is not null Means multiple values selected from pending allocation page.
                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    for (int i = 0; i < newMrfId.Length; i++)
                    {
                        bool isMailInGroup = false;
                        if (newMrfId.Length == 1)
                        {
                            isMailInGroup = true;
                        }

                        mrfDetail.MRFId = Convert.ToInt32(newMrfId[i]);

                        BusinessEntities.RaveHRCollection raveHRCollection = new RaveHRCollection();
                        raveHRCollection = objMrf.CopyMRFBL(Convert.ToInt32(newMrfId[i]));
                        foreach (BusinessEntities.MRFDetail currentMrfDetails in raveHRCollection)
                        {
                            mrfDetail.MRFCode = currentMrfDetails.MRFCode;
                        }


                        //update MRF Status
                        //Last parameter set to mail should not send for group. it would be in shot.
                        //for that code is written below.
                        objMrf.UpdateMrfStatus(mrfDetail, mailTo, newMrfId, isMailInGroup);
                    }

                    //For rave consultant send mail in one shot for all selected MRF.
                    if (string.IsNullOrEmpty(mailTo) && newMrfId.Length > 1)
                    {
                        objMrf.SendMailForRaiseHeadCountWithouApprovalInGroup(mrfDetail, newMrfId);
                    }
                }
                else
                {
                    mrfDetail.MRFId = int.Parse(hidMrfId.Value);
                    objMrf.UpdateMrfStatus(mrfDetail, mailTo, newMrfId, true);
                }

                Session[SessionNames.CONFIRMATION_MESSAGE] = "Request for head count is raised successfully, email notification is sent for approval.";
                Session[SessionNames.RAISE_HEAD_COUNT]     = "True";

                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    Session.Remove(SessionNames.MRFRaiseHeadCOuntGroup);
                    //Close the window
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "close", " window.opener.location.href='MrfPendingAllocation.aspx'; window.close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Starts
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "CloseJS", "jQuery.modalDialog.getCurrent().close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Ends
                }
                else
                {
                    //Umesh: Issue 'Modal Popup issue in chrome' Starts
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "CloseJS", "jQuery.modalDialog.getCurrent().close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Ends
                }
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "btnOK_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #11
0
    protected void grdvCreatorApprover_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        lblMessage.Visible = false;



        if (e.CommandName == "Edt")
        {
            GridViewRow row            = (GridViewRow)((Control)e.CommandSource).NamingContainer;
            HiddenField HfProjectId    = (HiddenField)row.FindControl("hfProjectId");
            HiddenField HfDepartmentId = (HiddenField)row.FindControl("HfDepartmentId");
            HiddenField HfCreatorGrd   = (HiddenField)row.FindControl("HfCreatorGrd");
            HiddenField HfReviewerGrd  = (HiddenField)row.FindControl("HfReviewerGrd");

            btnAdd.Enabled    = false;
            btnUpdate.Enabled = true;

            HfCreator.Value  = HfCreatorGrd.Value;
            HfReviewer.Value = HfReviewerGrd.Value;

            txtCreator.Text  = row.Cells[2].Text;
            txtReviewer.Text = row.Cells[3].Text;

            //Declaring COllection class object
            BusinessEntities.RaveHRCollection   raveHRCollection = new BusinessEntities.RaveHRCollection();
            Rave.HR.BusinessLayer.Common.Master master           = new Rave.HR.BusinessLayer.Common.Master();
            raveHRCollection = master.FillDepartmentDropDownBL();

            ddlDepartment.Items.Clear();
            ddlDepartment.DataSource     = raveHRCollection;
            ddlDepartment.DataTextField  = Common.CommonConstants.DDL_DataTextField;
            ddlDepartment.DataValueField = Common.CommonConstants.DDL_DataValueField;
            ddlDepartment.DataBind();
            ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);


            ddlDepartment.SelectedValue = HfDepartmentId.Value;

            if (HfDepartmentId.Value == "1")
            {
                ddlProject.Enabled = true;

                Rave.HR.BusinessLayer.MRF.MRFDetail mrfProjectName = new Rave.HR.BusinessLayer.MRF.MRFDetail();
                raveHRCollection = mrfProjectName.GetProjectName();

                ddlProject.Items.Clear();
                ddlProject.DataSource     = raveHRCollection;
                ddlProject.DataTextField  = CommonConstants.DDL_DataTextField;
                ddlProject.DataValueField = CommonConstants.DDL_DataValueField;

                // Bind the data to dropdown
                ddlProject.DataBind();
                // Default value of dropdown is "Select"
                ddlProject.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);


                if (!string.IsNullOrEmpty(HfProjectId.Value))
                {
                    ddlProject.SelectedValue = HfProjectId.Value;
                }
            }
            else
            {
                ddlProject.SelectedItem.Text = "SELECT";
            }

            ddlDepartment.Enabled = false;
            ddlProject.Enabled    = false;
        }
        else if (e.CommandName == "Del")
        {
            try
            {
                if (rblAdminSelectionOption.SelectedIndex == 0)
                {
                    GridViewRow row            = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    HiddenField HfProjectId    = (HiddenField)row.FindControl("hfProjectId");
                    HiddenField HfDepartmentId = (HiddenField)row.FindControl("HfDepartmentId");
                    HiddenField HfCreatorGrd   = (HiddenField)row.FindControl("HfCreatorGrd");
                    HiddenField HfReviewerGrd  = (HiddenField)row.FindControl("HfReviewerGrd");


                    Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
                    int depId  = int.Parse(HfDepartmentId.Value);
                    int projId = 0;

                    if (depId == 1)
                    {
                        projId = int.Parse(HfProjectId.Value);
                    }


                    fourCBAL.AddUpdateDeleteCreatorReviewer(depId, projId, HfCreator.Value, HfReviewer.Value, UserMailId, "Delete");
                    FillCreatorApproverData();

                    ClearControl();

                    lblMessage.Visible        = true;
                    lblMessage.Text           = "Data Deleted Successfully!!!.";
                    lblMessage.Style["color"] = "blue";
                }
                else
                {
                    GridViewRow   row          = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    HiddenField   HfCreatorGrd = (HiddenField)row.FindControl("HfCreatorGrd");
                    List <string> ls           = new List <string> {
                    };
                    ls.Add(HfCreatorGrd.Value);

                    if (ls.Count > 0 && !string.IsNullOrEmpty(HfCreatorGrd.Value))
                    {
                        Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
                        fourCBAL.AddDeleteViewAccessRights(ls, UserMailId, "Delete");

                        getEmployeeData();

                        lblMessage.Visible        = true;
                        lblMessage.Text           = "Data Added Successfully!!!.";
                        lblMessage.Style["color"] = "blue";
                    }
                }
            }
            catch (RaveHRException ex)
            {
                LogErrorMessage(ex);
            }
            catch (Exception ex)
            {
                RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvCreatorApprover_RowCommand", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
                LogErrorMessage(objEx);
            }
        }
    }
    /// <summary>
    /// Fills the Project Name dropdown
    /// </summary>
    private void FillProjectNameDropDown(List <string> lstRights, int loginEmpId)
    {
        // Initialise Collection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        // Initialise Business layer object
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfProjectName = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        try
        {
            DataSet dsProject = null;
            Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();

            if (lstRights.Any(o => o.ToString() == MasterEnum.FourCRole.FOURCADMIN.ToString()) || lstRights.Any(o => o.ToString() == MasterEnum.FourCRole.VIEWACCESSRIGHTS.ToString()))
            {
                // Call the Business layer method
                //raveHRCollection = mrfProjectName.GetProjectName();
                dsProject = fourCBAL.GetProjectName();
            }
            else
            {
                dsProject = fourCBAL.GetFunctionalManagerProjectName(int.Parse(ViewState["LoginEmpId"].ToString()));
            }


            if (raveHRCollection != null)
            {
                // Assign the data source to dropdown
                ddlProjectList.Items.Clear();
                ddlProjectList.DataSource = dsProject;

                //ddlProjectList.DataTextField = CommonConstants.DDL_DataTextField;
                // ddlProjectList.DataValueField = CommonConstants.DDL_DataValueField;

                ddlProjectList.DataTextField  = dsProject.Tables[0].Columns[1].ToString();
                ddlProjectList.DataValueField = dsProject.Tables[0].Columns[0].ToString();

                // Bind the data to dropdown
                ddlProjectList.DataBind();

                // Default value of dropdown is "Select"
                //ddlProjectList.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);
                ddlProjectList.Items.Insert(0, new ListItem(CommonConstants.SELECT, CommonConstants.ZERO.ToString()));
                ddlProjectList.Items.Add(new ListItem(CommonConstants.BENCH_PROJECT, CommonConstants.BENCH_VALUE.ToString()));
                //ddlProjectList.Items.Add(new ListItem(CommonConstants.SELECT, CommonConstants.ZERO.ToString()));

                //DateTime monthYear = DateTime.Parse(string.Concat("01 ", lblDate.Text));

                //List<string> lst = (List<string>)ViewState["FourCEmpRole"];
                ////If login person is not admin then by default one project get selected
                ////if ((ViewState["FourCRole"].ToString() != MasterEnum.FourCRole.FOURCADMIN.ToString()) && (lst.Any(o => o.ToString() != MasterEnum.FourCRole.CREATORANDREVIEWER.ToString()) && lst.Any(o => o.ToString() == MasterEnum.FourCRole.CREATOR.ToString())))
                //if (lst.Any(o => o.ToString() == MasterEnum.FourCRole.CREATOR.ToString()) && string.IsNullOrEmpty(ViewState["AllowDirectSubmit"].ToString()))
                //{
                //    ddlProjectList.SelectedIndex = 1;
                //    BindProjectData(int.Parse(ddlProjectList.SelectedItem.Value), monthYear.Month, monthYear.Year, ViewState["FourCRole"].ToString());
                //}
                //else
                //{
                //    BindProjectData(int.Parse(ddlProjectList.SelectedItem.Value), monthYear.Month, monthYear.Year, ViewState["FourCRole"].ToString());
                //}

                ddlProjectList.Enabled = false;
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "FillProjectNameDropDown", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Example #13
0
    /// <summary>
    /// Mail for Approval
    /// </summary>
    private void ApprovalMail()
    {
        mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDETAIL_APPREJMRF];
        BusinessEntities.MRFDetail          mailDetail   = new BusinessEntities.MRFDetail();
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfSummaryBL = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        mailDetail      = mrfSummaryBL.GetMailingDetails(mrfDetail);
        EmployeeEmailId = mailDetail.EmailId;
        RaisedByEmailId = mailDetail.RaisedBy;
        int[]   IDs;
        Boolean B_ClientName = false;
        string  ClientName   = string.Empty;

        //Added by Kanchan for the requirment specified in the Discussion with Sawita Kamath and Gaurav Thakkar.
        // Requirment raised: When a mrf is approved the approval mail should go to the reporting to.
        if (mailDetail.ReportingToId != null)
        {
            if (mailDetail.ReportingToId.Contains(","))
            {
                // countOfReportingTo = mailDetail.ReportingToId.LastIndexOf(",");
                string[] allReportingTo;
                allReportingTo     = mailDetail.ReportingToId.Split(',');
                countOfReportingTo = allReportingTo.Length;
                IDs = new int[countOfReportingTo];
                ReportingToByEmailId_PM = new string[countOfReportingTo];

                for (int i = 0; i < countOfReportingTo; i++)
                {
                    IDs[i] = Convert.ToInt32(allReportingTo[i].ToString());
                    ReportingToByEmailId_PM[i] = getMailID(IDs[i]);
                }
            }
            else
            {
                ReportingToByEmailId = getMailID(Convert.ToInt32(mailDetail.ReportingToId));
            }
            raveHRCollection = new BusinessEntities.RaveHRCollection();

            raveHRCollection = mrfSummaryBL.GetProjectManagerByProjectId(mailDetail);
            BusinessEntities.MRFDetail forPm = new BusinessEntities.MRFDetail();
            string Mail = string.Empty;
            MailPM = string.Empty;
            foreach (BusinessEntities.MRFDetail mrf in raveHRCollection)
            {
                Mail  = string.Empty;
                forPm = (BusinessEntities.MRFDetail)raveHRCollection.Item(0);
                if (!forPm.PmID.Contains(","))
                {
                    Mail = getMailID(Convert.ToInt32(forPm.EmployeeId));
                }
                else
                {
                    string[] MailsForPm = forPm.PmID.Split(',');
                    foreach (string id in MailsForPm)
                    {
                        Mail += getMailID(Convert.ToInt32(id)) + ",";
                    }
                }
                MailPM += "," + Mail;
                if (MailPM.EndsWith(","))
                {
                    MailPM = MailPM.TrimEnd(',');
                }
            }
        }

        //Siddharth 26-02-2015 Start
        ClientName = mrfDetail.ClientName;
        if (ClientName.ToUpper().Contains("NPS") || ClientName.ToUpper().Contains("NORTHGATE"))
        {
            B_ClientName = true;
        }
        //Siddharth 26-02-2015 End

        #region Coded By Sameer For New MailFunctionality

        Rave.HR.BusinessLayer.MRF.MRFDetail objBLMRF = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        objBLMRF.SendMailToWhizibleForInternalResourceAllocation(mrfDetail, mailDetail, B_ClientName);

        #endregion Coded By Sameer For New MailFunctionality
    }