示例#1
0
        public async Task ShouldContractorDetailsInquiry()
        {
            //Arrange
            var model = new ContractorDetailsRequestModel {
                PartyId = new PartyIdModel {
                    PartyIdNumber = "1010274503", PartyIdType = PartyType.NationalId
                }
            };
            //Act
            var result = await _YesserProxy.ContractorDetailsInquiry(model);

            //Assert
            Assert.Null(result);
        }
示例#2
0
        public async Task <SupplierInfoStatusModel> ContractorDetailsInquiry(string partyNumberId)
        {
            var parameter = new ContractorDetailsRequestModel {
                PartyId = new PartyIdModel {
                    PartyIdNumber = partyNumberId, PartyIdType = PartyType.NationalId
                }
            };
            var result = await _IYasserproxy.ContractorDetailsInquiry(parameter);

            var res = new SupplierInfoStatusModel();

            if (result == null)
            {
                res.enSupplierInfoType = Enums.SupplierInfoType.Warnning;
                res.StatusName         = Resources.TenderResources.ErrorMessages.CantFindRecord;
            }
            else
            {
                var cultureInfo = new CultureInfo("ar-SA");
                cultureInfo.DateTimeFormat.Calendar = new UmAlQuraCalendar();
                res.enSupplierInfoType = Enums.SupplierInfoType.Success;
                DateTime date = DateTime.MinValue;
                if (date < DateTime.Now)
                {
                    res.StatusName = Resources.TenderResources.Messages.Valid;
                    res.Date       = result.ContractorInfo.ClassificationDtHjr;
                }
                else
                {
                    res.enSupplierInfoType = Enums.SupplierInfoType.Wrong;

                    res.StatusName = Resources.TenderResources.Messages.Ended;
                }
            }
            return(res);
        }