Exemplo n.º 1
0
        /// <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);
            }
        }