Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SalesList salesList = new SalesList();

            salesList.Show();
            Window.GetWindow(this).Close();
        }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(Identy.Text))
            {
                this.Customer = new Customer
                {
                    ID      = Guid.NewGuid(),
                    Name    = Name.Text == "" ? "No Name" : Name.Text,
                    Surname = Surname.Text == "" ? "No Surname" : Surname.Text,
                    Phone   = Phone.Text == "" ? "0" : Phone.Text,
                    Street  = Street.Text == "" ? "No Street" : Street.Text,
                    Number  = Number.Text == "" ? "0" : Number.Text,
                    City    = City.Text == "" ? "No City" : City.Text,
                };
                Customer customer = new Customer(this.Customer);
            }
            else
            {
                this.Customer = new Customer(Identy.Text);
            }
            Employee employee = new Employee();

            this.Transaction.CustomerID = this.Customer.ID;
            this.Transaction.EmployeeID = employee.ID;
            ISqlComunicator sqlComunicator = new TransactionDataAcces(this.Transaction);

            DataAcces.Instance.AddData(sqlComunicator);
            SalesList salesList = new SalesList();

            salesList.Show();
            Window.GetWindow(this).Close();
        }
Exemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ISqlComunicator sqlComunicator = new LoginsDataAcces(User.Text, Password.Password);
            DataTable       result         = DataAcces.Instance.GetData(sqlComunicator);

            if (result.Rows[0].Field <string>("Result") == "Passed")
            {
                CurrentUserInfo.Login = User.Text;
                SalesList salesList = new SalesList();
                salesList.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show(result.Rows[0].Field <string>("Result"));
            }
        }