Beispiel #1
0
        private void cancelbtn_Click(object sender, RoutedEventArgs e)
        {
            compnaymanage cm = new compnaymanage(this.c, this.u);

            cm.Show();
            this.Close();
        }
Beispiel #2
0
        private void cancelbtn_Click(object sender, RoutedEventArgs e)
        {
            compnaymanage win = new compnaymanage(com, use);

            win.Show();
            this.Close();
        }
 private void deletebtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         if (MessageBox.Show("לחיצה על אישור תמחק את משתמש זה האם אתה בטוח?", "מחיקת משתמש", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
         {
         }
         else
         {
             f.del("users/" + us.getuserid(), "usersmone");
             MessageBox.Show("נמחק בהצלחה!");
             if (this.editForCompany > 0)
             {
                 compnaymanage win = new compnaymanage(this.com, this.us);
                 win.Show();
                 this.Close();
             }
             else
             {
                 superuser win = new superuser();
                 win.Show();
                 this.Close();
             }
         }
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
        private void Window_Closed(object sender, EventArgs e)
        {
            compnaymanage cm = new compnaymanage(this.c, this.u);

            cm.Show();
            this.Close();
        }
        private void cancelbtn_Click(object sender, RoutedEventArgs e)
        {
            loadtimeclock.Visibility = Visibility.Visible;
            compnaymanage cm = new compnaymanage(this.com, this.use);

            cm.Show();
            this.Close();
        }
 private void cancelbtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         compnaymanage cm = new compnaymanage(this.c, this.u);
         cm.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
 private void deletebtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         f.del_service(this.se);
         MessageBox.Show("בוצע בהצלחה");
         compnaymanage cm = new compnaymanage(this.com, this.use);
         cm.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
 private void cancelbtn_Click(object sender, RoutedEventArgs e)
 {
     if (this.editForCompany > 0)
     {
         compnaymanage win = new compnaymanage(this.com, this.us);
         win.Show();
         this.Close();
     }
     else
     {
         superuser win = new superuser();
         win.Show();
         this.Close();
     }
 }
 public callsWindow(company c, user e)
 {
     InitializeComponent();
     loadtimeclock.Visibility = Visibility.Hidden;
     WindowState = WindowState.Maximized;
     f.define_project_base("https://ana10project.firebaseio.com");
     this.com = c;
     this.use = e;
     if (!f.CheckForInternetConnection())
     {
         MessageBox.Show("אין חיבור לאינטרנט");
         compnaymanage cm = new compnaymanage(this.com, this.use);
         cm.Show();
         this.Close();
     }
     this.testfortest = f.get("");
     defineAllControllers();
 }
 private void loginbtnonclick(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         loadtimeclock.Visibility = Visibility.Visible;
         f.define_project_base("https://ana10project.firebaseio.com");
         this.u1 = f.set_local_user_after_login(f.check_if_username_and_password_are_ok(usernameTB.Text, passwordTB.Password.ToString()));
         if (this.u1 != null)
         {
             if (f.removequat(u1.superuser) == 1)
             {
                 MessageBox.Show("ההתחברות בוצעה בהצלחה!");
                 this.passwordTB.IsEnabled = false;
                 this.usernameTB.IsEnabled = false;
                 this.loginbtn.IsEnabled   = false;
                 var superuserwindow = new superuser();
                 superuserwindow.setupTheUser(u1);
                 superuserwindow.Show();
                 this.Close();
                 // MainWindow.Content = new superuser();
             }
             else
             {
                 MessageBox.Show("ההתחברות בוצעה בהצלחה!");
                 this.passwordTB.IsEnabled = false;
                 this.usernameTB.IsEnabled = false;
                 this.loginbtn.IsEnabled   = false;
                 int           comid = f.removequat(u1.copmanyID);
                 compnaymanage cm    = new compnaymanage(f.set_Company(comid), u1);
                 cm.Show();
                 this.Close();
             }
         }
         else
         {
             loadtimeclock.Visibility = Visibility.Hidden;
             MessageBox.Show("שם משתמש או סיסמה שגויים");
         }
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
 private void okbtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         if (checkIfThereIsNOBLankTB() == 0)
         {
             if (CheckIDNo(idtb.Text))
             {
                 employee ee    = new employee();
                 int      getid = f.num_of_mone("employees", "moneemployees");
                 getid++;
                 ee.employee_id        = getid;
                 ee.adress             = adresstb.Text;
                 ee.company            = this.c;
                 ee.dateofjoin         = dateforjoin();
                 ee.employee_id_number = idtb.Text;
                 ee.firstname          = this.fnametb.Text;
                 ee.lastname           = this.lnametb.Text;
                 ee.password           = f.strEncryptred(this.passwordBox.Password.ToString());
                 ee.geolocation        = "32.291347,34.8620103";
                 ee.phone = this.phonetb.Text;
                 f.commit_employee(ee);
                 f.commit("employees", "{\"moneemployees\":" + getid + "}");
                 MessageBox.Show("בוצע בהצלחה!");
                 compnaymanage cm = new compnaymanage(this.c, this.use);
                 cm.Show();
                 this.Close();
             }
             else
             {
                 MessageBox.Show("תעודת זהות אינה תקינה");
             }
         }
         else
         {
             MessageBox.Show("שים לב שיש שדות רקים");
         }
     }
     else
     {
         MessageBox.Show("אין אינטרנט");
     }
 }
 private void deletebtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         if (MessageBox.Show("לחיצה על אישור תמחק את עובד זה האם אתה בטוח?", "מחיקת עובד", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
         {
         }
         else
         {
             f.del_employee(this.e);
             MessageBox.Show("נמחק בהצלחה!");
             compnaymanage win = new compnaymanage(this.c, this.u);
             win.Show();
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
Beispiel #13
0
 private void okbtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         if (logolink.Text != "")
         {
             this.com.setCompnayLogo(logolink.Text);
             f.comit_company(this.com);
             MessageBox.Show("בוצע בהצלחה");
             compnaymanage win = new compnaymanage(com, use);
             win.Show();
             this.Close();
         }
         else
         {
             MessageBox.Show("לא ניתן להשאיר שדה ריק");
         }
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
        private void okbtn_Click(object sender, RoutedEventArgs e)
        {
            string errors       = "";
            int    errors_count = 0;

            if (f.CheckForInternetConnection())
            {
                if (fnametb.Text != "")
                {
                    bool containsInt  = fnametb.Text.Any(char.IsDigit);
                    bool cont_spaical = f.CheckSpacialCherter(fnametb.Text);
                    if (containsInt == true || cont_spaical == true)
                    {
                        errors += "\n שם לא יכול להכי תווים מיוחדים או מספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.firstname = fnametb.Text;
                    }
                }
                else
                {
                    errors += "\n שם לא יכול להיות ריק"; errors_count++;
                }
                if (idnumbertb.Text != "")
                {
                    if (f.CheckIDNo(idnumbertb.Text))
                    {
                        this.e.employee_id_number = idnumbertb.Text;
                    }
                    else
                    {
                        errors += "\n תעודת זהות אינה תקינה"; errors_count++;
                    }
                }
                if (lnametb.Text != "")
                {
                    bool containsInt  = lnametb.Text.Any(char.IsDigit);
                    bool cont_spaical = f.CheckSpacialCherter(lnametb.Text);
                    if (containsInt == true || cont_spaical == true)
                    {
                        errors += "\n שם לא יכול להכי תווים מיוחדים או מספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.lastname = lnametb.Text;
                    }
                }
                else
                {
                    errors += "\n שם משפחה לא יכול להיות ריק";
                    errors_count++;
                }
                if (adresstb.Text != "")
                {
                    this.e.adress = adresstb.Text;
                }
                else
                {
                    errors += "\n כתובת אינה יכולה להיות ריקה";
                    errors_count++;
                }
                if (phonetb.Text != "")
                {
                    bool conset_phone_digit_check = f.IsDigitsOnly(phonetb.Text);
                    if (conset_phone_digit_check == false)
                    {
                        errors += "\n טלפון לא יכול להכיל תווים חוץ ממספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.phone = phonetb.Text;
                    }
                }
                else
                {
                    errors += "\n טלפון אינו יכול להיות ריק";
                    errors_count++;
                }
                if (passwordBox.Password != "")
                {
                    this.e.password = f.strEncryptred(passwordBox.Password);
                }
                if (errors_count == 0)
                {
                    f.commit_employee(this.e);
                    MessageBox.Show("בוצע בהצלחה");
                    compnaymanage cm = new compnaymanage(this.c, this.u);
                    cm.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show(errors);
                }
            }
            else
            {
                MessageBox.Show("אין חיבור לאינטרנט");
            }
        }
        private void okbtn_Click(object sender, RoutedEventArgs e)
        {
            //checks setp
            string name            = this.nametb.Text;
            int    flagForExeption = 0;
            int    parsedValue;
            int    price = 0;
            int    time  = 0;

            if (!int.TryParse(this.pricetb.Text, out parsedValue))
            {
                MessageBox.Show("מחיר יכול להיות מספר או מספר שלם בלבד");
                flagForExeption++;
            }
            else
            {
                price = f.removequat(this.pricetb.Text);
            }
            if (!int.TryParse(this.timetb.Text, out parsedValue))
            {
                MessageBox.Show("זמן יכול להיות מספר או מספר שלם בלבד");
                flagForExeption++;
            }
            else
            {
                time = f.removequat(this.timetb.Text);
            }
            if (name == "" || this.pricetb.Text == "" || this.timetb.Text == "")
            {
                MessageBox.Show("השדות לא יכולים להיות ריקים");
                flagForExeption++;
            }
            if (flagForExeption == 0)
            {
                if (price <= 0)
                {
                    MessageBox.Show("המחיר חייב להיות גדול מ0");
                    flagForExeption++;
                }
                if (time <= 0)
                {
                    MessageBox.Show("הזמן חייב להיות גדול מ0");
                    flagForExeption++;
                }
            }
            if (flagForExeption == 0)
            {
                if (f.CheckForInternetConnection())
                {
                    if (this.editforuse == 0)
                    {
                        int mone = 0;
                        mone    = f.removequat(f.num_of_mone("services", "moneServices"));
                        this.se = new service(mone + 1, this.com, name, price, time);
                        f.commit_service(this.se);
                        //add to mone +1
                        mone++;
                        f.commit("services", "{\"moneServices\":" + mone + "}");
                    }
                    if (this.editforuse == 1)
                    {
                        this.se.name  = name;
                        this.se.price = f.removequat(price);
                        this.se.time  = f.removequat(time);

                        f.commit_service(this.se);
                        //add to mone +1
                    }
                    MessageBox.Show("בוצע בהצלחה");
                    compnaymanage cm = new compnaymanage(this.com, this.use);
                    cm.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("אין חיבור לאינטרנט");
                }
            }
        }
        private void okbtn_Click(object sender, RoutedEventArgs e)
        {
            if (f.CheckForInternetConnection())
            {
                int mone_for_id = 0;
                if (editorregisetr == 1)
                {
                    string protectlowername = this.usernameTB.Text;
                    protectlowername = protectlowername.ToLower();
                    this.us.setusername(protectlowername);
                    if (this.passwordTB.Password.ToString() != "")
                    {
                        this.us.setpassword(f.strEncryptred(this.passwordTB.Password.ToString()));
                    }
                    if ((bool)isAdminCB.IsChecked == true)
                    {
                        this.us.superuser = 1;
                        this.us.copmanyID = 0;
                    }
                    if ((bool)isAdminCB.IsChecked == false)
                    {
                        this.us.superuser = 0;
                        this.us.copmanyID = f.removequat(this.us.copmanyID);
                    }
                }
                else
                {
                    this.us = new user();
                    string protectlowername = this.usernameTB.Text;
                    protectlowername = protectlowername.ToLower();
                    this.us.setusername(protectlowername);
                    if (this.passwordTB.Password.ToString() != "")
                    {
                        this.us.setpassword(f.strEncryptred(this.passwordTB.Password.ToString()));
                    }
                    if ((bool)isAdminCB.IsChecked == true)
                    {
                        this.us.superuser = 1;
                        this.us.copmanyID = 0;
                    }
                    if ((bool)isAdminCB.IsChecked == false)
                    {
                        this.us.superuser = 0;
                        this.us.copmanyID = f.removequat(this.companyNameTB.Tag.ToString());
                    }
                    mone_for_id = f.num_of_mone("users", "usersmone");
                    this.us.setuserid(mone_for_id + 1);
                }
                if (this.passwordTB.Password.ToString() == "" || this.usernameTB.Text == "")
                {
                    MessageBox.Show("השדות לא יכולים להיות ריקים");
                }
                else
                {
                    f.commitUser(this.us);
                    MessageBox.Show("בוצע בהצלחה");
                }

                if (this.editForCompany > 0)
                {
                    compnaymanage win = new compnaymanage(this.com, this.us);
                    win.Show();
                    this.Close();
                }
                else
                {
                    superuser win = new superuser();
                    win.Show();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("אין אינטרנט");
            }
        }