Esempio n. 1
0
        private void SendEmail(BookingData bookingData)
        {
            string        from     = ConfigurationManager.AppSettings["From"];
            string        to       = bookingData.Gegevens.Email;
            string        subject  = string.Empty;
            string        bodyHtml = string.Empty;
            List <string> emailTos = new List <string>();

            emailTos.Add(to);

            if (bookingData.BookingType == BookingType.Reservation)
            {
                subject  = string.Format("{0} {1}", ConfigurationManager.AppSettings["CamperSubject"], bookingData.ReserveringsNummer);
                bodyHtml = RazorHelper.Parse("App_Data/EmailTemplates/Reservation.cshtml", bookingData);
            }
            else
            {
                subject  = string.Format("{0} {1}", ConfigurationManager.AppSettings["CamperOfferSubject"], bookingData.ReserveringsNummer);
                bodyHtml = RazorHelper.Parse("App_Data/EmailTemplates/Offer.cshtml", bookingData);
            }

            EmailModel email = new EmailModel();

            email.Body    = bodyHtml;
            email.From    = from;
            email.To      = emailTos.ToArray();
            email.Subject = subject;

            _emailService.Send(email);
        }
Esempio n. 2
0
        private decimal getPackagePrice(BookingData bookingData, PakketModel pakket)
        {
            decimal total             = 0;
            var     aantalDagen       = bookingData.NumberOfTravelDays;
            var     aantalVolwassenen = bookingData.NumberOfAdults;
            var     aantalKinderen    = bookingData.NumberOfChildrens;
            var     aantalPersonen    = (aantalVolwassenen + aantalKinderen);
            var     tempPrijs         = pakket.IsLokaalTeBetalen ? pakket.Prijs : (pakket.Prijs * pakket.Valuta.Koers);

            //Controleer pakkettype. 10 = Pakketprijs per dag.
            if (pakket.PakketType == 10)
            {
                tempPrijs = tempPrijs * aantalDagen;
            }

            if ((bool)pakket.IsPerPersoon)
            {
                total = tempPrijs * aantalPersonen;
            }
            else
            {
                total = tempPrijs;// total += tempPrijs/ aantalPersonen;
            }

            return(Math.Round(total, 2));
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            BookingClient client = new BookingClient();

            while (true)
            {
                try
                {
                    BookingData[] bookings =
                        client.ViewBookingsFrom(DateTime.Now);
                    Console.WriteLine("Det finns " + bookings.Length
                                      + " bokningar");

                    BookingData data = new BookingData();
                    data.Name           = Console.ReadLine();
                    data.EventStartTime = DateTime.Now;
                    data.EventStopTime  = DateTime.Now;
                    bool result = client.MakeBooking(data);
                    if (result)
                    {
                        Console.WriteLine("Bokningen lyckades");
                    }
                    else
                    {
                        Console.WriteLine("Bokningen misslyckades");
                    }
                }
                catch (WebException we)
                {
                    Console.WriteLine("Tjänsten failade");
                    Console.ReadLine();
                }
            }
        }
        public ActionResult BookingForm(BookingData formData)
        {
            BookingClient client = new BookingClient();

            client.MakeBooking(formData);
            return(RedirectToAction("Index"));
        }
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime fromdate  = DateTime.Parse(BookingFromDate.Text);
                DateTime todate    = DateTime.Parse(BookingToDate.Text);
                double   TotalDays = (todate - fromdate).TotalDays;

                BookingData bd = new BookingData
                {
                    BookingDate    = DateTime.Now,
                    BookedfromDate = fromdate,
                    BookedToDate   = todate,
                    VehicleId      = int.Parse(Request.QueryString["id"]),
                    TotalNoOfDays  = int.Parse(TotalDays.ToString()),
                    Amount         = int.Parse(Request.QueryString["Amount"]) * int.Parse(TotalDays.ToString())
                };
                if (BAL.UserActivities.addBookingDetails(bd))
                {
                    Response.Redirect("~/Payment.aspx");
                }
            }

            catch (Exception ex)
            {
            }
        }
Esempio n. 6
0
        public void InsertRecordTest()
        {
            BookingData q = new BookingData();

            q.FirstName = "jens";
            q.LastName  = "bONDEMAND";
            Assert.IsTrue(true);
        }
        private void ResetBoekingsDataSession()
        {
            var tempAanbiedingCriteria = BookingData.OfferCriteria;

            BookingData = new BookingData {
                OfferCriteria = tempAanbiedingCriteria
            };
        }
Esempio n. 8
0
        public void BookingData_InvalidData_EmptyStrings(string firstName, string lastName)
        {
            BookingData bookingData = new BookingData {
                FirstName = firstName, LastName = lastName
            };

            Assert.AreEqual(firstName, bookingData.FirstName ?? "");
            Assert.AreEqual(lastName, bookingData.LastName ?? "");
        }
Esempio n. 9
0
        public void BookingData_ValidData()
        {
            BookingData bookingData = new BookingData {
                FirstName = "Marina", LastName = "Michaels"
            };

            Assert.AreEqual("Marina", bookingData.FirstName);
            Assert.AreEqual("Michaels", bookingData.LastName);
        }
Esempio n. 10
0
        public void BookingData_InvalidData_NullPointers(string firstName, string lastName)
        {
            BookingData bookingData = new BookingData {
                FirstName = firstName, LastName = lastName
            };

            Assert.AreEqual(firstName, bookingData.FirstName);
            Assert.AreEqual(lastName, bookingData.LastName);
        }
Esempio n. 11
0
        public IBooking GetNewDo(string value)
        {
            var newDto = new BookingDto();

            newDto.CodeId = value;
            newDto.IsNew  = true;
            var domainObject = new BookingData(newDto);

            return(domainObject);
        }
Esempio n. 12
0
        public decimal?Pricing([FromBody] BookingData bookingData)
        {
            if (!bookingData.IsValid())
            {
                return(null);
            }

            bookingData.SetPrice();
            return(bookingData.Price);
        }
Esempio n. 13
0
        private static async Task FillOutBookingDataAsync(ConversationFlow flow, BookingData data, ITurnContext turnContext, CancellationToken cancellationToken)
        {
            string input   = turnContext.Activity.Text?.Trim();
            var    buttons = new List <CardAction>()
            {
                new CardAction()
                {
                    Title = "ใช่", Type = ActionTypes.ImBack, Value = "ใช่"
                },
                new CardAction()
                {
                    Title = "ไม่", Type = ActionTypes.ImBack, Value = "ไม่ใช่"
                }
            };

            switch (flow.LastQuestionState)
            {
            case ConversationFlow.QuestionState.None:
                await SendCardAsync(turnContext, buttons, cancellationToken);

                flow.LastQuestionState = ConversationFlow.QuestionState.IsAcceptBooking;
                break;

            case ConversationFlow.QuestionState.IsAcceptBooking:
                if (turnContext.Activity.Text == "ใช่")
                {
                    await turnContext.SendActivityAsync("โปรดใส่รหัสพนักงานของคุณ");

                    flow.LastQuestionState = ConversationFlow.QuestionState.EmployeeId;
                }
                else
                {
                    await SendCardAsync(turnContext, buttons, cancellationToken);
                }
                break;

            case ConversationFlow.QuestionState.EmployeeId:
                if (!string.IsNullOrWhiteSpace(input))
                {
                    data.EmployeeId = input;

                    flow.LastQuestionState = ConversationFlow.QuestionState.RoomNo;
                }
                else
                {
                    await turnContext.SendActivityAsync("เกิดข้อผิดพลาดกับการกรอกรหัสพนักงาน กรุณากรอกอีกครั้ง");
                }
                break;

            default:
                await turnContext.SendActivityAsync(data.EmployeeId);

                break;
            }
        }
Esempio n. 14
0
        public static BookingData GetBooking(string userId, string bookingId)
        {
            BookingData bookingData = null;

            if (bookings.ContainsKey(userId))
            {
                bookingData = bookings[userId].FirstOrDefault(booking => booking.Id == bookingId);
            }

            return(bookingData);
        }
Esempio n. 15
0
        public static void AddBooking(string userId, BookingData bookingData)
        {
            if (!bookings.ContainsKey(userId))
            {
                bookings.Add(userId, new List <BookingData>());
            }

            GenerateId(bookingData);
            List <BookingData> userReservations = bookings[userId];

            userReservations.Add(bookingData);
        }
Esempio n. 16
0
        public void EmptyNameTest()
        {
            Pages.MainPage mainPage = new Pages.MainPage(this.driver);
            mainPage.NewMainData("Минск", "Москва", "2018-12-11", "2018-12-12", 0);
            Pages.BookingPage BookingPage = new Pages.BookingPage(this.driver);
            BookingData       bookingData = new BookingData();

            bookingData.surname = "";
            bookingData.name    = "";
            BookingPage.NewBookingData(bookingData); //BookingPage.NewBookingData("", "", "10-10-1990", "ггггггггг", "122345678", "10-10-2020", "ггггггггг", "12341234567", "*****@*****.**");
            Assert.AreEqual(BookingPage.GetErrorMessage(), "Вам необходимо ввести фамилию латинскими буквами.");
        }
Esempio n. 17
0
        /// <summary>
        /// GET https://app.seats.io/api/event/{eventKey}/orders/{orderId}/{secretKey}
        /// http://www.seats.io/docs/api#api-reference-booking-and-releasing-objects-orders
        /// </summary>
        /// <returns>The Response response will be an array of seat id’s, like this: ["A-3","A-5"]</returns>
        public List <string> Order(BookingData booking)
        {
            Connect connect = new Connect();

            endPoint = String.Format("api/event/{0}/orders/{1}/{2}", booking.eventKey, booking.orderId, booking.secretKey);
            connect.Request(Connect.Methods.GET, endPoint, null);
            var reservationToken = connect.Data;
            var json             = connect.Data;

            var response = new JavaScriptSerializer().Deserialize <List <String> >(json);

            return(response);
        }
        public IActionResult Put(int id, [FromBody] BookingData values)
        {
            var booking = new Booking
            {
                Id              = id,
                IdClient        = values.IdClient,
                IdTravelPackage = values.IdTravelPackage,
                Cost            = values.Cost,
                Client          = values.Client,
                TravelPackage   = values.TravelPackage
            };

            _service.Update(booking);
            _service.Save();
            return(Ok());
        }
Esempio n. 19
0
        public async Task <IActionResult> CreateBooking(BookingData data)
        {
            if (ModelState.IsValid)
            {
                await _context.Bookings.AddAsync(data);

                await _context.SaveChangesAsync();

                return(CreatedAtAction("GetBooking", new { data.Id }, data));
            }

            return(new JsonResult("Somethign Went wrong")
            {
                StatusCode = 500
            });
        }
Esempio n. 20
0
        public bool FinalizeBooking([FromBody] ArrayList paramList)
        {
            int        screeningId    = JsonConvert.DeserializeObject <int>(paramList[0].ToString());
            int        ticketId       = JsonConvert.DeserializeObject <int>(paramList[1].ToString());
            string     firstName      = paramList[2].ToString();
            string     lastName       = paramList[3].ToString();
            string     emailAddress   = paramList[4].ToString();
            List <int> seatsToReserve = JsonConvert.DeserializeObject <List <int> >(paramList[5].ToString());

            BookingData data = new BookingData(_config);

            bool result = data.FinalizeBooking(screeningId, ticketId, firstName,
                                               lastName, emailAddress, seatsToReserve);

            return(result);
        }
Esempio n. 21
0
        /// <summary>
        /// POST https://app.seats.io/api/reserve
        /// DOC <a href="http://www.seats.io/docs/api#api-reference-booking-and-releasing-objects-temporarily-reserving-objects">Reserve objects</a>
        /// </summary>
        /// <returns>Success</returns>
        public bool Reserve(BookingData booking)
        {
            try
            {
                Connect connect = new Connect();
                endPoint = "api/reserve";
                var jdata = JObject.FromObject(booking);
                connect.Request(Connect.Methods.POST, endPoint, jdata);

                return(true);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                return(false);
            }
        }
Esempio n. 22
0
        // Implement a interface method!
        public void SqlQuery(BookingData userinput, string connectionString)
        {
            // Use connection to database!
            using (SqlConnection sqlConn = new SqlConnection(connectionString))
            {
                // Open database connection!
                sqlConn.Open();

                // SQL Commands!
                SqlCommand cmd = new SqlCommand("Contact_StoredProcedure", sqlConn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Phonenumber", userinput.Phonenumber);
                cmd.Parameters.AddWithValue("@Email", userinput.Email);

                cmd.ExecuteNonQuery();
                sqlConn.Close();

                sqlConn.Open();

                SqlCommand cmd1 = new SqlCommand("Pay_StoredProcedure", sqlConn);
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@Paymentcard", userinput.Paymentcard);

                cmd1.ExecuteNonQuery();
                sqlConn.Close();

                sqlConn.Open();

                string     query2 = "INSERT INTO Customer (firstName, lastName, addr, zipcode, contactID, payID) VALUES(@FirstName, @LastName, @Address, @Zipcode, (SELECT contactID FROM Customer_Contact WHERE contactID = (SELECT MAX(contactID) FROM Customer_Contact)), (SELECT payID FROM Customer_Pay WHERE payID = (SELECT MAX(payID) FROM Customer_Pay)))";
                SqlCommand cmd2   = new SqlCommand(query2, sqlConn);
                cmd2.Parameters.AddWithValue("@FirstName", userinput.FirstName);
                cmd2.Parameters.AddWithValue("@LastName", userinput.LastName);
                cmd2.Parameters.AddWithValue("@Address", userinput.Address);
                cmd2.Parameters.AddWithValue("@Zipcode", userinput.Zipcode);

                string     query3 = "INSERT INTO CusRes_Keys (custID, reservID) VALUES((SELECT custID FROM Customer WHERE custID = (SELECT MAX(custID) FROM Customer)), (SELECT reservID FROM Reservation WHERE reservID = (SELECT MAX(reservID) FROM Reservation)))";
                SqlCommand cmd3   = new SqlCommand(query3, sqlConn);

                cmd2.ExecuteNonQuery();
                cmd3.ExecuteNonQuery();

                // Close database connection!
                sqlConn.Close();
            }
        }
        public async Task <IActionResult> Create([FromRoute] Guid accommodationId, [FromBody] BookingData bookingData)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var booking = await service.BookAsync(accommodationId, mapper.MapFrom(bookingData));

                    return(CreatedAtAction("Find", new { id = booking.Id }, mapper.MapFrom(booking)));
                }

                return(BadRequest());
            }
            catch (AccommodationNotFoundException)
            {
                return(NotFound());
            }
        }
Esempio n. 24
0
 public void NewBookingData(BookingData bookingData)
 {
     wait.Until(ExpectedConditions.ElementToBeClickable(bookingSite));
     bookingSite.Click();
     wait.Until(ExpectedConditions.ElementToBeClickable(surname));
     surname.SendKeys(bookingData.surname + Keys.Enter);
     name.SendKeys(bookingData.name + Keys.Enter);
     birthDate.SendKeys(bookingData.birthDate + Keys.Enter);
     passportCountry.SendKeys(bookingData.passportCountry + Keys.Enter);
     passportNumber.SendKeys(bookingData.passportNumber + Keys.Enter);
     passportDate.SendKeys(bookingData.passportDate + Keys.Enter);
     genderBoy.Click();
     country.SendKeys(bookingData.country + Keys.Enter);
     phone.SendKeys(bookingData.phone + Keys.Enter);
     email.SendKeys(bookingData.email + Keys.Enter);
     bookingAgree.Click();
     bookingButton.Click();
 }
Esempio n. 25
0
        public async Task <IActionResult> CreateBooking([FromBody] BookingData body, int flightNumber)
        {
            if (ModelState.IsValid && flightNumber.IsPositiveInteger())
            {
                string name = $"{body.FirstName} {body.LastName}";
                (bool result, Exception exception) = await _bookingService.CreateBooking(name, flightNumber);

                if (result && exception == null)
                {
                    return(StatusCode((int)HttpStatusCode.Created));
                }

                return(exception is CouldNotAddBookingToDatabaseException
                    ? StatusCode((int)HttpStatusCode.NotFound)
                    : StatusCode((int)HttpStatusCode.InternalServerError, exception.Message));
            }

            return(StatusCode((int)HttpStatusCode.InternalServerError, ModelState.Root.Errors.First().ErrorMessage));
        }
Esempio n. 26
0
        public BookingResult Book([FromBody] BookingData bookingData)
        {
            if (!bookingData.IsValid())
            {
                return new BookingResult()
                       {
                           Errors = new List <string>()
                           {
                               "Informações inválidas para a reserva"
                           }
                       }
            }
            ;

            StringValues values;

            if (Request.Headers.TryGetValue("UserID", out values))
            {
                bookingData.SetPrice();

                var userId = values[0];
                BookingRepository.AddBooking(userId, bookingData);

                return(new BookingResult()
                {
                    Id = bookingData.Id
                });
            }
            else
            {
                return new BookingResult()
                       {
                           Errors = new List <string>()
                           {
                               "Usuário não identificado"
                           }
                       }
            };
        }
Esempio n. 27
0
        private async Task <DialogTurnResult> ConfirmBookingStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var previousResult = (stepContext.Result as IList <DateTimeResolution>)?.FirstOrDefault().Value;
            var timeTo         = DateTime.Parse(previousResult).TimeOfDay;

            var bookingData = new BookingData();

            bookingData.AssetId     = (int)stepContext.Values["AssetId"];
            bookingData.EmployeeId  = (string)stepContext.Values["EmployeeId"];
            bookingData.BookingDate = (DateTime)stepContext.Values["BookingDate"];
            bookingData.TimeFrom    = ((DateTime)stepContext.Values["TimeFrom"]).TimeOfDay;
            bookingData.TimeTo      = timeTo;

            var attachments = new List <Attachment>();
            var reply       = MessageFactory.Attachment(attachments);
            var listFact    = new List <Fact>();

            listFact.Add(new Fact("ห้องที่", bookingData.AssetId.ToString()));
            listFact.Add(new Fact("Employee Id", bookingData.EmployeeId));
            listFact.Add(new Fact("วันที่จอง", bookingData.BookingDate.ToString("dd MMM yyyy")));
            listFact.Add(new Fact("ช่วงเวลาที่จอง", $"{bookingData.TimeFrom.ToString(@"hh\:mm")} - {bookingData.TimeTo.ToString(@"hh\:mm")}"));
            var summaryBooking = new ReceiptCard
            {
                Title = "ยืนยันการจอง",
                Facts = listFact
            };

            //Line and Messengers can't show receipt card
            reply.Attachments.Add(summaryBooking.ToAttachment());

            await stepContext.Context.SendActivityAsync(reply, cancellationToken);

            return(await stepContext.PromptAsync(nameof(ConfirmPrompt),
                                                 new PromptOptions
            {
                Prompt = MessageFactory.Text("ข้อมูลถูกต้องหรือไม่ ?")
            }, cancellationToken));
        }
Esempio n. 28
0
 private static void GenerateId(BookingData bookingData)
 {
     bookingData.Id = Guid.NewGuid().ToString().Split('-')[0];
 }
 public Table VerifySpots(ParkingLot parkingTable, Table bookingTable, DateTime lowerLimit, DateTime upperLimit)
 {
     BookingData bookingData = new BookingData();
     return bookingData.VerifyReserve(parkingTable, bookingTable, lowerLimit, upperLimit);
 }
 public void InsertBooking(Booking bookingToAdd)
 {
     BookingData bookingData = new BookingData();
     bookingData.Insert(bookingToAdd);
 }
 public DataTable GetReportForSecurity(ParkingLot parkingLot, DateTime initialHour)
 {
     BookingData bookingData = new BookingData();
        return  bookingData.GetBookigsForSecurity(parkingLot, initialHour);
 }
    public DataTable GetReportBooking()
    {
        BookingData bookingData = new BookingData();

            return bookingData.GetReportBooking();
    }
 public void DenyBooking(Booking bookingToDeny, DateTime lowerLimit, DateTime upperLimit)
 {
     BookingData bookingData = new BookingData();
     bookingData.Update(bookingToDeny, lowerLimit, upperLimit);
 }
 public BookingDetails MapFrom(BookingData data)
 {
     return(Mapper.Map <BookingDetails>(data));
 }
Esempio n. 35
0
        public async Task <IActionResult> Index()
        {
            try {
                #region Qurey Booking Data from MySql then add to object
                TimeSpan fromTime = new TimeSpan(7, 0, 0);
                TimeSpan toTime   = new TimeSpan(20, 0, 0);
                var      from     = (DateTime.Now.Date).Add(fromTime);
                var      to       = DateTime.Now.Date.Add(toTime);
                var      strSql   = $"select '' as No,'' as QRCode,substring(item.barcode, 2, 12) as Reference1,'' as Reference2,'' as Reference3,'' as Reference4,if (parcels.cod_amount > 0 ,'True','False')as IsPOSTPAY,if (parcels.cod_amount > 0 ,parcels.cod_amount,0)as POSTPAYAmount,parcels.recipient_name as ReceiveName,parcels.recipient_tel as Mobile,'' as Mobile2,parcels.recipient_address as Address,'' as Subdistrict,if (parcels.recipient_district <> '',parcels.recipient_district,postalCode.district)as District,postalCode.province as Province,parcels.recipient_zipcode as PostalCode,parcels.user_note as Remark,'' as ExchangeType,'' as ExchangeRemark,'' as Email,'' as Email2,1 as ItemNo,'' as SupplierSKU,'' as VendorSKU,'' as MerchantSKU,'' as ProductEANUPC,'Products 1' as ProductName,'' as ProductSize,'' as ProductColor,1 as ProductQuantity,'' as FulfillmentRemark,org.name as MerchantName,postalCode.province as MerchantAddress,org.name as MerchantContactPerson,org.phone as MerchantMobile ,orgGeo.json_info as GeographicLocation from tbl_manifest_items item left join tbl_manifest_sheets sheet on sheet.id = item.sheet_id left join tbl_scg_parcels parcels on parcels.tracking_number = item.barcode left join tbl_scg_postalCode postalCode on postalCode.postal_code = parcels.recipient_zipcode left join tbl_organization org on org.customer_code = parcels.sender_code left join tbl_auth_users user on user.id = item.user_created left join tbl_organization orgGeo on orgGeo.organization_id = user.organization_id where sheet.branch_destination = 'Alpha Fast' and item.status_deleted = 'N' and item.date_created between '2020-03-31' and '2020-03-31 20:00:00' and org.name is not null group by item.barcode";

                var data = await appQuery.AlphaBookingViewModelsAsync <AlphaBookingViewModel>(strSql);

                var merchantName = from x in data.ToList() group x by x.MerchantName into g orderby g.Key
                                   select new {
                    MerchantName          = g.FirstOrDefault().MerchantName,
                    MerchantAddress       = g.FirstOrDefault().MerchantAddress,
                    MerchantContactPerson = g.FirstOrDefault().MerchantContactPerson,
                    IsNewReturn           = false,
                    Province    = g.FirstOrDefault().Province,
                    District    = g.FirstOrDefault().District,
                    Subdistrict = g.FirstOrDefault().Subdistrict,
                    Latitude    = g.FirstOrDefault().GeographicLocation.Split('"').ToArray(),
                    Longitude   = g.FirstOrDefault().GeographicLocation.Split('"').ToArray(),
                };
                List <MerchantData> merchantDatas = new List <MerchantData>();
                var    i      = 0;
                Random random = new Random();

                foreach (var m in merchantName)
                {
                    List <BookingData> bookingDatas = new List <BookingData>();
                    var bookings = data.Where(x => x.MerchantName == m.MerchantName);
                    foreach (var b in bookings)
                    {
                        var         ran         = random.Next(111111111, 999999999);
                        var         mobile      = CorrectMobile(b.Mobile);
                        BookingData bookingData = new BookingData()
                        {
                            QRCode         = $"SCG{ran}",
                            Reference1     = b.Reference1,
                            CustomerRemark = null,
                            IsPOSTPAY      = b.IsPOSTPAY == "True" ? true : false,
                            Amount         = b.POSTPAYAmount,
                            Firstname      = b.ReceiveName.Length <= 50 ? b.ReceiveName : b.ReceiveName.Substring(0, 50),
                            Lastname       = b.ReceiveName.Length <= 50 ? b.ReceiveName : b.ReceiveName.Substring(0, 50),
                            Mobile         = util.CorrectMobileFormat(b.Mobile),
                            Address        = b.Address,
                            Province       = b.Province,
                            district       = b.District,
                            Subdistrict    = b.Subdistrict,
                            PostalCode     = b.PostalCode,
                            IsExchange     = false,
                            IsIVR          = false,
                            IsInsurance    = false,
                            IsSameDay      = false
                        };
                        bookingDatas.Add(bookingData);
                    }

                    MerchantData merchantData = new MerchantData()
                    {
                        MerchantName          = m.MerchantName,
                        MerchantAddress       = m.MerchantAddress,
                        MerchantContactPerson = m.MerchantContactPerson,
                        IsNewReturn           = false,
                        Province    = m.Province,
                        District    = m.District,
                        Subdistrict = m.Subdistrict,
                        Latitude    = 13.736831,  //Convert.ToDouble(m.Latitude[3]),
                        Longitude   = 100.606181, //Convert.ToDouble(m.Longitude[7]),
                        BookingData = bookingDatas
                    };
                    merchantDatas.Add(merchantData);

                    DeliveryOrderRequest deliveryOrder = new DeliveryOrderRequest()
                    {
                        MerchantData      = merchantDatas,
                        AppointmentDateId = 2,
                        AppointmentTimeId = 18
                    };

                    i++;
                    //if (i >= 1) {
                    //    break;
                    //}
                }
                DeliveryOrderRequest orderRequests = new DeliveryOrderRequest()
                {
                    MerchantData      = merchantDatas,
                    AppointmentDateId = 0,
                    AppointmentTimeId = 0
                };
                #endregion
                #region Call Alpha api usign Restsharp
                var c = new RestClient("https://apialpha.alphauat.com");
                var r = new RestRequest("api/DeliveryOrder/MarketPlaceDeliveryOrderEntry", Method.POST);
                r.AddHeader("Authorization", "Alpha vxkx619iHkU5JXLWdXVE5WQX731C18D45crxFoe9N4NI1ltTl98QpztHGB/Q8l9JLFB+vdH/zFbA3T+9LNVWZMx94swrLieqn0tLjVq6lpYn6IOT3jgNmaGfWx5sbU12Qlx+LxSrK11TUcjhDYRN2KAxjGlrhMFIk73rp3cOBv74acFjFvZQnYWZ/QUxFkThZY2UfQettfR9zbaVF4MkBH0rG+WyOFhz10a42peh65G3z0ShrKJ+MvvBMcZLf+t8jYJ/neNIC0YCQevkfaDJY5IofeIfpsLzgMrYzD2NObCcMpK1ZfUZE/Qrp/NNTPCm4hFFQfMkg/DPEO2qp52HVhBCOVvC3pxs");

                var serealize = JsonSerializer.Serialize <DeliveryOrderRequest>(orderRequests);
                r.AddJsonBody(orderRequests);
                var res   = c.Execute(r);
                var model = JsonSerializer.Deserialize <CreateBookingModel>(res.Content);

                #endregion

                return(View());
            } catch (Exception ex) {
                string messages = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                throw;
            }
        }