protected void rpProjectSearchResult_OnItemDataBound(object sender, RepeaterItemEventArgs e) { try { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hypProject = (HyperLink)e.Item.FindControl("hypProject"); BusinessEntities.Projects drv = (BusinessEntities.Projects)e.Item.DataItem; if (drv != null) { if (hypProject != null) { hypProject.Text = drv.ClientName + " - " + drv.ProjectName; hypProject.NavigateUrl = "AddProject.aspx?" + URLHelper.SecureParameters("ProjectID", drv.ID.ToString()) + "&" + URLHelper.SecureParameters("Mode", "View") + "&" + URLHelper.SecureParameters("sortExpression", "ProjectID") + "&" + URLHelper.SecureParameters("sortDirection", "ASC") + "&" + URLHelper.SecureParameters("workFlow", "Select") + "&" + URLHelper.CreateSignature(drv.ID.ToString(), "View", "ProjectID", "ASC", "Select"); } } } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "rpProjectSearchResult_OnItemDataBound", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Displays data in Table format /// </summary> /// <param name="listRecruitmentDetails"></param> /// <returns></returns> private string GetHTMLForProjectClosed(BusinessEntities.Projects projectDetails) { string[,] arrayData = new string[4, 2]; try { //Header Values arrayData[0, 0] = "Client Name"; arrayData[1, 0] = "Project Name"; arrayData[2, 0] = "Start Date"; arrayData[3, 0] = "End Date"; //Row Details arrayData[0, 1] = projectDetails.ClientName; arrayData[1, 1] = projectDetails.ProjectName; arrayData[2, 1] = projectDetails.StartDate.ToShortDateString(); arrayData[3, 1] = projectDetails.EndDate.ToShortDateString(); IEmailTableData objEmailTableData = new EmailTableData(); objEmailTableData.RowDetail = arrayData; objEmailTableData.RowCount = 4; return(objEmailTableData.GetVerticalHeaderTableData(objEmailTableData)); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, GET_HTML_PROJECT_CLOSED, EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
public void SendEmailForProjectClosed(BusinessEntities.Projects objProjectDetails) { try { BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection(); string projectManagerEmail = string.Empty; string strProjectStatus = string.Empty; string strProjectStatusFlag = objProjectDetails.ProjectStatus; string sComp = Utility.GetUrl(); string strProjectSummaryLink = sComp + CommonConstants.PROJECTSUMMARY_PAGE; //Get ProjectManager Name raveHRCollection = DataAccessLayer.Projects.Projects.GetProjectManagerByProjectId(objProjectDetails); foreach (BusinessEntities.Projects objProj in raveHRCollection) { projectManagerEmail += objProj.EmailIdOfPM; //projectManagerEmail += ","; objProjectDetails.EmailIdOfPM = projectManagerEmail; if (objProjectDetails.EmailIdOfPM.EndsWith(",")) { objProjectDetails.EmailIdOfPM = objProjectDetails.EmailIdOfPM.Substring(0, objProjectDetails.EmailIdOfPM.Length - 1); } } IRMSEmail obj = new RMSEmail(Convert.ToInt16(EnumsConstants.RMSModule.Projects), Convert.ToInt16(EnumsConstants.EmailFunctionality.DeletedProject)); obj.To.Add(objProjectDetails.EmailIdOfPM); obj.Subject = string.Format(obj.Subject, objProjectDetails.ProjectCode, objProjectDetails.ClientName, objProjectDetails.ProjectName); obj.Body = string.Format(obj.Body, objProjectDetails.ProjectName, objProjectDetails.ClientName, GetHTMLForProjectClosed(objProjectDetails), strProjectSummaryLink); obj.SendEmail(obj); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, SEND_MAIL_CLOSED_PROJECT, EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// Get Table data in HTML format. /// </summary> /// <param name="listProjectDetails"></param> /// <returns></returns> private string GetHTMLForProjectEdited(BusinessEntities.Projects objProjectDetails) { try { string[] header = new string[8]; string[,] arrayData = new string[1, 8]; //Header Details header[0] = "Prev End Date"; header[1] = "Project End Date"; header[2] = "Prev ProjectGroup"; header[3] = "Project Group"; header[4] = "Prev Project Standard Hours"; header[5] = "Project Standard Hours"; header[6] = "Prev Project Status"; header[7] = "Project Status"; //header[8] = "Prev Project Description"; //header[9] = "Project Description"; //RowDetails arrayData[0, 0] = objProjectDetails.PrevEndDate.ToString(CommonConstants.DATE_FORMAT); arrayData[0, 1] = objProjectDetails.EndDate.ToString(CommonConstants.DATE_FORMAT); arrayData[0, 2] = objProjectDetails.PrevProjectGroup; arrayData[0, 3] = objProjectDetails.ProjectGroup; arrayData[0, 4] = Convert.ToString(objProjectDetails.PrevStandardHours); arrayData[0, 5] = objProjectDetails.StandardHours; arrayData[0, 6] = objProjectDetails.PrevProjectStatus; arrayData[0, 7] = objProjectDetails.ProjectStatus; //arrayData[0, 8] = objProjectDetails.PrevProjectExecutiveSummary; //arrayData[0, 9] = objProjectDetails.ProjectExecutiveSummary; IEmailTableData objEmailTableData = new EmailTableData(); objEmailTableData.Header = header; objEmailTableData.RowDetail = arrayData; objEmailTableData.RowCount = 1; return(objEmailTableData.GetTableData(objEmailTableData)); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, GET_HTML_PROJECT_EDITED, EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
public List <BusinessEntities.Projects> GetProjectSummaryForFilter(BusinessEntities.Projects objGetProjectSummary, BusinessEntities.Master objGetProjectStatus, BusinessEntities.ProjectCriteria objProjectCriteria, int pageSize, ref int pageCount, bool setPageing) { List <BusinessEntities.Projects> objProjectSummary = new List <BusinessEntities.Projects>(); try { Rave.HR.DataAccessLayer.Projects.Projects objGetProjectSummaryDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); objProjectSummary = objGetProjectSummaryDAL.GetProjectSummaryForFilter(objGetProjectSummary, objGetProjectStatus, objProjectCriteria, pageSize, ref pageCount, setPageing); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, "GetProjectSummaryForFilter", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } return(objProjectSummary); }
public DataTable GetFilteredProjectSummaryList(BusinessEntities.Projects objGetProjectSummary, BusinessEntities.Master objGetProjectStatus, string UserMailId, string COORole, string PresalesRole, string PMRole, string RPMRole) { Rave.HR.DataAccessLayer.Projects.Projects objGetProjectSummaryDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); DataSet dsProjectSummary = new DataSet(); DataTable dt = new DataTable(); try { dsProjectSummary = objGetProjectSummaryDAL.GetProjectSummaryForFilter(objGetProjectSummary, objGetProjectStatus, UserMailId, COORole, PresalesRole, PMRole, RPMRole); dt = dsProjectSummary.Tables[0]; } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, "GetFilteredProjectSummaryList", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } return(dt); }
/// <summary> /// Updates the existing project. /// </summary> /// <param name="objAddProject"></param> /// <returns></returns> public void UpdateProject(BusinessEntities.Projects objAddProject, string IsUpdated, string rmsURL, bool IsMailSentStatus) { try { Rave.HR.DataAccessLayer.Projects.Projects objUpdateProjectDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); //return objUpdateProjectDAL.UpdateProject(objAddProject); objUpdateProjectDAL.UpdateProject(objAddProject, IsUpdated); if (objAddProject.ProjectStatus == Convert.ToInt32(MasterEnum.ProjectStatus.Closed).ToString()) { SendEmailForProjectClosed(objAddProject); HttpContext.Current.Session["ConfirmationMessage"] = "Project " + objAddProject.ProjectName + " is closed, email notification is sent for the same."; } else { if (Convert.ToBoolean(IsUpdated) && Convert.ToBoolean(IsMailSentStatus) == true) { SendEmailForProjectEdited(objAddProject, rmsURL); HttpContext.Current.Session["ConfirmationMessage"] = "Project " + objAddProject.ProjectName + " is updated successfully, email notification is sent for the same."; } else { IsMailSentStatus = false; HttpContext.Current.Session["ConfirmationMessage"] = "Project " + objAddProject.ProjectName + " is updated successfully."; } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, "UpdateProject", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// Gets the Project Search results based on search criteria /// </summary> /// <returns>List</returns> public List <BusinessEntities.Projects> GetProjectSearchResult(string strKeyword) { try { List <BusinessEntities.Projects> objListRetrieveProjectDetails = new List <BusinessEntities.Projects>(); Rave.HR.DataAccessLayer.Projects.Projects objRetrieveProjectDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); BusinessEntities.Projects objRaveHR = null; DataSet dsRetrieveProjectDetails = new DataSet(); dsRetrieveProjectDetails = objRetrieveProjectDAL.GetProjectSearchResult(strKeyword); foreach (DataRow drRetrieveProjectDetails in dsRetrieveProjectDetails.Tables[0].Rows) { objRaveHR = new BusinessEntities.Projects(); objRaveHR.ID = int.Parse(drRetrieveProjectDetails["ProjectID"].ToString()); objRaveHR.ClientName = drRetrieveProjectDetails["ClientName"].ToString(); objRaveHR.ProjectName = drRetrieveProjectDetails["ProjectName"].ToString(); objRaveHR.Location = drRetrieveProjectDetails["Location"].ToString(); objRaveHR.Category = drRetrieveProjectDetails["Category"].ToString(); objRaveHR.TechnologyName = drRetrieveProjectDetails["TechnologyName"].ToString(); objRaveHR.StartDate = DateTime.Parse(drRetrieveProjectDetails["StartDate"].ToString()); objRaveHR.EndDate = DateTime.Parse(drRetrieveProjectDetails["EndDate"].ToString()); objRaveHR.ProjectStartYear = int.Parse(drRetrieveProjectDetails["StartYear"].ToString()); objRaveHR.ProjectEndYear = int.Parse(drRetrieveProjectDetails["EndYear"].ToString()); objListRetrieveProjectDetails.Add(objRaveHR); } return(objListRetrieveProjectDetails); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, "RaveHRProjects.cs", "GetProjectSearchResult", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// This Function is used to retrieve Project Details after Project is added /// </summary> /// <param name="objViewProject"></param> /// <returns></returns> public BusinessEntities.Projects RetrieveProjectDetails(int ProjectID) { try { List <BusinessEntities.Projects> objListRetrieveProjectDetails = new List <BusinessEntities.Projects>(); Rave.HR.DataAccessLayer.Projects.Projects objRetrieveProjectDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); BusinessEntities.Projects objRaveHR = null; DataSet dsRetrieveProjectDetails = new DataSet(); dsRetrieveProjectDetails = objRetrieveProjectDAL.RetrieveProjectDetails(ProjectID); foreach (DataRow drRetrieveProjectDetails in dsRetrieveProjectDetails.Tables[0].Rows) { objRaveHR = new BusinessEntities.Projects(); objRaveHR.ClientName = drRetrieveProjectDetails["ClientName"].ToString(); objRaveHR.ProjectName = drRetrieveProjectDetails["ProjectName"].ToString(); objRaveHR.ProjectStatus = drRetrieveProjectDetails["CreatedBy"].ToString(); objRaveHR.CreatedBy = drRetrieveProjectDetails["MailId"].ToString(); objRaveHR.CreatedByFullName = drRetrieveProjectDetails["CreatedByFullName"].ToString(); objRaveHR.ProjectCode = drRetrieveProjectDetails["ProjectCode"].ToString(); objRaveHR.StartDate = Convert.ToDateTime(drRetrieveProjectDetails["StartDate"].ToString()); objRaveHR.EndDate = Convert.ToDateTime(drRetrieveProjectDetails["EndDate"].ToString()); } return(objRaveHR); //return dsRetrieveProjectDetails; } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, "RetrieveProjectDetails", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// Gets the Project Name. /// </summary> /// <returns>List</returns> //public List<BusinessEntities.Projects> getProjectName() public List <BusinessEntities.Projects> GetProjectNames() { try { Rave.HR.DataAccessLayer.Projects.Projects objProjectNameDAL; List <BusinessEntities.Projects> lstProjectName; BusinessEntities.Projects objProjectName; DataSet dsProjectName; objProjectNameDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); lstProjectName = new List <BusinessEntities.Projects>(); dsProjectName = new DataSet(); objProjectName = null; //dsProjectName = objProjectNameDAL.getProjectName(); dsProjectName = objProjectNameDAL.GetProjectNames(); foreach (DataRow drProjectName in dsProjectName.Tables[0].Rows) { objProjectName = new BusinessEntities.Projects(); objProjectName.ProjectName = drProjectName["ProjectName"].ToString(); objProjectName.ProjectId = int.Parse(drProjectName["ProjectID"].ToString()); lstProjectName.Add(objProjectName); } return(lstProjectName); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, "RaveHRProjects.cs", "getProjectName", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <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; }
/// <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); }
/// <summary> /// Sends Email when project Status is closed /// </summary> /// <param name="objAddProject"></param> /// <returns></returns> public void SendEmailForProjectEdited(BusinessEntities.Projects objProjectDetails, string rmsURL) { try { BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection(); string strProjectStatus = string.Empty; string projectManagerEmail = string.Empty; string strProjectStatusFlag = objProjectDetails.ProjectStatus; string sComp = Utility.GetUrl(); string strProjectSummaryLink = sComp + CommonConstants.ADDPROJECT_PAGE + "?" + rmsURL; DataAccessLayer.Projects.Projects objProjectsDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); BusinessEntities.Projects objProjectDetailsUpdated = new BusinessEntities.Projects(); objProjectDetailsUpdated = objProjectsDAL.GetEditedProjectDetails(objProjectDetails); IRMSEmail obj = new RMSEmail(Convert.ToInt16(EnumsConstants.RMSModule.Projects), Convert.ToInt16(EnumsConstants.EmailFunctionality.EditedProject)); //Get ProjectManager Name raveHRCollection = DataAccessLayer.Projects.Projects.GetProjectManagerByProjectId(objProjectDetails); if (raveHRCollection.Count > 0) { foreach (BusinessEntities.Projects objProj in raveHRCollection) { projectManagerEmail += objProj.EmailIdOfPM; //projectManagerEmail += ","; objProjectDetails.EmailIdOfPM = projectManagerEmail; if (objProjectDetails.EmailIdOfPM.EndsWith(",")) { objProjectDetails.EmailIdOfPM = objProjectDetails.EmailIdOfPM.Substring(0, objProjectDetails.EmailIdOfPM.Length - 1); } } obj.To.Add(objProjectDetails.EmailIdOfPM); } string tableData = GetHTMLForProjectEdited(objProjectDetailsUpdated); obj.Subject = string.Format(obj.Subject, objProjectDetails.ProjectCode, objProjectDetails.ClientName, objProjectDetails.ProjectName); obj.Body = string.Format(obj.Body, objProjectDetails.ProjectName, objProjectDetails.ClientName, tableData, strProjectSummaryLink); obj.SendEmail(obj); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, PROJECTS, SEND_MAIL_EDIT_PROJECT, EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// This Function is used to View Project Details. /// </summary> /// <param name="objViewProject"></param> /// <returns></returns> public List <BusinessEntities.Projects> GetProjectDetails(BusinessEntities.Projects objViewProject, string SortDir, string SortExpression, string UserMailID, string PreSaleRole, string PMRole, string COORole, string RPMRole, string Action, string clientName, int projectStatusId, string projectsummaryprojectname) { try { List <BusinessEntities.Projects> objListViewProjectDetails = new List <BusinessEntities.Projects>(); Rave.HR.DataAccessLayer.Projects.Projects objViewProjectDAL = new Rave.HR.DataAccessLayer.Projects.Projects(); BusinessEntities.Projects objRaveHR = null; DataSet dsViewProjectDetails = new DataSet(); dsViewProjectDetails = objViewProjectDAL.ViewProjectDetails(objViewProject, SortDir, SortExpression, UserMailID, PreSaleRole, PMRole, COORole, RPMRole, Action, clientName, projectStatusId, projectsummaryprojectname); foreach (DataRow drViewProjectDetails in dsViewProjectDetails.Tables[0].Rows) { objRaveHR = new BusinessEntities.Projects(); objRaveHR.ProjectId = int.Parse(drViewProjectDetails["ProjectID"].ToString()); objRaveHR.ProjectCode = drViewProjectDetails["ProjectCode"].ToString(); objRaveHR.ClientName = drViewProjectDetails["ClientName"].ToString(); objRaveHR.ProjectName = drViewProjectDetails["ProjectName"].ToString(); objRaveHR.ProjectStatus = drViewProjectDetails["StatusID"].ToString(); objRaveHR.Location = drViewProjectDetails["Location"].ToString(); objRaveHR.Domain = drViewProjectDetails["Domain"].ToString(); objRaveHR.ProjectCategoryID = drViewProjectDetails["ProjectCategoryID"].ToString(); objRaveHR.StandardHours = drViewProjectDetails["StandardHours"].ToString(); objRaveHR.ProjectGroup = drViewProjectDetails["ProjectGroup"].ToString(); // Mohamed : Issue : 26/09/2014 : Starts // Desc : Add Division, Business Area, Business Segment, Project Alias in Contract page -- NIS-RMS objRaveHR.ProjectDivision = String.IsNullOrEmpty(drViewProjectDetails["Division"].ToString()) ? 0 : Convert.ToInt32(drViewProjectDetails["Division"].ToString()); objRaveHR.ProjectBussinessArea = String.IsNullOrEmpty(drViewProjectDetails["BusinessArea"].ToString()) ? 0 : Convert.ToInt32(drViewProjectDetails["BusinessArea"].ToString()); objRaveHR.ProjectBussinessSegment = String.IsNullOrEmpty(drViewProjectDetails["BusinessSegment"].ToString()) ? 0 : Convert.ToInt32(drViewProjectDetails["BusinessSegment"].ToString()); //objRaveHR.ProjectAlias = drViewProjectDetails["ProjectAlias"].ToString(); // Mohamed : Issue : 23/09/2014 : Ends //Siddharth 13 March 2015 Start objRaveHR.ProjectModel = drViewProjectDetails["ProjectModel"].ToString(); //Siddharth 13 March 2015 End //Siddharth 3 August 2015 Start objRaveHR.BusinessVertical = drViewProjectDetails["BusinessVertical"].ToString(); //Siddharth 3 August 2015 End //Rakesh : HOD for Employees 12/July/2016 Begin objRaveHR.ProjectHeadId = drViewProjectDetails["ProjectHeadId"].CastToInt32(); //Rakesh : HOD for Employees 12/July/2016 End objRaveHR.Description = drViewProjectDetails["Description"].ToString(); if (!String.IsNullOrEmpty(drViewProjectDetails["StartDate"].ToString())) { objRaveHR.StartDate = DateTime.Parse(drViewProjectDetails["StartDate"].ToString()); } if (!String.IsNullOrEmpty(drViewProjectDetails["EndDate"].ToString())) { objRaveHR.EndDate = DateTime.Parse(drViewProjectDetails["EndDate"].ToString()); } objRaveHR.Reject = drViewProjectDetails["ReasonForRejection"].ToString(); objRaveHR.Delete = drViewProjectDetails["ReasonForDeletion"].ToString(); objRaveHR.OnGoingProjectStatusID = drViewProjectDetails["OnGoingProjectStatusID"].ToString(); foreach (DataRow drViewProjectDetails1 in dsViewProjectDetails.Tables[1].Rows) { objRaveHR.FirstName = drViewProjectDetails1["FullName"].ToString(); objRaveHR.EmailIdOfPM = drViewProjectDetails1["EmailId"].ToString(); } DataRelation drelCategoryTechnology = new DataRelation("Category_Technology", dsViewProjectDetails.Tables[2].Columns["ID"], dsViewProjectDetails.Tables[3].Columns["CategoryID"]); dsViewProjectDetails.Relations.Add(drelCategoryTechnology); foreach (DataRow drCategory in dsViewProjectDetails.Tables[2].Rows) { Category category = new Category(); category.CategoryId = int.Parse(drCategory["ID"].ToString()); category.CategoryName = drCategory["Category"].ToString(); objRaveHR.Categories.Add(category); foreach (DataRow drTechnology in drCategory.GetChildRows(drelCategoryTechnology)) { category.Technologies.Add(new Technology(int.Parse(drTechnology["ID"].ToString()), drTechnology["TechnologyName"].ToString(), int.Parse(drTechnology["ID"].ToString()))); } } DataRelation drelDomainSubDomain = new DataRelation("Domain_SubDomain", dsViewProjectDetails.Tables[4].Columns["ID"], dsViewProjectDetails.Tables[5].Columns["DomainID"]); dsViewProjectDetails.Relations.Add(drelDomainSubDomain); foreach (DataRow drDomain in dsViewProjectDetails.Tables[4].Rows) { Domain domain = new Domain(); domain.DomainId = int.Parse(drDomain["ID"].ToString()); domain.DomainName = drDomain["Domain"].ToString(); objRaveHR.LstDomain.Add(domain); foreach (DataRow drSubDomain in drDomain.GetChildRows(drelDomainSubDomain)) { domain.lstSubDomain.Add(new SubDomain(int.Parse(drSubDomain["ID"].ToString()), int.Parse(drSubDomain["DomainID"].ToString()), drSubDomain["SubDomainName"].ToString())); } } foreach (DataRow drWorkFlowStatus in dsViewProjectDetails.Tables[6].Rows) { objRaveHR.WorkFlowStatus = drWorkFlowStatus["Code"].ToString(); } objListViewProjectDetails.Add(objRaveHR); } return(objListViewProjectDetails); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, "RaveHRProjects.cs", "GetProjectDetails", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER); } }
/// <summary> /// Projects search result /// </summary> /// <param name="dtProjectSearchResult">DataTable</param> /// <returns>List</returns> private List <BusinessEntities.Projects> GetProjectSearchResult(DataTable dtProjectSearchResult) { List <BusinessEntities.Projects> objProjectSearchList = null; try { DataTable dt = dtProjectSearchResult; RepeaterItemCollection objRepeaterItemCollection = rpCategories.Items; DataRow[] oRows = null; StringBuilder strbTechnology = new StringBuilder(""); foreach (RepeaterItem objRepeaterItem in objRepeaterItemCollection) { Label lblCategory = (Label)objRepeaterItem.FindControl("lblCategory"); ListBox lbCategory = (ListBox)objRepeaterItem.FindControl("lbCategory"); if ((lblCategory != null) && (lbCategory != null)) { foreach (ListItem oItem in lbCategory.Items) { if (oItem.Selected == true) { strbTechnology.Append("'" + oItem.Text + "',"); } } } } string strSQL = string.Empty; bool bSelectSQL = false; if (strbTechnology.ToString() != "") { strSQL += "technologyName in (" + strbTechnology.ToString().Trim(',') + ")"; bSelectSQL = true; } if ((txtDateFrom.Text.Trim() != "") && (txtDateTo.Text.Trim() != "")) { if (bSelectSQL == true) { strSQL += " or ((startDate >= '" + txtDateFrom.Text.Trim() + "' ) and ( endDate <= '" + txtDateTo.Text.Trim() + "' ) )"; } else { strSQL = " ((startDate >= '" + txtDateFrom.Text.Trim() + "' ) and ( endDate <= '" + txtDateTo.Text.Trim() + "' ) )"; bSelectSQL = true; } } if (txtYear.Text.Trim() != "") { if (bSelectSQL == true) { strSQL += " or (( projectStartYear = '" + txtYear.Text.Trim() + "' ) or ( projectEndYear = '" + txtYear.Text.Trim() + "' )) "; } else { strSQL = " (( projectStartYear = '" + txtYear.Text.Trim() + "' ) or ( projectEndYear = '" + txtYear.Text.Trim() + "' )) "; bSelectSQL = true; } } if (txtMonth.Text.Trim() != "") { int iMonths = int.Parse(txtMonth.Text.Trim()); string strDate = DateTime.Now.AddMonths(-iMonths).ToShortDateString(); if (bSelectSQL == true) { strSQL += " or ((startDate >= '" + strDate + "' ) and (startDate <= '" + DateTime.Now.ToString() + "'))"; } else { strSQL = " ((startDate >= '" + strDate + "' ) and (startDate <= '" + DateTime.Now.ToString() + "'))"; bSelectSQL = true; } } if (bSelectSQL == false) { lblMessage.Text = "Enter Search Criteria"; lblMessage.Visible = true; return(null); } oRows = dt.Select(strSQL); objProjectSearchList = new List <BusinessEntities.Projects>(); BusinessEntities.Projects objProjects = null; foreach (DataRow objRow in oRows) { objProjects = new BusinessEntities.Projects(); objProjects.ID = int.Parse(objRow["ID"].ToString()); objProjects.ClientName = objRow["strClientName"].ToString(); objProjects.ProjectName = objRow["strProjectName"].ToString(); objProjects.Location = objRow["strLocation"].ToString(); objProjects.Category = objRow["category"].ToString(); objProjects.TechnologyName = objRow["technologyName"].ToString(); objProjects.StartDate = DateTime.Parse(objRow["startDate"].ToString()); objProjects.EndDate = DateTime.Parse(objRow["endDate"].ToString()); objProjectSearchList.Add(objProjects); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "GetProjectSearchResult", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } return(objProjectSearchList); }