Esempio n. 1
0
        public async Task <IViewComponentResult> InvokeAsync(string tenderIdString)
        {
            TenderDatesModel tenderModel = await _ApiClient.GetAsync <TenderDatesModel>("Tender/GetTenderDatesDetailsById/" + Util.Decrypt(tenderIdString), null);

            if (tenderModel != null && tenderModel.OffersOpeningDate.HasValue)
            {
                tenderModel.OffersOpeningDate = new DateTime(tenderModel.OffersOpeningDate.Value.Year, tenderModel.OffersOpeningDate.Value.Month, tenderModel.OffersOpeningDate.Value.Day);
            }

            if ((tenderModel.ChangeRequestTypeId == (int)Enums.ChangeRequestType.ExtendDates && tenderModel.ChangeRequestStatusId == (int)Enums.ChangeStatusType.Pending && (User.IsInRole(RoleNames.Auditer) || User.IsInRole(RoleNames.DataEntry) || User.IsInRole(RoleNames.PurshaseSpecialist) || User.IsInRole(RoleNames.EtimadOfficer))) ||
                (tenderModel.ChangeRequestTypeId == (int)Enums.ChangeRequestType.ExtendDates && tenderModel.ChangeRequestStatusId == (int)Enums.ChangeStatusType.New) && (User.IsInRole(RoleNames.DataEntry) || User.IsInRole(RoleNames.PurshaseSpecialist)))
            {
                var tenderRevisionDate = await _ApiClient.GetAsync <TenderRevisionDateModel>("Tender/GetRevisionDateByTenderId/" + Util.Decrypt(tenderIdString), null);

                if (tenderRevisionDate != null)
                {
                    tenderModel.TenderRevisionDate = tenderRevisionDate;
                }
            }
            if (tenderModel.ChangeRequestTypeId == (int)Enums.ChangeRequestType.ExtendDates && tenderModel.ChangeRequestStatusId == (int)Enums.ChangeStatusType.Rejected && (User.IsInRole(RoleNames.DataEntry) || User.IsInRole(RoleNames.PurshaseSpecialist)))
            {
                // get revision date for review the reject
                var tenderRevisionDate = await _ApiClient.GetAsync <TenderRevisionDateModel>("Tender/GetRejectedRevisionDateByTenderId/" + Util.Decrypt(tenderIdString), null);

                if (tenderRevisionDate != null)
                {
                    tenderModel.TenderRevisionDate = tenderRevisionDate;
                }
            }

            //TempData["isTenderDatesChanged"] = tenderModel.TenderRevisionDate != null;
            return(View(tenderModel));
        }
        public async Task <IViewComponentResult> InvokeAsync(string tenderIdString)
        {
            TenderDatesModel tenderModel = await _apiClient.GetAsync <TenderDatesModel>("Tender/GetTenderDatesDetailsById/" + Util.Decrypt(tenderIdString), null);

            return(View(tenderModel));
        }