Пример #1
0
 public COrder(string orderid, CStore storeLocation, CCustomer customer, DateTime orderedTime)
 {
     Orderid       = orderid;
     StoreLocation = storeLocation;
     Customer      = customer;
     OrderedTime   = orderedTime;
 }
Пример #2
0
 public COrder(string orderid, CStore storeLocation, CCustomer customer, double totalCost)
 {
     Orderid       = orderid;
     StoreLocation = storeLocation;
     Customer      = customer;
     TotalCost     = totalCost;
 }
Пример #3
0
 /// <summary>
 /// parameterized constructor
 /// </summary>
 public COrder(CStore storeLocation, CCustomer customer, DateTime orderedTime, double totalCost, List <CProduct> productList)
 {
     StoreLocation = storeLocation;
     Customer      = customer;
     OrderedTime   = orderedTime;
     TotalCost     = totalCost;
     ProductList   = productList;
 }
Пример #4
0
 public COrder(string orderid, CStore storeLocation, CCustomer customer, DateTime orderedTime, double totalCost)
 {
     Orderid       = orderid;
     StoreLocation = storeLocation;
     Customer      = customer;
     OrderedTime   = orderedTime;
     TotalCost     = totalCost;
 }
Пример #5
0
        /// <summary>
        /// original behavior to serialize and write data
        /// </summary>
        public void WriteStoreData(CStore data)
        {
            JsonSerializer serializer = new JsonSerializer();

            serializer.Converters.Add(new Newtonsoft.Json.Converters.IsoDateTimeConverter());
            serializer.NullValueHandling = NullValueHandling.Ignore;
            serializer.TypeNameHandling  = TypeNameHandling.Auto;
            serializer.Formatting        = Formatting.Indented;
            using (StreamWriter sw = new StreamWriter(path))
                using (JsonWriter writer = new JsonTextWriter(sw))
                {
                    serializer.Serialize(writer, data, typeof(CStore));
                }

            /*
             * string json = JsonConvert.SerializeObject(data);
             * File.WriteAllText(path,json);
             */
        }
Пример #6
0
 /// <summary>
 /// customer's behavior to place an order at a store
 /// <summary>
 public void PlaceOrder(CStore storeLocation, COrder newOrder)
 {
     storeLocation.UpdateInventoryAndCustomerOrder(newOrder);
 }