Example #1
0
 public void masuk()
 {
    if (!(txtUserName.Text == "" || passwordBox1.Password == ""))
    {
       if (F.checkPass(txtUserName.Text, passwordBox1.Password))
       {
          if (txtUserName.Text == "admin")
          {
             Admin a = new Admin();
             a.Show();
             this.Hide();
          }
          siapa.anda = txtUserName.Text;
          string pilih = txtUserName.Text;
          switch (pilih[1])
          {
             case '1':
                //MessageBox.Show("Dokter");
                Dokter d = new Dokter();
                d.Show();
                this.Hide();
                break;
             case '2':
                //MessageBox.Show("Perawat");
                Perawat p = new Perawat();
                p.Show();
                this.Hide();
                break;
             case '3':
                //MessageBox.Show("Karyawan");
                Karyawan k = new Karyawan();
                k.Show();
                this.Hide();
                break;
             case '4':
                //MessageBox.Show("Pasien");
                Pasien s = new Pasien();
                s.Show();
                this.Hide();
                break;
          }
       }
       else if (txtUserName.Text == "su" && passwordBox1.Password == "superuser")
       {
          Admin a = new Admin();
          a.Show();
          this.Hide();
       }
       else MessageBox.Show("Username dan Password tidak cocok", "Peringatan", MessageBoxButton.OK, MessageBoxImage.Warning);
    }
    else if (txtUserName.Text == "" && !(passwordBox1.Password == ""))
       MessageBox.Show("username kosong");
    else if (passwordBox1.Password == "" && !(txtUserName.Text == ""))
       MessageBox.Show("password kosong");
    else MessageBox.Show("username & password kosong");
 }
Example #2
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.admin = ((TCHusada.Admin)(target));
     return;
     case 2:
     this.FormFade = ((System.Windows.Media.Animation.Storyboard)(target));
     return;
     case 3:
     this.FormFadeAnimation = ((System.Windows.Media.Animation.DoubleAnimation)(target));
     return;
     case 4:
     this.imgBackground = ((System.Windows.Controls.Image)(target));
     return;
     case 5:
     this.labeljam = ((System.Windows.Controls.Label)(target));
     return;
     case 6:
     this.labellogin = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.image1 = ((System.Windows.Controls.Image)(target));
     
     #line 32 "..\..\..\Admin.xaml"
     this.image1.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.image1_MouseDown);
     
     #line default
     #line hidden
     return;
     case 8:
     this.tblogout = ((System.Windows.Controls.Label)(target));
     
     #line 33 "..\..\..\Admin.xaml"
     this.tblogout.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.tblogout_MouseDown);
     
     #line default
     #line hidden
     return;
     case 9:
     this.labelpengguna = ((System.Windows.Controls.Label)(target));
     return;
     case 10:
     this.tblexit = ((System.Windows.Controls.Label)(target));
     
     #line 35 "..\..\..\Admin.xaml"
     this.tblexit.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.tblexit_MouseDown);
     
     #line default
     #line hidden
     return;
     case 11:
     this.tabControl1 = ((System.Windows.Controls.TabControl)(target));
     return;
     case 12:
     this.tabItemK = ((System.Windows.Controls.TabItem)(target));
     return;
     case 13:
     this.labeltblk = ((System.Windows.Controls.Label)(target));
     return;
     case 14:
     this.spMainK = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 15:
     this.dataGridK = ((System.Windows.Controls.DataGrid)(target));
     
     #line 42 "..\..\..\Admin.xaml"
     this.dataGridK.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dataGridK_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 16:
     this.groupBoxK = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 17:
     this.textnipk = ((System.Windows.Controls.TextBox)(target));
     return;
     case 18:
     this.textnamk = ((System.Windows.Controls.TextBox)(target));
     return;
     case 19:
     this.textalmtk = ((System.Windows.Controls.TextBox)(target));
     return;
     case 20:
     this.texttelpk = ((System.Windows.Controls.TextBox)(target));
     return;
     case 21:
     this.datemskk = ((System.Windows.Controls.DatePicker)(target));
     return;
     case 22:
     this.labelnipk = ((System.Windows.Controls.Label)(target));
     return;
     case 23:
     this.labelnamk = ((System.Windows.Controls.Label)(target));
     return;
     case 24:
     this.labelalak = ((System.Windows.Controls.Label)(target));
     return;
     case 25:
     this.labeltelk = ((System.Windows.Controls.Label)(target));
     return;
     case 26:
     this.labeltglk = ((System.Windows.Controls.Label)(target));
     return;
     case 27:
     this.simpanbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 64 "..\..\..\Admin.xaml"
     this.simpanbtnk.Click += new System.Windows.RoutedEventHandler(this.simpanbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 28:
     this.bersihbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 65 "..\..\..\Admin.xaml"
     this.bersihbtnk.Click += new System.Windows.RoutedEventHandler(this.bersihbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 29:
     this.batalbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 66 "..\..\..\Admin.xaml"
     this.batalbtnk.Click += new System.Windows.RoutedEventHandler(this.batalbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 30:
     this.tambahbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 67 "..\..\..\Admin.xaml"
     this.tambahbtnk.Click += new System.Windows.RoutedEventHandler(this.tambahbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 31:
     this.ubahbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 68 "..\..\..\Admin.xaml"
     this.ubahbtnk.Click += new System.Windows.RoutedEventHandler(this.ubahbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 32:
     this.hapusbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 69 "..\..\..\Admin.xaml"
     this.hapusbtnk.Click += new System.Windows.RoutedEventHandler(this.hapusbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 33:
     this.refreshbtnk = ((System.Windows.Controls.Button)(target));
     
     #line 74 "..\..\..\Admin.xaml"
     this.refreshbtnk.Click += new System.Windows.RoutedEventHandler(this.refreshbtnk_Click);
     
     #line default
     #line hidden
     return;
     case 34:
     this.tabItemD = ((System.Windows.Controls.TabItem)(target));
     return;
     case 35:
     this.labeltbld = ((System.Windows.Controls.Label)(target));
     return;
     case 36:
     this.spMainD = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 37:
     this.dataGridD = ((System.Windows.Controls.DataGrid)(target));
     
     #line 83 "..\..\..\Admin.xaml"
     this.dataGridD.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dataGridD_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 38:
     this.groupBoxD = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 39:
     this.textnipd = ((System.Windows.Controls.TextBox)(target));
     return;
     case 40:
     this.textnamd = ((System.Windows.Controls.TextBox)(target));
     return;
     case 41:
     this.textalmtd = ((System.Windows.Controls.TextBox)(target));
     return;
     case 42:
     this.combokeld = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 43:
     this.texttelpd = ((System.Windows.Controls.TextBox)(target));
     return;
     case 44:
     this.labelnipd = ((System.Windows.Controls.Label)(target));
     return;
     case 45:
     this.labelnamd = ((System.Windows.Controls.Label)(target));
     return;
     case 46:
     this.labelalad = ((System.Windows.Controls.Label)(target));
     return;
     case 47:
     this.labelkeld = ((System.Windows.Controls.Label)(target));
     return;
     case 48:
     this.labelteld = ((System.Windows.Controls.Label)(target));
     return;
     case 49:
     this.simpanbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 105 "..\..\..\Admin.xaml"
     this.simpanbtnd.Click += new System.Windows.RoutedEventHandler(this.simpanbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 50:
     this.bersihbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 106 "..\..\..\Admin.xaml"
     this.bersihbtnd.Click += new System.Windows.RoutedEventHandler(this.bersihbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 51:
     this.batalbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 107 "..\..\..\Admin.xaml"
     this.batalbtnd.Click += new System.Windows.RoutedEventHandler(this.batalbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 52:
     this.tambahbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 108 "..\..\..\Admin.xaml"
     this.tambahbtnd.Click += new System.Windows.RoutedEventHandler(this.tambahbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 53:
     this.ubahbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 109 "..\..\..\Admin.xaml"
     this.ubahbtnd.Click += new System.Windows.RoutedEventHandler(this.ubahbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 54:
     this.hapusbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 110 "..\..\..\Admin.xaml"
     this.hapusbtnd.Click += new System.Windows.RoutedEventHandler(this.hapusbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 55:
     this.refreshbtnd = ((System.Windows.Controls.Button)(target));
     
     #line 115 "..\..\..\Admin.xaml"
     this.refreshbtnd.Click += new System.Windows.RoutedEventHandler(this.refreshbtnd_Click);
     
     #line default
     #line hidden
     return;
     case 56:
     this.tabItemP = ((System.Windows.Controls.TabItem)(target));
     return;
     case 57:
     this.labeltblp = ((System.Windows.Controls.Label)(target));
     return;
     case 58:
     this.spMainP = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 59:
     this.dataGridP = ((System.Windows.Controls.DataGrid)(target));
     
     #line 124 "..\..\..\Admin.xaml"
     this.dataGridP.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dataGridP_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 60:
     this.groupBoxP = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 61:
     this.textnipp = ((System.Windows.Controls.TextBox)(target));
     return;
     case 62:
     this.textnamp = ((System.Windows.Controls.TextBox)(target));
     return;
     case 63:
     this.textalmtp = ((System.Windows.Controls.TextBox)(target));
     return;
     case 64:
     this.combokelp = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 65:
     this.texttelpp = ((System.Windows.Controls.TextBox)(target));
     return;
     case 66:
     this.labelnipp = ((System.Windows.Controls.Label)(target));
     return;
     case 67:
     this.labelnamp = ((System.Windows.Controls.Label)(target));
     return;
     case 68:
     this.labelalap = ((System.Windows.Controls.Label)(target));
     return;
     case 69:
     this.labelkelp = ((System.Windows.Controls.Label)(target));
     return;
     case 70:
     this.labeltelpp = ((System.Windows.Controls.Label)(target));
     return;
     case 71:
     this.simpanbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 146 "..\..\..\Admin.xaml"
     this.simpanbtnp.Click += new System.Windows.RoutedEventHandler(this.simpanbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 72:
     this.bersihbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 147 "..\..\..\Admin.xaml"
     this.bersihbtnp.Click += new System.Windows.RoutedEventHandler(this.bersihbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 73:
     this.batalbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 148 "..\..\..\Admin.xaml"
     this.batalbtnp.Click += new System.Windows.RoutedEventHandler(this.batalbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 74:
     this.tambahbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 149 "..\..\..\Admin.xaml"
     this.tambahbtnp.Click += new System.Windows.RoutedEventHandler(this.tambahbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 75:
     this.ubahbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 150 "..\..\..\Admin.xaml"
     this.ubahbtnp.Click += new System.Windows.RoutedEventHandler(this.ubahbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 76:
     this.hapusbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 151 "..\..\..\Admin.xaml"
     this.hapusbtnp.Click += new System.Windows.RoutedEventHandler(this.hapusbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 77:
     this.refreshbtnp = ((System.Windows.Controls.Button)(target));
     
     #line 156 "..\..\..\Admin.xaml"
     this.refreshbtnp.Click += new System.Windows.RoutedEventHandler(this.refreshbtnp_Click);
     
     #line default
     #line hidden
     return;
     case 78:
     this.tabItemS = ((System.Windows.Controls.TabItem)(target));
     return;
     case 79:
     this.labeltbls = ((System.Windows.Controls.Label)(target));
     return;
     case 80:
     this.spMainS = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 81:
     this.dataGridS = ((System.Windows.Controls.DataGrid)(target));
     
     #line 165 "..\..\..\Admin.xaml"
     this.dataGridS.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dataGridS_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 82:
     this.groupBoxS = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 83:
     this.textnos = ((System.Windows.Controls.TextBox)(target));
     return;
     case 84:
     this.textnams = ((System.Windows.Controls.TextBox)(target));
     return;
     case 85:
     this.textalmts = ((System.Windows.Controls.TextBox)(target));
     return;
     case 86:
     this.combokels = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 87:
     this.texttelps = ((System.Windows.Controls.TextBox)(target));
     return;
     case 88:
     this.datelhrs = ((System.Windows.Controls.DatePicker)(target));
     return;
     case 89:
     this.labelnos = ((System.Windows.Controls.Label)(target));
     return;
     case 90:
     this.labelnams = ((System.Windows.Controls.Label)(target));
     return;
     case 91:
     this.labelalas = ((System.Windows.Controls.Label)(target));
     return;
     case 92:
     this.labelkels = ((System.Windows.Controls.Label)(target));
     return;
     case 93:
     this.labeltelps = ((System.Windows.Controls.Label)(target));
     return;
     case 94:
     this.labellhrs = ((System.Windows.Controls.Label)(target));
     return;
     case 95:
     this.simpanbtns = ((System.Windows.Controls.Button)(target));
     
     #line 190 "..\..\..\Admin.xaml"
     this.simpanbtns.Click += new System.Windows.RoutedEventHandler(this.simpanbtns_Click);
     
     #line default
     #line hidden
     return;
     case 96:
     this.bersihbtns = ((System.Windows.Controls.Button)(target));
     
     #line 191 "..\..\..\Admin.xaml"
     this.bersihbtns.Click += new System.Windows.RoutedEventHandler(this.bersihbtns_Click);
     
     #line default
     #line hidden
     return;
     case 97:
     this.batalbtns = ((System.Windows.Controls.Button)(target));
     
     #line 192 "..\..\..\Admin.xaml"
     this.batalbtns.Click += new System.Windows.RoutedEventHandler(this.batalbtns_Click);
     
     #line default
     #line hidden
     return;
     case 98:
     this.tambahbtns = ((System.Windows.Controls.Button)(target));
     
     #line 193 "..\..\..\Admin.xaml"
     this.tambahbtns.Click += new System.Windows.RoutedEventHandler(this.tambahbtns_Click);
     
     #line default
     #line hidden
     return;
     case 99:
     this.ubahbtns = ((System.Windows.Controls.Button)(target));
     
     #line 194 "..\..\..\Admin.xaml"
     this.ubahbtns.Click += new System.Windows.RoutedEventHandler(this.ubahbtns_Click);
     
     #line default
     #line hidden
     return;
     case 100:
     this.hapusbtns = ((System.Windows.Controls.Button)(target));
     
     #line 195 "..\..\..\Admin.xaml"
     this.hapusbtns.Click += new System.Windows.RoutedEventHandler(this.hapusbtns_Click);
     
     #line default
     #line hidden
     return;
     case 101:
     this.refreshbtns = ((System.Windows.Controls.Button)(target));
     
     #line 200 "..\..\..\Admin.xaml"
     this.refreshbtns.Click += new System.Windows.RoutedEventHandler(this.refreshbtns_Click);
     
     #line default
     #line hidden
     return;
     case 102:
     this.tabItemUser = ((System.Windows.Controls.TabItem)(target));
     return;
     case 103:
     this.labeltbuser = ((System.Windows.Controls.Label)(target));
     return;
     case 104:
     this.spMainU = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 105:
     this.dataGridU = ((System.Windows.Controls.DataGrid)(target));
     
     #line 209 "..\..\..\Admin.xaml"
     this.dataGridU.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dataGridU_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 106:
     this.groupBoxU = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 107:
     this.textusername = ((System.Windows.Controls.TextBox)(target));
     return;
     case 108:
     this.labeluser = ((System.Windows.Controls.Label)(target));
     return;
     case 109:
     this.labelpass = ((System.Windows.Controls.Label)(target));
     return;
     case 110:
     this.simpanbtnuser = ((System.Windows.Controls.Button)(target));
     
     #line 221 "..\..\..\Admin.xaml"
     this.simpanbtnuser.Click += new System.Windows.RoutedEventHandler(this.simpanbtnuser_Click);
     
     #line default
     #line hidden
     return;
     case 111:
     this.bersihuser = ((System.Windows.Controls.Button)(target));
     
     #line 222 "..\..\..\Admin.xaml"
     this.bersihuser.Click += new System.Windows.RoutedEventHandler(this.bersihuser_Click);
     
     #line default
     #line hidden
     return;
     case 112:
     this.bataluser = ((System.Windows.Controls.Button)(target));
     
     #line 223 "..\..\..\Admin.xaml"
     this.bataluser.Click += new System.Windows.RoutedEventHandler(this.bataluser_Click);
     
     #line default
     #line hidden
     return;
     case 113:
     this.tambahuser = ((System.Windows.Controls.Button)(target));
     
     #line 224 "..\..\..\Admin.xaml"
     this.tambahuser.Click += new System.Windows.RoutedEventHandler(this.tambahuser_Click);
     
     #line default
     #line hidden
     return;
     case 114:
     this.ubahuser = ((System.Windows.Controls.Button)(target));
     
     #line 225 "..\..\..\Admin.xaml"
     this.ubahuser.Click += new System.Windows.RoutedEventHandler(this.ubahuser_Click);
     
     #line default
     #line hidden
     return;
     case 115:
     this.hapususer = ((System.Windows.Controls.Button)(target));
     
     #line 226 "..\..\..\Admin.xaml"
     this.hapususer.Click += new System.Windows.RoutedEventHandler(this.hapususer_Click);
     
     #line default
     #line hidden
     return;
     case 116:
     this.passwordBox1 = ((System.Windows.Controls.PasswordBox)(target));
     return;
     case 117:
     this.passwordBox2 = ((System.Windows.Controls.PasswordBox)(target));
     return;
     case 118:
     this.labelulang = ((System.Windows.Controls.Label)(target));
     return;
     case 119:
     this.labelpassl = ((System.Windows.Controls.Label)(target));
     return;
     case 120:
     this.passwordBox3 = ((System.Windows.Controls.PasswordBox)(target));
     return;
     case 121:
     this.refreshbtnusr = ((System.Windows.Controls.Button)(target));
     
     #line 236 "..\..\..\Admin.xaml"
     this.refreshbtnusr.Click += new System.Windows.RoutedEventHandler(this.refreshbtnusr_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
Example #3
0
        public void masuk()
        {
            if (!(txtUserName.Text == "" || passwordBox1.Password == ""))
            {
                if (F.checkPass(txtUserName.Text, passwordBox1.Password))
                {
                    if (txtUserName.Text == "admin")
                    {
                        Admin a = new Admin();
                        a.Show();
                        this.Hide();
                    }
                    siapa.anda = txtUserName.Text;
                    string pilih = txtUserName.Text;
                    switch (pilih[1])
                    {
                    case '1':
                        //MessageBox.Show("Dokter");
                        Dokter d = new Dokter();
                        d.Show();
                        this.Hide();
                        break;

                    case '2':
                        //MessageBox.Show("Perawat");
                        Perawat p = new Perawat();
                        p.Show();
                        this.Hide();
                        break;

                    case '3':
                        //MessageBox.Show("Karyawan");
                        Karyawan k = new Karyawan();
                        k.Show();
                        this.Hide();
                        break;

                    case '4':
                        //MessageBox.Show("Pasien");
                        Pasien s = new Pasien();
                        s.Show();
                        this.Hide();
                        break;
                    }
                }
                else if (txtUserName.Text == "su" && passwordBox1.Password == "superuser")
                {
                    Admin a = new Admin();
                    a.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Username dan Password tidak cocok", "Peringatan", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            else if (txtUserName.Text == "" && !(passwordBox1.Password == ""))
            {
                MessageBox.Show("username kosong");
            }
            else if (passwordBox1.Password == "" && !(txtUserName.Text == ""))
            {
                MessageBox.Show("password kosong");
            }
            else
            {
                MessageBox.Show("username & password kosong");
            }
        }