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 lbl = (Label)dr.Cells[0].FindControl("lbl");
                mrfDetail.EmployeeId                   = Convert.ToInt32(lbl.Text);
                mrfDetail.EmployeeName                 = dr.Cells[2].Text.ToString();
                Session[SessionNames.MRFDetail]        = mrfDetail;
                Session[SessionNames.InternalResource] = mrfDetail;
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), "close", "window.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 #2
0
    protected void btnSaveApprove_Click(object sender, EventArgs e)
    {
        try
        {
            mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDetail];
            mrfDetail.CommentReason = txtComment.Text.ToString();
            mrfDetail.IsApproved    = true;
            string ConfirmMasg = string.Empty;

            //Get logged in user email Id.
            string userEmailId = objAuMan.getLoggedInUserEmailId();
            //Get Head Count approver EmailId.
            string ApproverMailId = GetEmailIdForDeptWiseHeadCountApprovalMailTo(mrfDetail.DepartmentName);
            // 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
            mrfDetail.LoggedInUserEmail = userEmailId;
            // Rajan Kumar : Issue 46252: 10/02/2014 : END
            SetReasonOfApproveRejectMRF(ref ConfirmMasg);

            lblMessage.Text = ConfirmMasg;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, BTN_SAVEAPPROVE_CLICK, EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #3
0
    /// <summary>
    /// Returns MRF Details whose status is pending allocation for GridView
    /// </summary>
    /// <returns>List</returns>
    private RaveHRCollection GetListOfInternalResource()
    {
        RaveHRCollection objListMRFDetails = new RaveHRCollection();

        try
        {
            if (Session[SessionNames.MRFDetail] != null)
            {
                mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
            }
            else
            {
                mrfDetail = new MRFDetail();
            }

            objParameterCriteria.PageSize = 10;
            objListMRFDetails             = Rave.HR.BusinessLayer.MRF.MRFDetail.GetMRFInternalResource(mrfDetail, txtResourceName.Text.Trim(), objParameterCriteria, ref pageCount);
            Session[PAGE_COUNT]           = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetListOfInternalResource", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
        return(objListMRFDetails);
    }
Example #4
0
    protected void btnSaveReject_Click(object sender, EventArgs e)
    {
        try
        {
            mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDetail];
            mrfDetail.CommentReason = txtReject.Text.ToString();
            //set the MRF status to Reject when head count Reject it.
            mrfDetail.Status     = Common.CommonConstants.MRFStatus_Rejected;
            mrfDetail.IsApproved = false;
            string ConfirmMsg = string.Empty;
            // 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
            SetReasonOfApproveRejectMRF(ref ConfirmMsg);

            lblMessage.Text = Common.CommonConstants.MSG_MRF_REJECTION_OF_HEADCOUNT;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, BTN_SAVE_REJECT_CLICK, EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Expires = 0;
     Response.Cache.SetNoStore();
     Response.AppendHeader("Pragma", "no-cache");
     if (!ValidateURL())
     {
         Response.Redirect(CommonConstants.INVALIDURL);
     }
     else
     {
         try
         {
             btnOk.Attributes.Add(CommonConstants.EVENT_ONCLICK, "return IsResourceSelected();");
             if (!IsPostBack)
             {
                 Session[CURRENT_PAGE_INDEX] = 1;
                 if (Session[PREVIOUS_SORT_EXPRESSION] == null)
                 {
                     sortExpression = RESOURCE_NAME;
                     Session[PREVIOUS_SORT_EXPRESSION] = sortExpression;
                 }
                 else
                 {
                     sortExpression = Session[PREVIOUS_SORT_EXPRESSION].ToString();
                 }
                 if (Session[SessionNames.MRFDetail] != null)
                 {
                     mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
                     if (mrfDetail.DepartmentId != 1)
                     {
                         //Fill drop down of department
                         FillDropDowns();
                     }
                     else
                     {
                         pnlDepartmentDropDown.Visible = false;
                         departmentID = 1;
                         //Bind the grid while Loading the page
                         BindGrid();
                     }
                 }
             }
         }
         //catches RaveHRException exception
         catch (RaveHRException ex)
         {
             LogErrorMessage(ex);
         }
         catch (Exception ex)
         {
             RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, PAGE_LOAD, EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
             LogErrorMessage(objEx);
         }
     }
 }
    /// <summary>
    /// Fill DropDown Method
    /// </summary>
    private void FillDropDown()
    {
        //Declaring Master Class Object
        Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master();
        try
        {
            BusinessEntities.MRFDetail mrfDetailobj = new BusinessEntities.MRFDetail();

            if (Session[SessionNames.MRFPREVIOUSVALUE] != null)
            {
                mrfDetailobj = (BusinessEntities.MRFDetail)Session[SessionNames.MRFPREVIOUSVALUE];
            }
            int testingDeparmentId = mrfDetailobj.DepartmentId;

            //Calling Business layer FillDropDown Method
            if (testingDeparmentId == (int)MasterEnum.MRFDepartment.Testing)
            {
                raveHRCollection = master.FillDropDownsBL(testingDeparmentId);
            }
            else
            {
                //Calling Business layer FillDropDown Method
                raveHRCollection = master.FillDropDownsBL(Convert.ToInt32(Common.EnumsConstants.Category.PrimarySkills));
            }

            //Check Collection is null or not
            if (raveHRCollection != null)
            {
                //Assign DataSOurce to Collection
                ddlSkillCategory.DataSource = raveHRCollection;

                //Assign DataText Filed to DropDown
                ddlSkillCategory.DataTextField = CommonConstants.DDL_DataTextField;

                //Assign DataValue Field to Dropdown
                ddlSkillCategory.DataValueField = CommonConstants.DDL_DataValueField;

                //Bind Dropdown
                ddlSkillCategory.DataBind();

                //Insert Select as a item for dropdown
                ddlSkillCategory.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

                raveHRCollection.Clear();
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer,
                                      CLASS_NAME_RAISEMRF_NEXT, "FillDropDown", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }
Example #7
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);
        }
    }
 /// <summary>
 /// Dropdown Selected Index Changed Event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ddlDepartment_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         departmentID                      = Convert.ToInt32(ddlDepartment.SelectedItem.Value);
         ViewState[DEPARTMENT]             = departmentID;
         sortExpression                    = RESOURCE_NAME;
         Session[PREVIOUS_SORT_EXPRESSION] = sortExpression;
         if (Session[SessionNames.MRFDetail] != null)
         {
             mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
         }
         else
         {
             mrfDetail = new MRFDetail();
         }
         if (departmentID == mrfDetail.DepartmentId)
         {
             grdvListofInternalResource.DataSource = objListSort;
             grdvListofInternalResource.DataBind();
             ShowHeaderWhenEmptyGrid(objListSort);
         }
         else if (departmentID != 1)
         {
             grdvListofInternalResource.Columns[3].Visible = false;
             grdvListofInternalResource.Columns[4].Visible = false;
             grdvListofInternalResource.Columns[5].Visible = false;
             grdvListofInternalResource.Columns[6].Visible = false;
             BindGrid();
         }
         else if (departmentID == 1)
         {
             grdvListofInternalResource.Columns[3].Visible = true;
             grdvListofInternalResource.Columns[4].Visible = true;
             grdvListofInternalResource.Columns[5].Visible = true;
             grdvListofInternalResource.Columns[6].Visible = true;
             BindGrid();
         }
     }
     catch (RaveHRException ex)
     {
         LogErrorMessage(ex);
     }
     catch (Exception ex)
     {
         RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "ddlDepartment_SelectedIndexChanged", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
         LogErrorMessage(objEx);
     }
 }
Example #9
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);
        }
    }
    /// <summary>
    /// Returns MRF Details whose status is pending allocation for GridView
    /// </summary>
    /// <returns>List</returns>
    private RaveHRCollection GetListOfInternalResource()
    {
        RaveHRCollection objListMRFDetails = new RaveHRCollection();

        try
        {
            if (grdvListofInternalResource.BottomPagerRow != null)
            {
                GridViewRow gvrPager = grdvListofInternalResource.BottomPagerRow;
                TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl(TXT_PAGES);
                if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0 && Convert.ToInt32(txtPages.Text) <= Convert.ToInt32(Session[PAGE_COUNT].ToString()))
                {
                    objParameterCriteria.PageNumber = int.Parse(txtPages.Text);
                }
            }
            else
            {
                objParameterCriteria.PageNumber = 1;
            }
            if (Session[SessionNames.MRFDetail] != null)
            {
                mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
            }
            else
            {
                mrfDetail = new MRFDetail();
            }
            if (ViewState[DEPARTMENT] != null)
            {
                departmentID = (int)ViewState[DEPARTMENT];
            }
            objParameterCriteria.PageSize = 10;
            objListMRFDetails             = Rave.HR.BusinessLayer.MRF.MRFDetail.GetListOfInternalResource(mrfDetail, departmentID, objParameterCriteria, ref pageCount);
            Session[PAGE_COUNT]           = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetListOfInternalResource", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
        return(objListMRFDetails);
    }
Example #11
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 #12
0
    /// <summary>
    /// When MRF is rejected its status is changed and comment is saved
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSaveReject_Click(object sender, EventArgs e)
    {
        try
        {
            //Assign the session value to object
            mrfDetail = (BusinessEntities.MRFDetail)Session[SessionNames.MRFDETAIL_APPREJMRF];
            //Assign the reason of rejection to object
            mrfDetail.CommentReason = txtReject.Text.ToString();
            //set the MRF status to Rejected
            mrfDetail.Status = Common.CommonConstants.MRFStatus_Rejected;

            // 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


            //Reject the MRF
            SetReasonOfApproveRejectMRF();

            RejectionMail();

            pnlReject.Visible = false;

            lblMandatory.Visible           = false;
            lblConfirmationMessage.Visible = true;
            lblConfirmationMessage.Text    = CommonConstants.MSG_REJECTION_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, "btnSaveReject_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #13
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
        }
    }
    /// <summary>
    /// Previous Button CLick
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPrevious_Click(object sender, EventArgs e)
    {
        try
        {
            BusinessEntities.MRFDetail mRfDetail = new BusinessEntities.MRFDetail();
            mRfDetail = GetControlValues();

            Server.Transfer("MrfRaisePrevious.aspx?" + URLHelper.SecureParameters("mode", Common.MasterEnum.PageMode.PREVIOUS.ToString()) + "&" + URLHelper.CreateSignature(Common.MasterEnum.PageMode.PREVIOUS.ToString()));
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (System.Threading.ThreadAbortException IException)
        {
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_RAISEMRF_NEXT, "btnPrevious_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #15
0
    /// <summary>
    /// When image of either "Approve","Reject" or "View" is clicked this event is captured and
    /// the command associated with it is executed.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvPendingApprovalOfMrf_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName != SORT)
            {
                GridView gridView = (GridView)sender;
                selectedIndex = int.Parse(e.CommandArgument.ToString());
                commandName   = e.CommandName;

                gvPendingApprovalOfMrf.SelectedIndex = selectedIndex;
                mrfDetail = new BusinessEntities.MRFDetail();

                GridViewRow gvRow                = gvPendingApprovalOfMrf.Rows[selectedIndex];
                Label       lbl                  = (Label)gvRow.Cells[0].FindControl("lblMrfId");
                Label       lblEmpId             = (Label)gvRow.FindControl("lblEMPId");
                Label       lblFunctionalManager = (Label)gvRow.FindControl("lblFunctionalManager");

                //Extract the MrfId and role From grid.
                //Role is extracted to check if role is PM/SPM/APM than it is handled in different manner.
                mrfDetail.MRFId             = Convert.ToInt32(lbl.Text);
                mrfDetail.MRFCode           = gvRow.Cells[1].Text;
                mrfDetail.EmployeeName      = gvRow.Cells[2].Text;
                mrfDetail.ResourceOnBoard   = DateTime.Parse(gvRow.Cells[3].Text);
                mrfDetail.DepartmentName    = gvRow.Cells[6].Text;
                mrfDetail.ProjectName       = gvRow.Cells[8].Text;
                mrfDetail.Role              = gvRow.Cells[10].Text;
                mrfDetail.EmployeeId        = Convert.ToInt32(lblEmpId.Text);
                mrfDetail.ClientName        = gvRow.Cells[9].Text;
                mrfDetail.FunctionalManager = lblFunctionalManager.Text;

                Session[SessionNames.MRFDETAIL_APPREJMRF] = mrfDetail;

                //Depending upon the comand, perform the action.
                switch (commandName)
                {
                case APPROVE:
                    pnlApprove.Visible = true;
                    pnlReject.Visible  = false;
                    txtComment.Focus();
                    //This line of code is added since on click of "Approve" the Sort image used to get disappear.
                    //The "If" condition check is made since for One record sort image is not required.
                    if (gvPendingApprovalOfMrf.Rows.Count > 1)
                    {
                        AddSortImage(gvPendingApprovalOfMrf.HeaderRow);
                    }
                    //Mandatory label is made visible.
                    lblMandatory.Visible = true;
                    break;

                case REJECT:
                    pnlApprove.Visible = false;
                    pnlReject.Visible  = true;
                    txtReject.Focus();
                    //This line of code is added since on click of "Reject" the Sort image used to get disappear.
                    //The "If" condition check is made since for One record sort image is not required.
                    if (gvPendingApprovalOfMrf.Rows.Count > 1)
                    {
                        AddSortImage(gvPendingApprovalOfMrf.HeaderRow);
                    }
                    //Mandatory label is made visible.
                    lblMandatory.Visible = true;
                    break;

                case VIEW:
                    string url = "MrfView.aspx?" + URLHelper.SecureParameters("MRFId", mrfDetail.MRFId.ToString()) + "&" + URLHelper.SecureParameters("index", gvRow.RowIndex.ToString()) + "&" + URLHelper.SecureParameters("pagetype", "APPREJFINANCE") + "&" + URLHelper.CreateSignature(mrfDetail.MRFId.ToString(), gvRow.RowIndex.ToString(), "APPREJFINANCE");
                    Response.Redirect(url, false);
                    //Server.Transfer(url);
                    break;
                }
            }
        }

        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "gvPendingApprovalOfMrf_RowCommand", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Example #16
0
    protected void grdvListofPendingApproveRejectHeadCount_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            // --Add sort image in header
            if (Session[PAGE_COUNT] != null)
            {
                if (int.Parse(Session[PAGE_COUNT].ToString()) == 1)
                {
                    AddSortImage(grdvListofPendingApproveRejectHeadCount.HeaderRow);
                }
            }
            if (e.CommandName != SORT)
            {
                if (e.CommandName == APPROVE || e.CommandName == REJECT || e.CommandName == VIEW)
                {
                    GridView _gridView = (GridView)sender;
                    // Get the selected index and the command name
                    int    _selectedIndex = int.Parse(e.CommandArgument.ToString());
                    string _commandName   = e.CommandName;
                    grdvListofPendingApproveRejectHeadCount.SelectedIndex = _selectedIndex;
                    mrfDetail = new BusinessEntities.MRFDetail();
                    GridViewRow dr  = grdvListofPendingApproveRejectHeadCount.Rows[_selectedIndex];
                    Label       lbl = (Label)dr.Cells[0].FindControl("lbl");
                    HiddenField hdfRecruitmentMgrEmailId = (HiddenField)dr.Cells[16].FindControl("hdfRecruiterEmailId");
                    HiddenField hdfMRFStatusId           = (HiddenField)dr.Cells[16].FindControl("hdfMRFStatusId");
                    HiddenField HfExpectedClosureDate    = (HiddenField)dr.Cells[16].FindControl("HfExpectedClosureDate");

                    mrfDetail.MRFId              = Convert.ToInt32(lbl.Text);
                    mrfDetail.MRFCode            = dr.Cells[1].Text.ToString();
                    mrfDetail.DepartmentName     = dr.Cells[5].Text.ToString();
                    mrfDetail.ProjectName        = dr.Cells[6].Text.ToString();
                    mrfDetail.Role               = dr.Cells[10].Text.ToString();
                    mrfDetail.RecruitmentManager = dr.Cells[13].Text.ToString();


                    //Recruiter Email Id.
                    mrfDetail.EmailId = hdfRecruitmentMgrEmailId.Value.ToString();
                    //current MRF status.
                    mrfDetail.StatusId            = Convert.ToInt32(hdfMRFStatusId.Value.ToString());
                    mrfDetail.ExpectedClosureDate = HfExpectedClosureDate.Value.ToString();

                    lblMessage.Text = "";
                    Session[SessionNames.MRFDetail] = mrfDetail;
                    switch (_commandName)
                    {
                    case (APPROVE):
                        pnlApprove.Visible = true;
                        pnlReject.Visible  = false;
                        break;

                    case (REJECT):
                        pnlReject.Visible  = true;
                        pnlApprove.Visible = false;
                        break;

                    case (VIEW):
                        string url = "MrfView.aspx?" + URLHelper.SecureParameters("MRFId", mrfDetail.MRFId.ToString()) + "&" + URLHelper.SecureParameters("index", dr.RowIndex.ToString()) + "&" + URLHelper.SecureParameters("pagetype", "APPREJHEADCOUNT") + "&" + URLHelper.CreateSignature(mrfDetail.MRFId.ToString(), dr.RowIndex.ToString(), "APPREJHEADCOUNT");
                        Response.Redirect(url, false);
                        //Server.Transfer(url);
                        break;
                    }
                }

                //mrfDetail.MRFId = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MRFId").ToString());
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, GRID_ROWCOMMAND, EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Javascript Function Call

        btnRaiseMRF.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ButtonClickValidate();");

        //Poonam : Issue : Disable Button : Starts
        btnRaiseMRF.OnClientClick = "if(ButtonClickValidate()){" + ClientScript.GetPostBackEventReference(btnRaiseMRF, null) + "}";
        //Poonam : Issue : Disable Button : Ends

        // btnRaiseMRF.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return checkExperience1();");
        // txtExperience1.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return checkExperience1();");

        txtMusthaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtMusthaveskill.ClientID + "','" + txtMusthaveskill.MaxLength + "','" + imgMusthaveskill.ClientID + "');");
        imgMusthaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanMusthaveskill.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgMusthaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanMusthaveskill.ClientID + "');");

        txtGoodtohaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtGoodtohaveskill.ClientID + "','" + txtGoodtohaveskill.MaxLength + "','" + imgGoodtohaveskill.ClientID + "');");
        imgGoodtohaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanGoodtohaveskill.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgGoodtohaveskill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanGoodtohaveskill.ClientID + "');");

        txtTools.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtTools.ClientID + "','" + txtTools.MaxLength + "','" + imgTools.ClientID + "');");
        imgTools.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanTools.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgTools.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanTools.ClientID + "');");

        ddlSkillCategory.Attributes.Add(CommonConstants.EVENT_ONBLUR, "javascript:ValidateControl('" + spanzSkillCategory.ClientID + "','','');");

        txtExperience.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtExperience.ClientID + "','" + imgExperience.ClientID + "','" + "Decimal" + "');");
        imgExperience.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanExperience.ClientID + "','" + Common.CommonConstants.MSG_DECIMAL + "');");
        imgExperience.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanExperience.ClientID + "');");

        txtExperience1.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return checkExperience1();");
        //txtExperience1.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtExperience1.ClientID + "','" + imgExperience.ClientID + "','" + "Decimal" + "');");
        imgExperience.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanExperience.ClientID + "','" + Common.CommonConstants.MSG_DECIMAL + "');");
        imgExperience.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanExperience.ClientID + "');");


        txtHeightQualification.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtHeightQualification.ClientID + "','" + imgHeightQualification.ClientID + "','" + Common.CommonConstants.VALIDATE_ALPHA_NUMERIC_WITDSPACE + "');");
        imgHeightQualification.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanHeightQualification.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgHeightQualification.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanHeightQualification.ClientID + "');");

        txtSoftSkill.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtSoftSkill.ClientID + "','" + txtSoftSkill.MaxLength + "','" + imgSoftSkill.ClientID + "');");
        imgSoftSkill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanSoftSkill.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgSoftSkill.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanSoftSkill.ClientID + "');");


        //txtUtilijation.Attributes.Add(Common.CommonConstants.EVENT_ONKEYPRESS, "return checkUtilization();");

        txtUtilijation.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return checkUtilization();");
        imgUtilization.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanUtilization.ClientID + "','" + Common.CommonConstants.MSG_NUMERIC + "');");
        imgUtilization.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanUtilization.ClientID + "');");

        //txtBilling.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtBilling.ClientID + "','" + imgBilling.ClientID + "','" + Common.CommonConstants.VALIDATE_NUMERIC_FUNCTION + "');");
        txtBilling.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return checkBilling();");

        imgBilling.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanBilling.ClientID + "','" + Common.CommonConstants.MSG_NUMERIC + "');");
        imgBilling.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanBilling.ClientID + "');");


        txtCTC.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtCTC.ClientID + "','" + imgCTC.ClientID + "','" + "Decimal" + "');");
        imgCTC.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanCTC.ClientID + "','" + Common.CommonConstants.MSG_DECIMAL + "');");
        imgCTC.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanCTC.ClientID + "');");



        //txtCTC1.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return checkCTC1();");
        txtCTC1.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtCTC1.ClientID + "','" + imgCTC.ClientID + "','" + "Decimal" + "');");
        imgCTC.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanCTC.ClientID + "','" + Common.CommonConstants.MSG_DECIMAL + "');");
        imgCTC.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanCTC.ClientID + "');");

        txtRemarks.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtRemarks.ClientID + "','" + txtRemarks.MaxLength + "','" + imgRemarks.ClientID + "');");
        imgRemarks.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanRemarks.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgRemarks.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanRemarks.ClientID + "');");

        //txtResponsiblePerson.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return ValidateControl('" + txtResponsiblePerson.ClientID + "','" + imgResponsiblePerson.ClientID + "','" + Common.CommonConstants.VALIDATE_ALPHA_NUMERIC_WITDSPACE + "');");
        //imgResponsiblePerson.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanResponsiblePerson.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        //imgResponsiblePerson.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanResponsiblePerson.ClientID + "');");

        txtResourceResponsibility.Attributes.Add(Common.CommonConstants.EVENT_ONBLUR, "return MultiLineTextBoxCheckResponsibility('" + txtResourceResponsibility.ClientID + "','" + txtResourceResponsibility.MaxLength + "','" + imgResourceResponsibility.ClientID + "');");
        imgResourceResponsibility.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOVER, "ShowTooltip('" + spanResourceResponsibility.ClientID + "','" + Common.CommonConstants.MSG_ALPHA_NUMERIC + "');");
        imgResourceResponsibility.Attributes.Add(Common.CommonConstants.EVENT_ONMOUSEOUT, "HideTooltip('" + spanResourceResponsibility.ClientID + "');");


        //Ishwar Patil 20042015 Start
        imgSkillsSearch.Attributes.Add("onclick", "return popUpSkillSearch();");
        //Ishwar Patil 20042015 End

        imgResponsiblePersonSearch.Attributes.Add("onclick", "return popUpEmployeeSearch();");

        //imgPurpose.Attributes.Add("onclick", "return popUpEmployeeName();");

        #endregion

        //lblPurpose.Text = string.Empty;

        if (!ValidateURL())
        {
            Response.Redirect(CommonConstants.INVALIDURL);
        }
        else
        {
            try
            {
                if (!IsPostBack)
                {
                    AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager();
                    arrRolesForUser = objRaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser());

                    if (arrRolesForUser.Count != 0)
                    {
                        if (arrRolesForUser.Contains(AuthorizationManagerConstants.ROLERPM))
                        {
                            ROLE = AuthorizationManagerConstants.ROLERPM;
                        }
                    }

                    //Default Focus
                    txtMusthaveskill.Focus();

                    //Fill Dropdown Method
                    FillDropDown();
                    this.GetPurposeDetails();

                    if (Session[SessionNames.MRFPREVIOUSVALUE] != null)
                    {
                        if (Session[SessionNames.MRFCOPY] != null)
                        {
                            BusinessEntities.MRFDetail mrfDetailcopyObj = new BusinessEntities.MRFDetail();
                            mrfDetailcopyObj = (BusinessEntities.MRFDetail)Session[SessionNames.MRFCOPY];

                            SetControlValues(mrfDetailcopyObj);
                            if (mrfDetailcopyObj.DepartmentName != Common.MasterEnum.Departments.Projects.ToString())
                            {
                                rowDomainAndSkill.Visible        = true;
                                MandatoryDomain.Visible          = false;
                                rowUtilizationAndBilling.Visible = true;
                            }
                            else
                            {
                                rowUtilizationAndBilling.Visible = false;
                            }
                        }
                        else
                        {
                            BusinessEntities.MRFDetail mrfDetailobj = new BusinessEntities.MRFDetail();
                            mrfDetailobj = (BusinessEntities.MRFDetail)Session[SessionNames.MRFPREVIOUSVALUE];

                            SetControlValues(mrfDetailobj);
                            //Check if Department selected was not "Projects" than hide the details of
                            //"Domain" and "Skill Category".
                            if (mrfDetailobj.DepartmentName != Common.MasterEnum.Departments.Projects.ToString())
                            {
                                rowDomainAndSkill.Visible        = true;
                                MandatoryDomain.Visible          = false;
                                rowUtilizationAndBilling.Visible = true;
                            }
                            else
                            {
                                rowUtilizationAndBilling.Visible = false;
                            }
                        }
                    }
                }
                txtResponsiblePerson.Text = hidResponsiblePersonName.Value;
                //txtResponsiblePerson.Text = mRFDetail.ReportingToEmployee;
                //Aarohi : Issue 28735(CR) : 26/12/2011 : Start
                //Coded to display Project/Dept Name on the second page of raise Mrf
                if (Session[SessionNames.PROJECT_NAME] == null || (Session[SessionNames.PROJECT_NAME].ToString()) == string.Empty)
                {
                    if (Session[SessionNames.DEPARTMENT_NAME] != null)
                    {
                        lblProjectName.Text = Session[SessionNames.DEPARTMENT_NAME].ToString();
                        lblTitle.Text       = DEPARTMENT;
                    }
                }
                else
                {
                    lblProjectName.Text = Session[SessionNames.PROJECT_NAME].ToString();
                    lblTitle.Text       = PROJECT;
                }
                lblRole.Text = Session[SessionNames.ROLE].ToString();
                //Aarohi : Issue 28735(CR) : 26/12/2011 : End
            }
            catch (RaveHRException ex)
            {
                LogErrorMessage(ex);
            }
            catch (Exception ex)
            {
                RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer,
                                                            CLASS_NAME_RAISEMRF_NEXT, "Page_Load", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
                LogErrorMessage(objEx);
            }
        }
    }
    /// <summary>
    /// Function will use to set the control values
    /// </summary>
    /// <param name="mrfDetailobj"></param>
    private void SetControlValues(BusinessEntities.MRFDetail mrfDetailobj)
    {
        lblMessage.Text = "";

        try
        {
            txtDomain.Text                 = mrfDetailobj.Domain;
            hidDepartmentName.Value        = mrfDetailobj.DepartmentName;
            txtMusthaveskill.Text          = mrfDetailobj.MustToHaveSkills;
            txtGoodtohaveskill.Text        = mrfDetailobj.GoodToHaveSkills;
            txtTools.Text                  = mrfDetailobj.Tools;
            ddlSkillCategory.SelectedValue = Convert.ToString(mrfDetailobj.SkillCategoryId);
            txtDomain.Text                 = mrfDetailobj.Domain;
            if (mrfDetailobj.DepartmentName == MasterEnum.Departments.Projects.ToString() && txtDomain.Text == "")
            {
                lblMessage.Text       = "Please provide Domain details";
                lblMessage.ForeColor  = Color.Red;
                txtDomain.BorderColor = Color.Red;
                txtDomain.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
                txtDomain.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(2);
            }
            if (mrfDetailobj.ExperienceString != null)
            {
                string[] Exparr = Convert.ToString(mrfDetailobj.ExperienceString).Split(SPILITER_DASH);

                txtExperience.Text  = Exparr[0].ToString();
                txtExperience1.Text = Exparr[1].ToString();
            }
            txtHeightQualification.Text = mrfDetailobj.Qualification;
            txtSoftSkill.Text           = mrfDetailobj.SoftSkills;
            txtUtilijation.Text         = Convert.ToString(mrfDetailobj.Utilization);
            txtBilling.Text             = Convert.ToString(mrfDetailobj.Billing);

            //Venkatesh : XXX 26-Feb-2014 : Start
            //Desc : Mrf CTC error handling when it Null
            if (mrfDetailobj.MRFCTCString != null && mrfDetailobj.MRFCTCString != "")
            {
                //Venkatesh : XXX 26-Feb-2014 : End
                string[] CTCarr = Convert.ToString(mrfDetailobj.MRFCTCString).Split(SPILITER_DASH);

                txtCTC.Text  = CTCarr[0].ToString();
                txtCTC1.Text = CTCarr[1].ToString();
            }
            else
            {
                txtCTC.Text  = "0";
                txtCTC1.Text = "0";
            }

            txtRemarks.Text                = mrfDetailobj.Remarks;
            txtResponsiblePerson.Text      = mrfDetailobj.EmployeeName;
            hidResponsiblePerson.Value     = mrfDetailobj.ReportingToId;
            txtResourceResponsibility.Text = mrfDetailobj.ResourceResponsibility;


            //if (ddlSkillCategory.SelectedItem.Text == "SELECT")
            //{
            //    lblMessage.Text = "Please select Skill Category";
            //    lblMessage.ForeColor = Color.Red;
            //    ddlSkillCategory.BorderColor = Color.Red;
            //    ddlSkillCategory.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            //    ddlSkillCategory.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(2);
            //    // return;
            //}

            //if (txtResponsiblePerson.Text == null ||txtResponsiblePerson.Text == "Mrf Admin")
            //{
            //    lblMessage.Text = "Please provide Responsible Person";
            //    lblMessage.ForeColor = Color.Red;
            //    txtResponsiblePerson.BorderColor = Color.Red;
            //    txtResponsiblePerson.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            //    txtResponsiblePerson.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(2);
            //   // return;
            //}
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer,
                                      CLASS_NAME_RAISEMRF_NEXT, "SetControlValues", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }
Example #19
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
    }
    /// <summary>
    /// Function will GetControlValues
    /// </summary>
    /// <returns></returns>
    private BusinessEntities.MRFDetail GetControlValues()
    {
        BusinessEntities.MRFDetail mrfDetailobj = new BusinessEntities.MRFDetail();
        AuthorizationManager       objRaveHRAuthorizationManager = new AuthorizationManager();

        try
        {
            string UserMailId = objRaveHRAuthorizationManager.getLoggedInUserEmailId();

            if (Session[SessionNames.MRFPREVIOUSVALUE] != null)
            {
                mrfDetailobj = (BusinessEntities.MRFDetail)Session[SessionNames.MRFPREVIOUSVALUE];

                mrfDetailobj.MustToHaveSkills = txtMusthaveskill.Text.Trim().ToString();
                mrfDetailobj.GoodToHaveSkills = txtGoodtohaveskill.Text.Trim().ToString();
                mrfDetailobj.Tools            = txtTools.Text.Trim().ToString();
                if (ddlSkillCategory.SelectedItem.Text != Common.CommonConstants.SELECT)
                {
                    mrfDetailobj.SkillCategoryId = Convert.ToInt32(ddlSkillCategory.SelectedItem.Value);
                }
                else
                {
                    mrfDetailobj.SkillCategoryId = 0;
                }
                string Experience = txtExperience.Text.Trim().ToString() + "-" + txtExperience1.Text.Trim().ToString();
                if (Experience == "")
                {
                    mrfDetailobj.Experience = Convert.ToDecimal(0);
                }
                else
                {
                    mrfDetailobj.ExperienceString = Experience;
                }

                mrfDetailobj.Qualification = txtHeightQualification.Text.Trim().ToString();
                mrfDetailobj.SoftSkills    = txtSoftSkill.Text.Trim().ToString();

                if (mrfDetailobj.ProjectId == 0 && mrfDetailobj.DepartmentName != MasterEnum.Departments.Projects.ToString())
                {
                    if (txtUtilijation.Text != "")
                    {
                        mrfDetailobj.Utilization = Convert.ToInt32(txtUtilijation.Text.Trim().ToString());
                    }
                    if (txtBilling.Text != "")
                    {
                        mrfDetailobj.Billing = Convert.ToInt32(txtBilling.Text.Trim().ToString());
                    }
                }
                string TargetCTC = txtCTC.Text.Trim().ToString() + "-" + txtCTC1.Text.Trim().ToString();

                if (TargetCTC == "")
                {
                    mrfDetailobj.MRFCTC = Convert.ToDecimal(0);
                }
                else
                {
                    mrfDetailobj.MRFCTCString = TargetCTC;
                }

                mrfDetailobj.Remarks                = txtRemarks.Text.Trim().ToString();
                mrfDetailobj.ReportingToId          = hidResponsiblePerson.Value.ToString();
                mrfDetailobj.ResourceResponsibility = txtResourceResponsibility.Text.Trim().ToString();
                mrfDetailobj.LoggedInUserEmail      = UserMailId;
                mrfDetailobj.Domain = txtDomain.Text.Trim();

                if (mrfDetailobj.MRFPurposeId == Convert.ToInt32(MasterEnum.MRFPurpose.MarketResearchfeasibility))
                {
                    mrfDetailobj.MRfType = Convert.ToInt32(MasterEnum.MRFType.Shortlist);
                }
                else
                {
                    mrfDetailobj.MRfType = Convert.ToInt32(MasterEnum.MRFType.Shortlist_and_make_anoffer);
                }

                //Ishwar Patil 22/04/2015 Start
                mrfDetailobj.MandatorySkills = Convert.ToString(hidSkills.Value);
                //Ishwar Patil 22/04/2015 End

                Session[SessionNames.MRFPREVIOUSVALUE] = mrfDetailobj;
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer,
                                      CLASS_NAME_RAISEMRF_NEXT, "GetControlValues", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }

        return(mrfDetailobj);
    }
Example #21
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);
        }
    }
    /// <summary>
    /// Raise MRF CLick
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnRaiseMRF_Click(object sender, EventArgs e)
    {
        btnRaiseMRF.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ButtonClickValidate();");

        BusinessEntities.MRFDetail MRFDetailobject = new BusinessEntities.MRFDetail();

        try
        {
            MRFDetailobject = GetControlValues();

            if (Session[SessionNames.MRFGRIDFILL] != null)
            {
                dtResourceGrid = (DataTable)Session[SessionNames.MRFGRIDFILL];

                raveHRCollection = mRFDetail.RaiseMRFBL(MRFDetailobject, dtResourceGrid);
            }
            else
            {
                raveHRCollection = mRFDetail.RaiseMRFBL(MRFDetailobject, null);
            }

            Response.Redirect(CommonConstants.Page_MrfRaisePrevious, false);

            if (Session[SessionNames.MRFPREVIOUSVALUE] != null)
            {
                Session.Remove(SessionNames.MRFPREVIOUSVALUE);
            }
            if (Session[SessionNames.MRFGRIDFILL] != null)
            {
                Session.Remove(SessionNames.MRFGRIDFILL);
            }
            if (Session[SessionNames.MRFCOPY] != null)
            {
                Session.Remove(SessionNames.MRFCOPY);
            }

            //if (txtResponsiblePerson.Text == null || txtResponsiblePerson.Text=="")
            //{
            //    lblMessage.Text = "Please fill Responsible Person";
            //    lblMessage.ForeColor = Color.Red;
            //    txtResponsiblePerson.BorderColor = Color.Red;
            //    txtResponsiblePerson.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            //    txtResponsiblePerson.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(2);
            //    return;
            //}

            //if (ddlSkillCategory.SelectedItem.Text == "SELECT")
            //{
            //    lblMessage.Text = "Please select Skill Category";
            //    lblMessage.ForeColor = Color.Red;
            //    ddlSkillCategory.BorderColor = Color.Red;
            //    ddlSkillCategory.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            //    ddlSkillCategory.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(2);
            //    return;
            //}

            resetControl();
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer,
                                                        CLASS_NAME_RAISEMRF_NEXT, "btnRaiseMRF_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }