Exemple #1
0
        public ActionResult Edit(ProjectFullView project)
        {
            if (ModelState.IsValid)
            {
                bool isSuccess = service.UpdateProject(project);
                if (isSuccess)
                {
                    return(RedirectToAction("Index"));
                }
            }
            if (project.Status != null)
            {
                var status = (Define.Status)project.Status;
                PopulateStatusDropDownList(status);
            }
            else
            {
                PopulateStatusDropDownList();
            }
            // Populate project type dropdownlist
            PopulateProjectTypeDropDownList((Define.ProjectType)project.Type);

            // Populate region dropdownlist
            PopulateRegionDropDownList((Define.Region)project.Region);

            // Populate progress status dropdownlist
            PopulateProgressStatusDropDownList((Define.ProgressStatus)project.ProgressStatus);
            return(View(project));
        }
Exemple #2
0
        public static ProjectFullView ConvertToProjectFullView(this portal_Projects project)
        {
            ProjectFullView projectFullView = new ProjectFullView()
            {
                Id              = project.Id,
                Name            = project.Name,
                Region          = project.Region,
                Address         = project.Address,
                Investor        = project.Investor,
                ProjectPackage  = project.ProjectPackage,
                CoverImageId    = project.CoverImageId,
                TotalInvestment = project.TotalInvestment,
                Duration        = project.Duration,
                ProgressStatus  = project.ProgressStatus,
                Type            = project.Type,
                SortOrder       = project.SortOrder,
                Status          = project.Status,
                Description     = project.Description,
                Description2    = project.Description2,
                share_Images    = project.share_Images.ConvertToImageProjectViewModels()
            };

            return(projectFullView);
        }