コード例 #1
0
        public ActionResult Edit(Guid id)
        {
            var contractNoticeModel = new ContractNoticeViewModel();

            if (id != Guid.Empty)
            {
                ViewBag.noticeTypes = GetComboData("NoticeContract", "NoticeType");
                ViewBag.resolutions = GetComboData("NoticeContract", "Resolution");
                var contractNoticeEntity = _contractNoticeService.GetDetailById(id);
                contractNoticeModel = _mapper.Map <ContractNoticeViewModel>(contractNoticeEntity);
                contractNoticeModel.ContractGuid = contractNoticeEntity.ResourceGuid;
                var currentUser = _userService.GetUserByUserGuid(UserHelper.CurrentUserGuid(HttpContext));
                var users       = Models.ObjectMapper <User, UserViewModel> .Map(currentUser);

                ViewBag.UpdatedBy  = users.Displayname;
                ViewBag.UpdatedOn  = CurrentDateTimeHelper.GetCurrentDateTime().ToString("MM/dd/yyyy");
                ViewBag.ResourceId = contractNoticeEntity.ContractNoticeGuid;
                contractNoticeModel.ContractNoticeGuid = contractNoticeEntity.ContractNoticeGuid;
                ViewBag.Resourcekey             = EnumGlobal.ResourceType.Contract.ToString();
                ViewBag.ContractResourceFileKey = ContractResourceFileKey.RFI.ToString();
            }
            try
            {
                return(PartialView(contractNoticeModel));
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
                return(View(contractNoticeModel));
            }
        }
コード例 #2
0
        public IActionResult Details(Guid id)
        {
            var contractNoticeViewModel = new ContractNoticeViewModel();
            var contractInfo            = _contractNoticeService.GetDetailById(id);

            contractNoticeViewModel.ContractGuid    = contractInfo.ResourceGuid;
            contractNoticeViewModel.NoticeType      = contractInfo.NoticeType;
            contractNoticeViewModel.Resolution      = contractInfo.Resolution;
            contractNoticeViewModel.LastUpdatedDate = contractInfo.LastUpdatedDate;
            contractNoticeViewModel.IssuedDate      = contractInfo.IssuedDate;

            return(PartialView(contractNoticeViewModel));
        }
コード例 #3
0
        /// <summary>
        /// Metorda zwracająca klasę zawierającą elementy wyświetlane na stronie szczegółów zamówienia publicznego
        /// </summary>
        /// <param name="currentUmbracoPageId">id strony umbraco na której się znajdujemy</param>
        /// <returns>Model zawierający szczegóły zamówienia publicznego</returns>
        public ContractNoticeViewModel GetNoticeDetails(int currentUmbracoPageId)
        {
            var _noticeNode = _umbracoHelper.TypedContent(currentUmbracoPageId);
            var _model      = new ContractNoticeViewModel(_noticeNode);

            #region Dokumenty
            if (_model.AttachmentsList != null)
            {
                _model.DownloadDocuments = _model.AttachmentsList.Fieldsets.Where(x => x != null && x.Properties.Any() && !x.Disabled).Select(q => new DownloadItem()
                {
                    DocumentUrl  = q.GetValue <string>("addDoc"),
                    DocumentName = q.GetValue <string>("articleDocName"),
                    DocumentDate = q.GetValue <DateTime>("chooseDate")
                });
            }
            #endregion

            return(_model);
        }
コード例 #4
0
        public IActionResult Edit([FromBody] ContractNoticeViewModel contractNoticeModel)
        {
            List <string>  filePath = new List <string>();
            Guid           id       = Guid.NewGuid();
            ContractNotice model    = new ContractNotice();

            model.ContractNoticeGuid = id;
            model.IssuedDate         = contractNoticeModel.IssuedDate;
            model.LastUpdatedDate    = DateTime.Now;
            model.NoticeType         = contractNoticeModel.NoticeType;
            model.Resolution         = contractNoticeModel.Resolution;
            model.ResourceGuid       = contractNoticeModel.ContractGuid;
            model.NoticeDescription  = contractNoticeModel.NoticeDescription;
            model.UpdatedBy          = UserHelper.CurrentUserGuid(HttpContext);
            var data = _contractNoticeService.GetParentId(ContractResourceFileKey.RFI.ToString(), model.ResourceGuid);

            _contractNoticeService.Add(model);
            return(Ok(new { status = ResponseStatus.success.ToString(), message = "Successfully Added !!", istriggered = false, contractGuid = contractNoticeModel.ContractGuid, resourceId = contractNoticeModel.ContractGuid, ContentResourceGuid = id, uploadPath = data?.FilePath, parentid = data?.ContractResourceFileGuid, contractResourceFileKey = ContractResourceFileKey.RFI.ToString() }));
        }
コード例 #5
0
        public ActionResult Add(Guid contractGuid)
        {
            var contractNoticeViewModel = new ContractNoticeViewModel();

            try
            {
                ViewBag.noticeTypes = GetComboData("NoticeContract", "NoticeType");
                ViewBag.resolutions = GetComboData("NoticeContract", "Resolution");
                var contractInfo = _contractService.GetInfoByContractGuid(contractGuid);
                contractNoticeViewModel.ContractGuid   = contractGuid;
                contractNoticeViewModel.ContractTitle  = contractInfo.ContractTitle;
                contractNoticeViewModel.ProjectNumber  = contractInfo.ProjectNumber;
                contractNoticeViewModel.ContractNumber = contractInfo.ContractNumber;
                contractNoticeViewModel.ActionItem     = "Add";
                ViewBag.Resourcekey             = EnumGlobal.ResourceType.Contract.ToString();
                ViewBag.ContractResourceFileKey = ContractResourceFileKey.RFI.ToString();
                return(PartialView(contractNoticeViewModel));
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
                return(View(contractNoticeViewModel));
            }
        }
コード例 #6
0
        public ActionResult GetDetailsByNoticeType(string Noticetype, Guid ResourceId, string searchValue, int pageSize, int skip, int take, string sortField, string dir)
        {
            var noticeDetails = _contractNoticeService.GetDetailsByNoticeType(Noticetype, ResourceId, searchValue, pageSize, skip, take, sortField, dir);

            var userName = "";
            List <ContractNoticeViewModel> lists = new List <ContractNoticeViewModel>();

            foreach (var data in noticeDetails)
            {
                ContractNoticeViewModel vm = new ContractNoticeViewModel();
                var userDetails            = _userService.GetUserByUserGuid(data.UpdatedBy);
                if (userDetails != null)
                {
                    userName = userDetails.DisplayName;
                }
                vm.Attachment        = HttpUtility.HtmlDecode(data.Attachment);
                vm.UpdatedBy         = userName;
                vm.NoticeDescription = data.NoticeDescription;
                vm.Resolution        = data.Resolution;
                vm.LastUpdatedDate   = data.LastUpdatedDate;
                lists.Add(vm);
            }
            return(Ok(new { result = lists, count = _contractNoticeService.GetNoticeViewDetailsCount(Noticetype, ResourceId) }));
        }