public FastOrderViewModel(int hall, DateTime start, DateTime end) { Client = new Client {ClientId = Guid.NewGuid()}; Order = new Order {OrderId = Guid.NewGuid(), ClientId = Client.ClientId, Start = start, End = end, Hall = hall}; _clientService = NinjectBootstrap.Kernel.Get<Service.Interface.IClientService>(); _orderService = NinjectBootstrap.Kernel.Get<Service.Interface.IOrderService>(); }
bool IOrderService.Save(Order order) { var o = _localDatabase.OrderTable.FirstOrDefault(x => x.OrderId == order.OrderId); if (o != null) return true; _localDatabase.OrderTable.Add(order); return true; }
public bool Save(Order order) { try { Database.DatabaseService.Current.Database.Save(order); Database.DatabaseService.Current.Database.Flush(); return true; } catch(Exception exception) { Helpers.IsolatedStorageHelper.LogException("SterlingOrderService.Save", exception.Message, exception.StackTrace); return false; } }
public OrderAppoinmentViewModel(Client client, Order order, int hall, DateTime start, DateTime end) { _orderService = NinjectBootstrap.Kernel.Get<Service.Interface.IOrderService>(); _clientService = NinjectBootstrap.Kernel.Get<Service.Interface.IClientService>(); if(order == null) { Client = client; Order = new Order {OrderId = Guid.NewGuid(), ClientId = client.ClientId, Start = start, End = end, Hall = hall}; _isNew = true; return; } Client = _clientService.Get(order.ClientId); _isNew = false; Order = order; }
public void Save(Order order) { _localDatabase.OrderTable.Add(order); }
private Color GetColor(Client client, Order order) { if (client.IsBlocked) { return new Color { R = 241, G = 129, B = 129, A = 100 }; } return SetColor(SelectedHall != 0 ? SelectedHall : order.Hall); }