Example #1
0
        private void hapeg_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (listselected.Count() > 0)
                {
                    int count = 0;
                    foreach (int eno in listselected)
                    {
                        Akun emp = (from ep in repo.Get() where ep.IdPegawai == eno select ep).First();
                        repo.Delete(emp);
                        count++;
                    }
                    MessageBox.Show(count + " Row's Deleted");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            menuadmin aha = new menuadmin();

            this.Close();
            aha.tabControl1.SelectedIndex = 2;
            aha.Show();
        }
Example #2
0
        private void hapusbarang_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (listselected.Count() > 0)
                {
                    int count = 0;
                    foreach (int eno in listselected)
                    {
                        Barang bar = (from hl in repobar.Get() where hl.IdBarang == eno select hl).First();
                        repobar.Delete(bar);
                        count++;
                    }
                    MessageBox.Show(count + " Row's Deleted");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            menuadmin muncul = new menuadmin();

            this.Close();
            muncul.tabControl1.SelectedIndex = 3;
            muncul.Show();
        }
Example #3
0
 private void login1_Click(object sender, RoutedEventArgs e)
 {
     akun.Username = username.Text;
     akun.Password = password.Password;
     try
     {
         bool status = repo.login(akun);
         if (status)
         {
             if (akun.Username == "admin")
             {
                 menuadmin menu = new menuadmin();
                 menu.Show();
                 this.Close();
             }
             else
             {
                 menukasir menuk = new menukasir(akun);
                 menuk.Show();
                 this.Close();
             }
         }
         else
         {
             MessageBox.Show("Password atau username salah");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #4
0
        private void SaveEditProd_Click(object sender, RoutedEventArgs e)
        {
            bool status = repobar.Update(barang);

            if (status)
            {
                MessageBox.Show("Simpan berhasil!", "", MessageBoxButton.OK, MessageBoxImage.Information);
                menuadmin updated = new menuadmin();
                updated.tabControl1.SelectedIndex = 3;
                updated.Show();
                this.Close();
            }
        }