コード例 #1
0
 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>();
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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;
        }
コード例 #5
0
 public void Save(Order order)
 {
     _localDatabase.OrderTable.Add(order);
 }
コード例 #6
0
        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);
        }