Ejemplo n.º 1
0
        public ActionResult Detail(Guid id)
        {
            var contractQuestionaireEntity = _contractQuestionariesService.GetContractQuestionariesById(id);
            var contractQuestionaireModel  = _mapper.Map <ContractQuestionaireViewModel>(contractQuestionaireEntity);

            contractQuestionaireModel.radioWarrantyProvision    = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioCPARS                = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioFARClause            = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioGovFurnishedProperty = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioGQAC        = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioGSAschedule = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioReportingExecCompensation = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioSBsubcontracting          = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioServiceContractReport     = KeyValueHelper.GetYesNo();
            contractQuestionaireModel.radioWarranties = KeyValueHelper.GetYesNo();
            try
            {
                return(PartialView(contractQuestionaireModel));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(ex.ToString(), ex.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 2
0
        public IActionResult Edit(Guid id)
        {
            try
            {
                var jobRequestEntity = _jobRequestService.GetDetailsForJobRequestById(id);
                var model            = ContractsMapper.MapJobRequestToViewModel(jobRequestEntity);

                if (model.Parent_ContractGuid == null)
                {
                    model.BaseUrl = "Contract";
                }
                else
                {
                    model.BaseUrl = "Project";
                    var parentContractDetails = _contractRefactorService.GetBasicContractById(model.Parent_ContractGuid ?? Guid.Empty);
                    var parentContractNumber  = parentContractDetails == null ? "N/A" : parentContractDetails.ContractNumber;
                    model.BasicContractInfo.ParentProjectNumber = parentContractDetails == null ? "N/A" : parentContractDetails.ProjectNumber;
                }
                var companyListEntity = _jobRequestService.GetCompanyData();
                var companyList       = _mapper.Map <ICollection <Models.ViewModels.KeyValuePairModel <Guid, string> > >(companyListEntity);
                var companies         = model.Companies;

                var questionaire = _mapper.Map <Models.ViewModels.Contract.ContractQuestionaireViewModel>(jobRequestEntity.Contracts.ContractQuestionaire);
                model.ContractQuestionaire = questionaire;
                List <string> companySelected = new List <string>();
                if (!string.IsNullOrEmpty(companies))
                {
                    var listCompany = companies.Split(",");
                    foreach (var name in listCompany)
                    {
                        companySelected.Add(name);
                    }
                }

                model.CompanySelected = companySelected;
                model.companyList     = companyList;
                model.radioIsIntercompanyWorkOrder = KeyValueHelper.GetYesNo();
                model.ContractGuid         = id;
                model.JobRequestGuid       = id;
                model.farContractViewModel = GetFarContract(model.ContractGuid);
                return(View(model));
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 3
0
        private FarContractViewModel GetByContractGuid(Guid id, string Action)
        {
            var viewModel           = new FarContractViewModel();
            var contractQuestionary = new ContractQuestionaireViewModel();

            Guid farContractType  = _contractService.GetFarContractTypeGuidById(id);
            var  farContractModel = _farContractTypeService.GetById(farContractType);
            var  list             = _farContractService.GetRequiredData(id, farContractType);

            viewModel.FarContractTypeCode            = farContractModel.Code;
            viewModel.FarContractTypeName            = farContractModel.Title;
            viewModel.ContractGuid                   = id;
            contractQuestionary.DictionaryBoolString = KeyValueHelper.GetYesNo();
            viewModel.ContractQuestionaires          = contractQuestionary;
            viewModel.RequiredFarClauses             = list;
            viewModel.Questionniare                  = _contractQuestionariesService.GetContractQuestionaries(ResourceType.FarContract.ToString(), Action, id).ToList();

            return(viewModel);
        }
Ejemplo n.º 4
0
        public IActionResult Add(Guid id)
        {
            try
            {
                var jobRequestEntity  = _jobRequestService.GetDetailsForJobRequestById(id);
                var model             = ContractsMapper.MapJobRequestToViewModel(jobRequestEntity);
                var companyListEntity = _jobRequestService.GetCompanyData();
                var companyList       = _mapper.Map <ICollection <Models.ViewModels.KeyValuePairModel <Guid, string> > >(companyListEntity);
                if (model.Parent_ContractGuid == null)
                {
                    model.BaseUrl = "Contract";
                }
                else
                {
                    model.BaseUrl = "Project";
                    var parentContractDetails = _contractRefactorService.GetBasicContractById(model.Parent_ContractGuid ?? Guid.Empty);
                    var parentContractNumber  = parentContractDetails == null ? "N/A" : parentContractDetails.ContractNumber;
                    model.BasicContractInfo.ParentProjectNumber = parentContractDetails == null ? "N/A" : parentContractDetails.ProjectNumber;
                }
                model.companyList = companyList;
                model.Status      = (int)JobRequestStatus.ContractRepresentative;
                model.radioIsIntercompanyWorkOrder = KeyValueHelper.GetYesNo();
                model.ContractGuid = id;

                var questionaire = _mapper.Map <Models.ViewModels.Contract.ContractQuestionaireViewModel>(jobRequestEntity.Contracts.ContractQuestionaire);
                model.ContractQuestionaire = questionaire;
                model.farContractViewModel = GetFarContract(model.ContractGuid);
                model.IsNew = true;
                return(View(model));
            }
            catch (Exception e)
            {
                ModelState.AddModelError(e.ToString(), e.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 5
0
 public ActionResult Add(Guid id)
 {
     try
     {
         var contractQuestionaireModel = new ContractQuestionaireViewModel();
         contractQuestionaireModel.ContractGuid              = id;
         contractQuestionaireModel.radioCPARS                = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioFARClause            = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioGovFurnishedProperty = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioGQAC        = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioGSAschedule = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioReportingExecCompensation = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioSBsubcontracting          = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioServiceContractReport     = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioWarranties        = KeyValueHelper.GetYesNo();
         contractQuestionaireModel.radioWarrantyProvision = KeyValueHelper.GetYesNo();
         return(PartialView(contractQuestionaireModel));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(ex.ToString(), ex.Message);
         return(BadRequest(ModelState));
     }
 }