Example #1
0
        private async Task <DialogTurnResult> ProcessStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            //Need to call service inside if condition TODO...
            if ((bool)stepContext.Result)
            {
                ServiceResponceModel lstServiceResult = new ServiceResponceModel();
                List <ServiceModel>  lstService       = new List <ServiceModel>();
                // lstServiceResult.LstServiceResp   = new List<ServiceModel>();

                ServiceModel s = new ServiceModel();

                // lstServiceResult.LstServiceResp.Add(s);


                //   lstServiceResult.LstServiceResp.Add(resultData);
                var customerDetails = (CustomerDetailsModel)stepContext.Options;

                var response = await CollectionServiceBL.GetServiceResponse(customerDetails.DebtorNumber, customerDetails.DebtorName);

                var resultData = JsonConvert.DeserializeObject <ServiceModel>(response.ToString());

                var messageText   = $"Customer Account balance is in Inprocess";
                var promptMessage = MessageFactory.Text(messageText, InputHints.ExpectingInput);
                return(await stepContext.PromptAsync(nameof(TextPrompt), new PromptOptions { Prompt = promptMessage }, cancellationToken));
            }
            CustomerDetailsModel c = new CustomerDetailsModel();

            c.DebtorNumber = null;
            //return await stepContext.ReplaceDialogAsync(InitialDialogId, c, cancellationToken);
            return(await stepContext.NextAsync(null, cancellationToken));
        }
Example #2
0
        public async Task <List <CarViewModel> > GetGasCarAsync()
        {
            string uri = "car/get";

            CommonRequest serviceJson = new CommonRequest(baseURL);

            ServiceResponceModel responce = await serviceJson.MakeGetRequestAsync(uri);

            var cars = JsonConvert.DeserializeObject <List <CarGasViewModel> >(responce.Message);

            return(webAdaptor.Map(cars));
        }
Example #3
0
        public async Task <int> AddNewCar(CarViewModel carView)
        {
            CommonRequest serviceJson = new CommonRequest(baseURL);

            string uri = "car/post";

            string carStr = JsonConvert.SerializeObject(webAdaptor.GetCarGas(carView));

            ServiceResponceModel responce = await serviceJson.MakePostRequestAsync(uri, carStr);

            var carID = JsonConvert.DeserializeObject <int>(responce.Message);

            return(carID);
        }
        public static SearchParameterVO GetByCustomerNumber(string customerNo)
        {
            List <CustomerModel>    objCustName      = new List <CustomerModel>();
            ServiceResponceModel    lstServiceResult = new ServiceResponceModel();
            List <ServiceModel>     lstService       = new List <ServiceModel>();
            SearchParameterVO       objSearch        = new SearchParameterVO();
            List <LstSearchParamVO> objSerchParam    = new List <LstSearchParamVO>();

            objSerchParam = new List <LstSearchParamVO> {
                new LstSearchParamVO {
                    ColumnName = "Customer.cust_no_717",
                    Name       = "Customer NUmber",
                    Condition  = "Equals",
                    ValueOne   = customerNo,
                    ValueTwo   = null
                }
            }; objSearch.UserLanguageCulture = "en-US";
            objSearch.SSOID            = "503106097";
            objSearch.VATAccess        = false.ToString();
            objSearch.lstSearchParamVO = objSerchParam;
            return(objSearch);
        }