public GroupTestByDate(string hour, DatePicker date)
        {
            //InitializeComponent();
            //bl = FactoryBL.GetBL();
            //DateTime date1 = Convert.ToDateTime(date.SelectedDate);
            //int hour1 = Convert.ToInt32(hour);
            //List<BE.Tester> found = bl.getAllAvailbleTestrs(date1, hour1);
            //this.dataGrid .ItemsSource = found;
            //ListCollectionView collection = new ListCollectionView(bl.getAllAvailbleTestrs(date1, hour1));
            //collection.GroupDescriptions.Add(new PropertyGroupDescription("date"));
            //dataGrid .ItemsSource = collection;

            InitializeComponent();
            bl = BL.FactoryBL.GetBL();
            DateTime date1 = Convert.ToDateTime(date.SelectedDate);
            //   int hour1 = Convert.ToInt32(hour);
            //  List<BE.Tester> found = bl.getAllAvailbleTestrs(date1, hour1);
            //  this.dataGrid .ItemsSource = found;
            ListCollectionView collection = new ListCollectionView(bl.getAlltestsInDate(date1));

            //  collection.GroupDescriptions.Add(new PropertyGroupDescription("Date"));
            dataGrid.ItemsSource = collection;

            //dataGrid.ItemsSource = bl.getTestsList();
        }
示例#2
0
 public AddOrderPage()
 {
     InitializeComponent();
     client           = new Client();
     bl               = FactoryBl.getBl();
     this.DataContext = client;
 }
示例#3
0
 public NewClientPage()
 {
     Bl       = FactoryBl.getBl();
     Add      = new Address();
     Location = new Address();
     InitializeComponent();
     client = new Client();
     this.CityComboBox.ItemsSource         = Enum.GetValues(typeof(CITY));
     this.DeliveryCityComboBox.ItemsSource = Enum.GetValues(typeof(CITY));
     this.MainGrid.DataContext             = client;
     this.AddressGrid.DataContext          = Add;
     this.DeliveryAddressGrid.DataContext  = Location;
     this.BirthDatePicker.DisplayDateStart = new DateTime(1900, 1, 1).Date;
     this.BirthDatePicker.DisplayDateEnd   = new DateTime(DateTime.Now.Year - 18, DateTime.Now.Month, DateTime.Now.Day).Date;
     foreach (var child in MainGrid.Children)
     {
         if (child is TextBox)
         {
             ((TextBox)child).BorderBrush = Brushes.Black;
         }
         if (child is ComboBox)
         {
             ((ComboBox)child).BorderBrush = Brushes.Black;
         }
     }
 }
 public GetOrderIDWindow()
 {
     bl = FactoryBl.getBl();
     InitializeComponent();
     order            = new Order();
     this.DataContext = order;
 }
示例#5
0
        public AllTesters()
        {
            InitializeComponent();
            Ibl help = FactoryBL.GetInstance();

            data.DataContext = new ObservableCollection <Tester>(help.GetTesters());
        }
 public static Ibl GetBL()
 {
     if (bl == null)
     {
         bl = new xmlInitilizer();
     }
     return(bl);
 }
示例#7
0
        public MainPage()
        {
            bl = FactoryBl.getBl();
            InitializeComponent();
            ManagementUserControl p = new ManagementUserControl();

            order = new Order();
        }
示例#8
0
 public static Ibl getBl()
 {
     if (bl == null)
     {
         bl = new BL_imp();
     }
     return(bl);
 }
 public static Ibl getInstance()
 {
     if (instance == null)
     {
         instance = new BLClassic();
     }
     return(instance);
 }
示例#10
0
 public static Ibl getBL()
 {
     if (instance == null)
     {
         instance = new BL_imp();
     }
     return(instance);
 }
示例#11
0
 public InfoPage()
 {
     InitializeComponent();
     bl = FactoryBl.getBl();
     this.BranchesListBox.ItemsSource = bl.getBranchesList();
     this.ClientsListBox.ItemsSource  = bl.getClientsList();
     this.OrdersListBox.ItemsSource   = bl.getOrdersList();
 }
示例#12
0
        private void DoneUpdate_Click(object sender, RoutedEventArgs e)
        {
            string   id        = TraineeUC.person.IdInput.Text;
            string   fname     = TraineeUC.person.FirstNameInput.Text;
            string   lname     = TraineeUC.person.LastNameInput.Text;
            Gender   gender    = (Gender)Enum.Parse(typeof(Gender), TraineeUC.person.GenderInput.Text);
            DateTime Birthdate = TraineeUC.person.BirthdateInput.SelectedDate.Value;
            string   phone     = TraineeUC.person.PhoneNumberInput.Text;
            int      house_number;

            try
            {
                house_number = int.Parse(TraineeUC.person.HouseNumberInput.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("the house number must contain only digits", "house number error", MessageBoxButton.OK, MessageBoxImage.Error);
                TraineeUC.person.HouseNumberInput.Text = "number";
                return;
            }
            Address addrees    = new Address(TraineeUC.person.StreetInput.Text, house_number, TraineeUC.person.CityInput.Text);
            Vehicle speciality = (Vehicle)Enum.Parse(typeof(Vehicle), TraineeUC.SpecialityInput.Text);
            Gearbox gearbox    = (Gearbox)Enum.Parse(typeof(Gearbox), TraineeUC.GearboxInput.Text);
            string  sname      = TraineeUC.SchoolNameInput.Text;
            string  tname      = TraineeUC.TeacherNameInput.Text;
            int     numlessons;

            try
            {
                numlessons = int.Parse(TraineeUC.LessonsCounterInput.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("the number lessons must contain only digits", "numer lessons error", MessageBoxButton.OK, MessageBoxImage.Error);
                TraineeUC.person.HouseNumberInput.Text = "number";
                return;
            }
            try
            {
                Trainee trainee = new Trainee(id, fname, lname, Birthdate, gender, phone, addrees, speciality, gearbox, sname, tname, numlessons);
                Ibl     help    = FactoryBL.GetInstance();
                help.UpdateTrainee(trainee);
                bool success = help.UpdateTrainee(trainee);
                if (success)
                {
                    MessageBox.Show("the trainee update successfuly");
                }
                else
                {
                    MessageBox.Show("something went wrong");
                }
                Visibility = Visibility.Collapsed;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "logic error", MessageBoxButton.OK);
            }
        }
        private void EnteredId_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            try
            {
            }
            catch (Exception)
            {
                throw;
            }
            if (e.Key != Key.Return)
            {
                return;
            }
            string id = ent.EnteredId.Text;

            if (id.Length < 9)
            {
                System.Windows.MessageBox.Show("id must have 9 numbers");
            }
            if (id == "000000000")
            {
                DirectorHome = new DirectorHome();
                ent.EnteredId.Clear();
                Program.Children.Clear();
                Program.Children.Add(DirectorHome);
            }
            else
            {
                Ibl            help    = FactoryBL.GetInstance();
                List <Tester>  tester  = help.GetTesters(t => t.Id == id);
                List <Trainee> trainee = help.GetTrainees(t => t.Id == id);
                if (trainee.Count == 0 && tester.Count == 0)
                {
                    System.Windows.MessageBox.Show("Not Exist!");
                }
                else if (trainee.Count != 0 && tester.Count != 0)
                {
                    System.Windows.MessageBox.Show("ERORR");
                }
                else if (tester.Count != 0)
                {
                    testerHome = new TesterHome(tester[0]);
                    testerHome.LogOutRequest += Logout_Request;
                    ent.EnteredId.Clear();
                    Program.Children.Clear();
                    Program.Children.Add(testerHome);
                }
                else if (trainee.Count != 0)
                {
                    traineeHome = new TraineeHome(trainee[0]);
                    traineeHome.LogOutRequest += Logout_Request;
                    ent.EnteredId.Clear();
                    Program.Children.Clear();
                    Program.Children.Add(traineeHome);
                }
            }
        }
示例#14
0
 public DishListPage(DISH_TYPE DishT)
 {
     InitializeComponent();
     bl                           = FactoryBl.getBl();
     dt                           = new DishType();
     dt.DT                        = DishT;
     this.DataContext             = dt;
     this.DishListBox.ItemsSource = bl.dishesForDishType(dt.DT);
 }
 public UpdateDeletePage()
 {
     InitializeComponent();
     bl = FactoryBl.getBl();
     this.BranchesDataGrid.ItemsSource = bl.getBranchesList();
     this.ClientsDataGrid.ItemsSource  = bl.getClientsList();
     this.OrdersDataGrid.ItemsSource   = bl.getOrdersList();
     this.DishesDataGrid.ItemsSource   = bl.getDishesList();
 }
示例#16
0
 public static Ibl GetBL()
 {
     if (Ibl == null)
     {
         Ibl       = new Bl_imp();
         GFallings = new List <BE.Falling>();
     }
     return(Ibl);
 }
 public UpdateDishPage(Dish d)
 {
     InitializeComponent();
     bl   = FactoryBl.getBl();
     dish = d;
     DishTypeComboBox.ItemsSource = Enum.GetValues(typeof(DISH_TYPE));
     SizeComboBox.ItemsSource     = Enum.GetValues(typeof(SIZE));
     KashrutComboBox.ItemsSource  = Enum.GetValues(typeof(KOSHER));
     MainGrid.DataContext         = dish;
 }
示例#18
0
        public AllTesterTests(Tester source)
        {
            tester = new Tester(source);
            InitializeComponent();

            Ibl help = FactoryBL.GetInstance();

            obs = new ObservableCollection <Test>(help.GetTests(t => t.Tester_id == tester.Id));
            AllTesterTest.DataContext = obs;
        }
示例#19
0
        public AddBranchPage()
        {
            InitializeComponent();
            bl     = FactoryBl.getBl();
            branch = new Branch();
            this.MainGrid.DataContext    = branch;
            this.AddressGrid.DataContext = branch.Add;

            this.KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER));
            this.CityComboBox.ItemsSource    = Enum.GetValues(typeof(CITY));
        }
示例#20
0
 public MainWindow()
 {
     bl = FactoryBl.getBl();
     InitializeComponent();
     bl.loadBranchesFromXML("BranchesXmlBySerilalizer.xml");
     bl.loadDishesFromXML("DishesXmlBySerilalizer.xml");
     bl.loadClientsFromXML("ClientsXmlBySerilalizer.xml");
     bl.loadOrdersFromXML("OrdersXmlBySerilalizer.xml");
     //bl.loadODFromXML("ODXmlBySerilalizer.xml");
     MainFrame.Navigate(new MainPage());
 }
示例#21
0
 public UpdateOrderPage(Order o)
 {
     InitializeComponent();
     order = o;
     bl    = FactoryBl.getBl();
     this.MainGrid.DataContext              = order;
     this.BranchComboBox.ItemsSource        = bl.getBranchesList();
     this.PaymentComboBox.ItemsSource       = Enum.GetValues(typeof(PAYMENT));
     this.KashrutComboBox.ItemsSource       = Enum.GetValues(typeof(KOSHER));
     this.creditCardUserControl.DataContext = order.CreditCard;
 }
示例#22
0
        public UpdateBranchPage(Branch b)
        {
            InitializeComponent();
            bl                           = FactoryBl.getBl();
            branch                       = new Branch(b.Name, b.Add.Street, b.Add.HouseNO, b.Add.City, b.Add.ZipCode, b.ManagerName, b.PhoneNumber, b.Kosher);
            branch.BranchID              = b.BranchID;
            this.MainGrid.DataContext    = branch;
            this.AddressGrid.DataContext = branch.Add;

            this.KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER));
            this.CityComboBox.ItemsSource    = Enum.GetValues(typeof(CITY));
        }
        public allPassedTrainees()
        {
            InitializeComponent();
            bl = FactoryBL.GetBL();
            List <BE.Trainee> passedTrainees = bl.getAllPassedTraineesDay();

            this.dataGrid.ItemsSource = passedTrainees;
            ListCollectionView collection = new ListCollectionView(bl.getAllPassedTraineesDay());

            collection.GroupDescriptions.Add(new PropertyGroupDescription("Firstname"));
            this.dataGrid.ItemsSource = collection;
        }
示例#24
0
        public UpdateTestByTester(Tester source)
        {
            tester = new Tester(source);
            InitializeComponent();

            Ibl help = FactoryBL.GetInstance();

            obs = new ObservableCollection <Test>(help.GetTests(t => t.Tester_id == tester.Id));
            AllTesterTest.DataContext = obs;

            Note.TextChanged  += IsEnabled_Update_Click;
            Grade.TextChanged += IsEnabled_Update_Click;
        }
示例#25
0
        private void Update_Click(object sender, RoutedEventArgs e)
        {
            Ibl help = FactoryBL.GetInstance();

            try
            {
                help.UpdateTest(long.Parse(TestId.Text), int.Parse(Grade.Text), Note.Text);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "LOGIC ERORR", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            UpdateInfo.Visibility = Visibility.Collapsed;
        }
示例#26
0
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            Ibl help = FactoryBL.GetInstance();

            try
            {
                help.RemoveTester(id);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "logic error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            Visibility = Visibility.Collapsed;
            the_tester_deleted(this, new EventArgs());
        }
示例#27
0
        public UpdateClientPage(Client c)
        {
            bl = FactoryBl.getBl();

            InitializeComponent();
            client   = c;
            Add      = c.Add;
            Location = c.Location;
            this.CityComboBox.ItemsSource         = Enum.GetValues(typeof(CITY));
            this.DeliveryCityComboBox.ItemsSource = Enum.GetValues(typeof(CITY));
            this.MainGrid.DataContext             = client;
            this.AddressGrid.DataContext          = Add;
            this.DeliveryAddressGrid.DataContext  = Location;
            this.BirthDatePicker.DisplayDateStart = new DateTime(1990, 1, 1).Date;
            this.BirthDatePicker.DisplayDateEnd   = new DateTime(DateTime.Now.Year - 18, DateTime.Now.Month, DateTime.Now.Day).Date;
        }
示例#28
0
        public QueriesPage()
        {
            bl = FactoryBl.getBl();
            qa = new QueryAns();
            InitializeComponent();
            qa.AverageOrder                   = bl.averageOrder();
            qa.MostValueOrder                 = bl.mostValueOrder();
            this.QueryGrid.DataContext        = qa;
            this.CityComboBox.ItemsSource     = Enum.GetValues(typeof(CITY));
            this.DishTypeComboBox.ItemsSource = Enum.GetValues(typeof(DISH_TYPE));
            this.DishComboBox.ItemsSource     = bl.getDishesList();
            int MEO = bl.mostValueOrder();

            this.MostExpensiveOrderLabel.Content = "Order ID: " + MEO + "    Total Price: " + bl.calcTotalPrice(MEO) + "₪";
            this.AverageOrderLabel.Content       = bl.averageOrder() + "₪";
        }
 public AddDishesToOrderPage()
 {
     try
     {
         InitializeComponent();
         bl = FactoryBl.getBl();
         this.DishTypeComboBox.ItemsSource    = Enum.GetValues(typeof(DISH_TYPE));
         this.MainGrid.DataContext            = od;
         this.DishDataGrid.ItemsSource        = bl.getDishesList();
         this.OrderedDishDataGrid.ItemsSource = bl.getOrderedDishes(od.OrderID);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERROR!", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         InitializeComponent();
     }
 }
示例#30
0
 public MenuPage()
 {
     InitializeComponent();
     bl = FactoryBl.getBl();
 }