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("אין חיבור לאינטרנט");
     }
 }
Пример #2
0
        private void cancelbtn_Click(object sender, RoutedEventArgs e)
        {
            superuser su = new superuser();

            su.Show();
            this.Close();
        }
 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();
     }
 }
 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("אין חיבור לאינטרנט");
     }
 }
Пример #5
0
 private void deletebtn_Click(object sender, RoutedEventArgs e)
 {
     if (f.CheckForInternetConnection())
     {
         if (MessageBox.Show("לחיצה על אישור תמחק את כל הקריאות והטכנאים השייכים לחברה זו האם אתה בטוח?", "מחיקת החברה", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
         {
         }
         else
         {
             disableallbtns();
             f.define_project_base("https://ana10project.firebaseio.com");
             f.delcompnay(this.com);
             MessageBox.Show("בוצע בהצלחה");
             superuser win = new superuser();
             win.Show();
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("אין חיבור לאינטרנט");
     }
 }
Пример #6
0
        private void okbtn_Click(object sender, RoutedEventArgs e)
        {
            if (f.CheckForInternetConnection())
            {
                if (companynametb.Text != "" && companylogotbt.Text != "")
                {
                    disableallbtns();
                    f.define_project_base("https://ana10project.firebaseio.com");
                    int mone       = f.num_of_mone("company", "mone");
                    int moneForNew = mone + 1;
                    if (editorregisetr == 1)
                    {
                        com = new company(moneForNew, companynametb.Text, companylogotbt.Text);
                    }
                    else
                    {
                        com.setCompnayLogo(companylogotbt.Text);
                        com.setCompnayName(companynametb.Text);
                    }

                    f.comit_company(this.com);
                    if (editorregisetr == 1)
                    {
                        string value = "{\"mone\":" + moneForNew + "}";
                        f.commit("company/", value);
                    }
                    MessageBox.Show("בוצע בהצלחה!");
                    superuser win = new superuser();
                    win.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("אין אינטרנט");
            }
        }