Example #1
0
        private void LoadControls()
        {
            var documents           = documentService.GetDocumentsByProjectType(projectTypeId);
            var projectDocuments    = projectDocumentService.GetProjectDocumentsByProjectType(projectTypeId);
            var documentsWithFields = documentService.GetDocumentsByProjectTypeWithFields(projectTypeId);

            ViewBag.SectorList    = sectorService.GetProjectSectorParentList();
            ViewBag.SubSectorList = "";

            ViewBag.Type1DocumentList        = documents.Where(d => d.DocumentTabId == 1 && d.HasFields == false).OrderBy(d => d.DisplayOrder).ToList();
            ViewBag.StatusList               = statusService.GetStatusList();
            ViewBag.ProjectTypeFullList      = projectTypeService.GetProjectTypeList();
            ViewBag.MethodOfIntroductionList = methodOfIntroductionService.GetMethodOfIntroductionList();
            ViewBag.PriorityFrameworkList    = priorityFrameworkService.GetPriorityFrameworkList();
            ViewBag.OrganizationList         = organizationService.GetOrganizationList();
            ViewBag.ContactList              = contactService.GetContactList();
            ViewBag.DivisionList             = divisionService.GetDivisionList();
            ViewBag.EmployeeList             = employeeService.GetEmployeeList();

            ViewBag.TenderTypeList              = commonDataService.GetCommonData((int)CommonDataType.TenderType);
            ViewBag.TypeOfSaleList              = commonDataService.GetCommonData((int)CommonDataType.TypeOfSale);
            ViewBag.DocStatusList               = commonDataService.GetCommonData((int)CommonDataType.DocStatus);
            ViewBag.ContinentList               = commonDataService.GetCommonData((int)CommonDataType.Continent);
            ViewBag.PriorityList                = commonDataService.GetCommonData((int)CommonDataType.Priority);
            ViewBag.FileStatusList              = commonDataService.GetCommonData((int)CommonDataType.FileStatus);
            ViewBag.SLICCopyList                = commonDataService.GetCommonData((int)CommonDataType.SLICCopy);
            ViewBag.DocStatusExtendedList       = commonDataService.GetCommonData((int)CommonDataType.DocStatusExtended);
            ViewBag.SourceList                  = commonDataService.GetCommonData((int)CommonDataType.Source);
            ViewBag.ProceedStatusList           = commonDataService.GetCommonData((int)CommonDataType.ProceedStatus);
            ViewBag.ProjectDivisionalStatusList = commonDataService.GetCommonData((int)CommonDataType.ProjectDivisionalStatus);
            ViewBag.HotPickList                 = commonDataService.GetCommonData((int)CommonDataType.HotPick);

            ViewBag.ProjectTypeList = projectTypeService.GetProjectTypeList().Where(pt => pt.ShowInMenu == true);
        }
        public ActionResult Index()
        {
            ViewBag.ProjectTypeList = projectTypeService.GetProjectTypeList().Where(pt => pt.ShowInMenu == true);
            ViewBag.ProjectList     = projectService.GetProjects(0).Where(p => p.Code != null).ToList();

            return(View());
        }
Example #3
0
        public ActionResult GetList()
        {
            List <WFM_ProjectType> list = projectTypeService.GetProjectTypeList();

            List <BaseViewModel> modelList = new List <BaseViewModel>();

            foreach (var item in list)
            {
                modelList.Add(new BaseViewModel()
                {
                    Id = item.Id, IsActive = item.IsActive, Name = item.Name
                });
            }

            return(Json(new { data = modelList }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            ViewBag.ProjectTypeList = projectTypeService.GetProjectTypeList().Where(p => p.ShowInMenu == true).ToList();
        }
Example #5
0
        private void PrepareDashboardProjectList()
        {
            try
            {
                //List<ProjectViewModel> projectsWFM = projectService.GetProjects(0);

                //var ProjectTypes = projectsWFM.GroupBy(p => p.ProjectTypeName).ToList();

                //Dictionary<string, List<ProjectViewModel>> projectListPerType = new Dictionary<string, List<ProjectViewModel>>();

                //foreach (var ProjectType in ProjectTypes)
                //{
                //    projectListPerType.Add(ProjectType.Key, ProjectType.ToList());
                //}

                //ViewBag.ProjectTypes = projectListPerType;

                List <Dictionary <string, List <string> > > dashboardDataList = new List <Dictionary <string, List <string> > >();

                CommonDataService         commonDataService    = new CommonDataService();
                List <DAL.WFM_CommonData> divisionalStatusList = commonDataService.GetCommonData(12);
                var projectTypes = projectTypeService.GetProjectTypeList().Where(p => p.ShowInMenu == true).ToList();

                Dictionary <string, List <string> > dashboardData = new Dictionary <string, List <string> >();
                List <string> data = new List <string>();

                foreach (var commonData in divisionalStatusList)
                {
                    data.Add(commonData.Name);
                }
                data.Add("Total");
                dashboardData.Add("H", data);
                dashboardDataList.Add(dashboardData);

                var actualDashboardData = projectService.GetDashboardData();
                var typeList            = actualDashboardData.Select(t => t.Name).Distinct();

                foreach (var type in typeList)
                {
                    data = new List <string>();

                    data.Add(type);

                    var typeDataList = actualDashboardData.Where(d => d.Name == type).ToList();
                    int total        = 0;

                    foreach (var commonData in divisionalStatusList)
                    {
                        var value = typeDataList.Where(d => d.Name == type && d.TabName == commonData.Name).FirstOrDefault();
                        if (value == null)
                        {
                            data.Add("0");
                        }
                        else
                        {
                            total++;
                            data.Add(value.COU.ToString());
                        }
                    }

                    var projectType = projectTypes.Where(p => p.Name == type).FirstOrDefault();

                    if (projectType != null)
                    {
                        data.Add("<a href='/" + projectType.Path + "/Index/" + projectType.Id + "'>" + total.ToString() + "</a>");
                    }
                    else
                    {
                        data.Add(total.ToString());
                    }

                    dashboardData.Add(type, data);
                }


                ViewBag.DataList = dashboardDataList;
                ViewBag.TypeList = typeList;
            }
            catch (System.Exception ex)
            {
                log.Error("Error in loading projects : " + ex.Message);
            }
        }