예제 #1
0
        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                Clients cl = LGS.GetCurrentID();
                SaveCLID.CLID = cl.id_user;

                id.Content = cl.id_user;

                Model1 db = new Model1();

                var inprocess = (from t in db.Orders
                                 where t.client == SaveCLID.CLID && t.order_status == 2
                                 select t).Count();
                var readyy = (from t in db.Orders
                              where t.client == SaveCLID.CLID && t.order_status == 4
                              select t).Count();

                now.Content   = inprocess;
                ready.Content = readyy;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (Auth.authC(username.Text, password.Password) == true)
     {
         LGS.CurrentID(username.Text, password.Password);
         Clients cl = LGS.GetCurrentID();
         SaveCLID.CLID = cl.id_user;
         if (cl.block == 1)
         {
             MessageBox.Show("Клиент заблокирован!");
         }
         else if (cl.block == 0)
         {
             ClientMain ms = new ClientMain();
             this.Close();
             ms.Show();
         }
     }
     else if (Auth.authM(username.Text, password.Password) == true)
     {
         LGS.MasterID(username.Text, password.Password);
         MasterMain ms = new MasterMain();
         this.Close();
         ms.Show();
     }
     else if (Auth.authA(username.Text, password.Password) == true)
     {
         AdminMain ms = new AdminMain();
         this.Close();
         ms.Show();
     }
     else if (Auth.authMan(username.Text, password.Password) == true)
     {
         ManagerMain ms = new ManagerMain();
         this.Close();
         ms.Show();
     }
     else
     {
         MessageBox.Show("Логин или пароль неверны!");
     }
 }