Пример #1
0
 private void SearchByRank(object sender, RoutedEventArgs e)
 {
     if (PL_GUI.ComboboxValidate(rank, "Rank"))
     {
         Rank rnk;
         if (rank.Text.Equals("Administrator"))
         {
             rnk = Rank.Administrator;
         }
         else if (rank.Text.Equals("Manager"))
         {
             rnk = Rank.Manager;
         }
         else if (rank.Text.Equals("Worker"))
         {
             rnk = Rank.Worker;
         }
         else
         {
             rnk = Rank.Customer;
         }
         if (parentWindow.SearchDataEntity(TypeFields.rank, rnk, null, 4))
         {
             this.Close();
         }
     }
 }
        private bool IsValid()
        {
            bool flag = PL_GUI.ComboboxValidate(payment, "Payment method");

            if (flag)
            {
                flag = PL_GUI.DoubleRadioValidate(purchaseType, returnType, "Transaction type");
            }
            return(flag);
        }
Пример #3
0
        private bool IsValid()
        {
            bool flag = true;

            if (isAdd)
            {
                flag = PL_GUI.RegExp(username.Text, "User name", 3);
            }
            if (flag && isAdd)
            {
                flag = PL_GUI.RegExp(password.Password, "Password", 3);
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(firstName.Text, "First name", 1);
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(lastName.Text, "Last name", 1);
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(ID.Text, "ID", 0);
            }
            if (flag)
            {
                flag = PL_GUI.DoubleRadioValidate(male, female, "Gender");
            }
            if (flag)
            {
                flag = PL_GUI.ComboboxValidate(depID, "Department name");
            }
            if (flag)
            {
                flag = PL_GUI.ComboboxValidate(supID, "Supervisor ID");
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(salary.Text, "Salary", 2);
            }
            return(flag);
        }
Пример #4
0
        private bool IsValid()
        {
            bool flag = PL_GUI.RegExp(productName.Text, "Product name", 1);

            if (flag)
            {
                flag = PL_GUI.ComboboxValidate(productType, "Product type");
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(price.Text, "Price", 2);
            }
            if (flag)
            {
                flag = PL_GUI.RegExp(stockcount.Text, "Stock count", 2);
            }
            if (flag)
            {
                flag = PL_GUI.ComboboxValidate(depID, "Department name");
            }
            return(flag);
        }
Пример #5
0
 private void SearchByPType(object sender, RoutedEventArgs e)
 {
     if (PL_GUI.ComboboxValidate(pType, "Product type"))
     {
         PType type;
         if (pType.Text.Equals("Electronics"))
         {
             type = PType.Electronics;
         }
         else if (pType.Text.Equals("Food"))
         {
             type = PType.Food;
         }
         else
         {
             type = PType.Clothes;
         }
         if (parentWindow.SearchDataEntity(TypeFields.type, type, null, 5))
         {
             this.Close();
         }
     }
 }
Пример #6
0
 private void SearchByPStatus(object sender, RoutedEventArgs e)
 {
     if (PL_GUI.ComboboxValidate(pStatus, "Product status"))
     {
         PStatus sta;
         if (pStatus.Text.Equals("in stock"))
         {
             sta = PStatus.InStock;
         }
         else if (pStatus.Text.Equals("low quantity"))
         {
             sta = PStatus.LowQuantity;
         }
         else
         {
             sta = PStatus.Empty;
         }
         if (parentWindow.SearchDataEntity(TypeFields.inStock, sta, null, 5))
         {
             this.Close();
         }
     }
 }
Пример #7
0
 private void SearchByPayment(object sender, RoutedEventArgs e)
 {
     if (PL_GUI.ComboboxValidate(payment, "Payment method"))
     {
         PaymentMethod pay;
         if (payment.Text.Equals("Cash"))
         {
             pay = PaymentMethod.Cash;
         }
         else if (payment.Text.Equals("Visa"))
         {
             pay = PaymentMethod.Visa;
         }
         else
         {
             pay = PaymentMethod.Check;
         }
         if (parentWindow.SearchDataEntity(TypeFields.payment, pay, null, 6))
         {
             this.Close();
         }
     }
 }