示例#1
0
    /// <summary>
    /// Fills Client drop down
    /// </summary>
    private void FillClientDropDown()
    {
        List <BusinessEntities.Projects> objRaveHRProjects = new List <BusinessEntities.Projects>();

        Rave.HR.BusinessLayer.Projects.Projects objRaveHRProjctsBAL = new Rave.HR.BusinessLayer.Projects.Projects();

        try
        {
            objRaveHRProjects            = objRaveHRProjctsBAL.GetClientName(objProjectCriteria);
            ddlClientName.DataSource     = objRaveHRProjects;
            ddlClientName.DataTextField  = "ClientName";
            ddlClientName.DataValueField = "ClientId";
            ddlClientName.DataBind();
            ddlClientName.Items.Insert(0, SELECT);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "FillClientDropDown", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
示例#2
0
    protected void rpCategories_OnItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                ListBox lbCategory    = (ListBox)e.Item.FindControl("lbCategory");
                Label   lblCategoryID = (Label)e.Item.FindControl("lblCategoryID");
                if (lblCategoryID != null)
                {
                    //--Get Category ID
                    string strCategoryID = lblCategoryID.Text;

                    Rave.HR.BusinessLayer.Projects.Projects objTechnologyBAL          = new Rave.HR.BusinessLayer.Projects.Projects();
                    Rave.HR.BusinessLayer.Projects.Projects objCheckedCategoryNameBAL = new Rave.HR.BusinessLayer.Projects.Projects();
                    List <BusinessEntities.Technology>      objListTechnology;
                    objListTechnology = new List <BusinessEntities.Technology>();
                    objListTechnology = objTechnologyBAL.Technology(int.Parse(strCategoryID));

                    //--Bind category listbox
                    lbCategory.Items.Clear();
                    lbCategory.DataSource     = objListTechnology;
                    lbCategory.DataTextField  = "TechnolgoyName";
                    lbCategory.DataValueField = "TechnologyID";
                    lbCategory.DataBind();
                }
            }
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "rpCategories_OnItemDataBound", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
示例#3
0
    /// <summary>
    /// Project Category List
    /// </summary>
    /// <returns>void</returns>
    private void GetProjectCategory()
    {
        try
        {
            Rave.HR.BusinessLayer.Projects.Projects objCategoryBAL = new Rave.HR.BusinessLayer.Projects.Projects();

            List <BusinessEntities.Category> objListCategory = new List <BusinessEntities.Category>();
            objListCategory = objCategoryBAL.TechnologyCategory();

            rpCategories.DataSource = objListCategory;
            //--bind repeater
            rpCategories.DataBind();
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "GetProjectCategory", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
    /// <summary>
    /// release the employee from project & then Exit the employee.
    /// If employee is last resource on project then project should get closed.
    /// Mail should be send for all above activities.
    /// </summary>
    /// <param name="employee">Employee Details</param>
    /// <created By>Yagendra Sharnagat </created By>
    private void ExitEmployee(BusinessEntities.Employee employee, bool B_ClientName)
    {
        RaveHRCollection raveHRCollection = new RaveHRCollection();

        Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee();

        //Get the allocated project details of employee
        raveHRCollection = employeeBL.IsAllocatedToProject(employee);

        //Issue Id : 28572 Mahendra START
        //Check if any employee's line manager or functional manager is resigned employee.
        RaveHRCollection raveHRCollectionReportingEmployee = new RaveHRCollection();

        raveHRCollectionReportingEmployee = employeeBL.IsRepotingManager(employee);
        if (raveHRCollectionReportingEmployee.Count != 0)
        {
            lblMessage.Visible = true;
            lblMessage.Text    = "Resigned Employee is a Line Manager or Functional Manager of some of employees. Please change Manager for that employees.";
            return;
        }
        //Issue Id : 28572 Mahendra END


        int     ProjectCount      = 0;
        Boolean IsProjectClosed   = false;
        string  projectAllocation = string.Empty;
        Boolean IsRoleHR          = false;

        // Check whether employee is allocated to project.
        if (raveHRCollection.Count != 0)
        {
            RaveHRCollection newRaveHRCollection = new RaveHRCollection();
            BusinessEntities.ParameterCriteria newObjParameter = new BusinessEntities.ParameterCriteria();

            //As this parameter required for the method.
            newObjParameter.PageNumber = 1;
            newObjParameter.PageSize   = 10;
            newObjParameter.SortExpressionAndDirection = "EMPId ASC";
            IsRoleHR = true;

            employee.StatusId = 142;//active emp

            //Get the employee details of allocated projects.
            newRaveHRCollection = employeeBL.GetEmployeesProjectDetails(newObjParameter, employee, ref ProjectCount);

            //To release Employee project wise.
            foreach (BusinessEntities.Employee empDetails in newRaveHRCollection)
            {
                empDetails.EmpReleasedStatus = 1;

                empDetails.StatusId = Convert.ToInt32(ddlStatus.SelectedItem.Value.ToString());

                //For mail get current date for release
                //30920-Subhra-Start
                //empDetails.ProjectReleaseDate = System.DateTime.Now;
                empDetails.ProjectReleaseDate = ucDatePickerLastWorkDay.Text.Trim() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(ucDatePickerLastWorkDay.Text);
                //30920-Subhra-End

                //Release the employee from project.
                employeeBL.UpdateEmployeeReleaseStatus(empDetails, ref IsProjectClosed);

                //Siddharth 7 April 2015 Start
                //Set isActive =0 for projects of resigned employees
                employeeBL.Employee_UpdateEmpCostCodeProjRelease(empDetails);
                //Siddharth 7 April 2015 End

                if (empDetails.ProjectId != 0)
                {   //Send mail for project release.
                    employeeBL.SendMailToEmployeeReleasedFromProject(empDetails, IsRoleHR);

                    projectAllocation += empDetails.ProjectName + ", ";
                }
                else
                {
                    //Send mail for department release.
                    employeeBL.SendMailToEmployeeReleasedFromDepartment(empDetails, IsRoleHR);
                }

                //If last employee then close the project.
                if (IsProjectClosed)
                {
                    //then send Email for closed project
                    int ProjectId = empDetails.ProjectId;

                    Rave.HR.BusinessLayer.Projects.Projects objProjectsBAL = new Rave.HR.BusinessLayer.Projects.Projects();;
                    BusinessEntities.Projects objRaveHR = new BusinessEntities.Projects();;
                    //Get the prooject details for email functionality.
                    objRaveHR = objProjectsBAL.RetrieveProjectDetails(ProjectId);
                    //--Call the BL method to send Emails.
                    employeeBL.SendMailToEmployeeForClosedProject(objRaveHR);
                }
            }
        }

        //Inactive employee Id.
        employee.StatusId = 143;

        //Resign the employee from company (exit).
        employeeBL.UpdateEmployeeResignationDetails(employee);

        //Remove last appended comma.
        if (projectAllocation.EndsWith(", "))
        {
            projectAllocation = projectAllocation.Substring(0, projectAllocation.Length - 2);
        }

        //Also get project name with department.
        if (projectAllocation.Trim() != string.Empty)
        {
            employee.Department = employee.Department + " (" + projectAllocation.Trim() + ") ";
        }


        //Send mail for exit.
        employeeBL.SendMailEmployeeResignFromCompany(employee, B_ClientName);

        lblConfirmMsg.Text = "Employee Resignation Details saved successfully and email notification is sent.";

        lblMessage.Visible = true;
    }
示例#5
0
    /// <summary>
    /// Returns Project Summary data for GridView
    /// </summary>
    /// <returns>List</returns>
    private List <BusinessEntities.Projects> GetProjectSummaryData(bool setPageing)
    {
        if (grdvListofProjects.BottomPagerRow != null)
        {
            GridViewRow gvrPager = grdvListofProjects.BottomPagerRow;
            TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl("txtPages");
            if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0 && Convert.ToInt32(txtPages.Text) <= Convert.ToInt32(Session[sessionPageCount].ToString()))
            {
                objProjectCriteria.PageNumber = int.Parse(txtPages.Text);
            }
        }
        else
        {
            objProjectCriteria.PageNumber = Convert.ToInt32(Session[SessionNames.CURRENT_PAGE_INDEX_PROJECT].ToString());
        }

        //checks if PageNumber=0 then assign 1 to it
        if (objProjectCriteria.PageNumber == 0)
        {
            objProjectCriteria.PageNumber = 1;
        }

        Rave.HR.BusinessLayer.Projects.Projects objProjectSummaryBAL = new Rave.HR.BusinessLayer.Projects.Projects();

        BusinessEntities.Master   objGetProjectStatus  = new BusinessEntities.Master();
        BusinessEntities.Projects objGetProjectSummary = new BusinessEntities.Projects();

        List <BusinessEntities.Projects> objListProjectSummary = new List <BusinessEntities.Projects>();

        try
        {
            if (Session[SessionNames.PROJECT_SUMMARY_PROJECT_NAME] == null || Session[SessionNames.PROJECT_SUMMARY_PROJECT_NAME].ToString() == string.Empty)
            {
                objGetProjectSummary.ProjectName = null;
            }
            else
            {
                objGetProjectSummary.ProjectName = Session[SessionNames.PROJECT_SUMMARY_PROJECT_NAME].ToString();
            }
            if (Session[SessionNames.CLIENT_NAME] == null || Session[SessionNames.CLIENT_NAME].ToString() == SELECT)
            {
                objGetProjectSummary.ClientName = null;
            }
            else
            {
                objGetProjectSummary.ClientName = Session[SessionNames.CLIENT_NAME].ToString();
            }
            if ((objProjectCriteria.RolePM == AuthorizationManagerConstants.ROLEPROJECTMANAGER) || (objProjectCriteria.RoleRPM == AuthorizationManagerConstants.ROLERPM) || (objProjectCriteria.RoleCOO == AuthorizationManagerConstants.ROLECOO))
            {
                if (Session[SessionNames.PROJECT_STATUS] == null || Session[SessionNames.PROJECT_STATUS].ToString() == SELECT)
                {
                    objGetProjectStatus.MasterId = 0;
                }
                else
                {
                    objGetProjectStatus.MasterId = Convert.ToInt32(Session[SessionNames.PROJECT_STATUS].ToString());
                }
            }
            else
            {
                objGetProjectStatus.MasterId = 0;
            }

            //If any of the session is null or Contains text "Select" get the page load data

            if ((Session[SessionNames.PROJECT_SUMMARY_PROJECT_NAME] == null || Session[SessionNames.PROJECT_SUMMARY_PROJECT_NAME].ToString() == string.Empty) && (Session[SessionNames.CLIENT_NAME] == null || Session[SessionNames.CLIENT_NAME].ToString() == SELECT) && (Session[SessionNames.PROJECT_STATUS] == null || Session[SessionNames.PROJECT_STATUS].ToString() == SELECT))
            {
                objListProjectSummary = objProjectSummaryBAL.GetProjectSummaryForPageLoad(objProjectCriteria, PAGE_SIZE, ref pageCount, setPageing);
            }
            //Else get the filtered data based upon filter critera selection
            else
            {
                objListProjectSummary = objProjectSummaryBAL.GetProjectSummaryForFilter(objGetProjectSummary, objGetProjectStatus, objProjectCriteria, PAGE_SIZE, ref pageCount, setPageing);
            }
            Session[sessionPageCount] = pageCount;
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetDataProjectSummaryApplyFilter", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
        return(objListProjectSummary);
    }
示例#6
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        try
        {
            //--Check if search keyword entered
            string strKeyword = null;
            bool   bKeyword   = false;
            if (txtKeyword.Text.Trim() != "")
            {
                strKeyword = txtKeyword.Text.Trim();
                bKeyword   = true;
            }

            Rave.HR.BusinessLayer.Projects.Projects objRaveHRProjects     = new Rave.HR.BusinessLayer.Projects.Projects();
            List <BusinessEntities.Projects>        objRaveHRProjectsList = new List <BusinessEntities.Projects>();
            objRaveHRProjectsList = objRaveHRProjects.GetProjectSearchResult(strKeyword);

            //--Get datatable
            if (bKeyword == true)
            {
                //--project search result datasource
                rpProjectSearchResult.DataSource = objRaveHRProjectsList;
            }
            else
            {
                DataTable dtProjectList = null;
                dtProjectList = GetDataTable(objRaveHRProjectsList);
                List <BusinessEntities.Projects> objProjectSearchResult = GetProjectSearchResult(dtProjectList);
                if (objProjectSearchResult == null)
                {
                    return;
                }
                //--assign datasource to repeater
                if (objProjectSearchResult.Count > 0)
                {
                    rpProjectSearchResult.DataSource = objProjectSearchResult;
                }
                else
                {
                    //--display message
                    lblMessage.Text    = CommonConstants.NO_RECORD_MESSAGE;
                    lblMessage.Visible = true;
                }
            }

            //--Bind Grid
            rpProjectSearchResult.DataBind();

            //--Display div
            divProjectSearchResult.Visible = true;
            divProjectSearch.Visible       = false;
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "btnSearch_Click", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }