Ejemplo n.º 1
0
        private void Init(JObject jObj)
        {
            if (_isForMua)
            {
                Customer = new Customer(jObj);
                if (jObj["CustomerId"] != null)
                {
                    Customer.Id = (string)jObj["CustomerId"];
                }
                MuaAddress = (string)jObj["MuaAddress"];
            }
            else
            {
                Mua = new MuaArtist(jObj);
            }
            DateTime      = (DateTime)jObj["Time"];
            Note          = (string)jObj["Message"];
            PaymentType   = (PaymentType)(int)jObj["PaymentType"];
            Status        = (AppointmentStatus)(int)jObj["Status"];
            AppointmentId = (string)jObj["Id"];
            foreach (JObject service in (JArray)jObj["Services"])
            {
                Basket.Add(new OrderItem(new Service(service), (int)service["Count"]));
            }
            var discount = jObj["Discount"];

            if (discount != null)
            {
                Discount = new Discount(discount as JObject);
            }
            var location = jObj["Location"];

            if (location != null)
            {
                Location = new Location((location as JObject), true, true);
            }
            else
            {
                Location = new Location {
                    Address = (string)jObj["MuaAddress"],
                    Lat     = (double)jObj["MuaLocationLat"],
                    Lon     = (double)jObj["MuaLocationLon"]
                };
                Location.MapInit();
            }
        }
Ejemplo n.º 2
0
 private void Init(JObject jObj)
 {
     if (_isForMua)
     {
         Customer   = new Customer(jObj);
         MuaAddress = (string)jObj["MuaAddress"];
     }
     else
     {
         Mua = new MuaArtist(jObj);
     }
     DateTime      = (DateTime)jObj["Time"];
     Note          = (string)jObj["Message"];
     PaymentType   = (PaymentType)(int)jObj["PaymentType"];
     Status        = (AppointmentStatus)(int)jObj["Status"];
     AppointmentId = (string)jObj["Id"];
     foreach (JObject service in (JArray)jObj["Services"])
     {
         Basket.Add(new OrderItem(new Service(service), (int)service["Count"]));
     }
 }
Ejemplo n.º 3
0
 public Order(MuaArtist mua)
 {
     Mua = mua;
 }