Exemplo n.º 1
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            Host host;

            try
            {
                host = (from item in bl.GetHosts()
                        where Int32.Parse(item.Id) == Int32.Parse(idText.Text) && passwordText.Password == item.Password
                        select item).FirstOrDefault();
                if (host == null)
                {
                    MessageBox.Show("Id or password are not correct");
                }
                else
                {
                    ThisGrid.Children.RemoveAt(0);
                    ThisRuler.Children.RemoveAt(0);
                    ThisGrid.Children.Add(new HostHostingUnits(host, ThisGrid));
                    ThisRuler.Children.Add(new HostRuler(host, ThisGrid, ThisRuler));
                    this.Close();
                }
            }
            catch
            {
                MessageBox.Show("Id or password are not correct");
            }
        }
Exemplo n.º 2
0
 public HostManager()
 {
     InitializeComponent();
     foreach (Host host in bl.GetHosts())
     {
         listView.Items.Add(new HostViewManager(host));
     }
 }
 public UpdateHostingUnitWindow(HostingUnit unit)
 {
     InitializeComponent();
     owner = (from item in bl.GetHosts()
              where item.Id == unit.OwnerId
              select item).FirstOrDefault();
     this.unit                       = unit;
     this.DataContext                = unit;
     AreaComboBox.ItemsSource        = Enum.GetValues(typeof(TzimmerArea));
     TypeComboBox.ItemsSource        = Enum.GetValues(typeof(TzimmerType));
     OwnerComboBox.ItemsSource       = bl.GetHosts();
     OwnerComboBox.DisplayMemberPath = "FirstName";
 }
 public OrderViewManager(Order order, ListView list)
 {
     InitializeComponent();
     textOrderDate.Text = order.OrderDate.ToString("dd-MM-yyyy");
     if (order.Status == OrderStatus.NOTYETCARE)
     {
         textOrderDate.Text = "No order date yet";
     }
     this.order = order;
     this.list  = list;
     #region find req, unit and host
     var req = (from item in bl.GetGuestRequests()
                where item.GuestRequestKey == order.GuestRequestKey
                select item).FirstOrDefault();
     var unit = (from item in bl.GetHostingUnits()
                 where item.HostingUnitKey == order.HostingUnitKey
                 select item).FirstOrDefault();
     var host = (from item in bl.GetHosts()
                 where item.Id == unit.OwnerId
                 select item).FirstOrDefault();
     this.DataContext = order;
     #endregion
     #region dataContext
     FirstNameReqText.DataContext    = req;
     LastNameReqText.DataContext     = req;
     GuestReqKeyText.DataContext     = req;
     EntryDateReqText.DataContext    = req;
     ReleaseDateReqText.DataContext  = req;
     FirstNameHostText.DataContext   = host;
     LastNameHostText.DataContext    = host;
     HostKeyText.DataContext         = host;
     HostingUnitNameText.DataContext = unit;
     HostingUnitKeyText.DataContext  = unit;
     #endregion
 }
Exemplo n.º 5
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            var host = (from item in bl.GetHosts()
                        where item.Id == unit.OwnerId
                        select item).FirstOrDefault();

            ThisGrid.Children.RemoveAt(0);
            ThisGrid.Children.Add(new HostHostingUnits(host, ThisGrid, index));
        }
 public OrderView(Order order, List<Order> goodOrders, ListView list)
 {
     InitializeComponent();
     this.order = order;
     this.goodOrders = goodOrders;
     this.list = list;
     if (order.Status == OrderStatus.MAILSENT)
         Status.Content = "Confirm Order";
     if (order.Status == OrderStatus.CARE)
         Status.Content = "Order is Yours";
     req = (from item in bl.GetGuestRequests()
            where item.GuestRequestKey == order.GuestRequestKey
            select item).FirstOrDefault();
     unit = (from item in bl.GetHostingUnits()
             where item.HostingUnitKey == order.HostingUnitKey
             select item).FirstOrDefault();
     host = (from item in bl.GetHosts()
                 where item.Id == unit.OwnerId
                 select item).FirstOrDefault();
     this.DataContext = req;
     OrderKeyText.DataContext = order;
     Icon.DataContext = order;
 }