private void btnCustomerLogin_Click(object sender, RoutedEventArgs e) { bool success = LoginRegisterViewModel .LoginCustomer (tbCustomerEmailLogin.Text, tbCustomerPasswordLogin.Password); if (success && Session.isLogin) { this.Hide(); if (Session.role.ToUpper() == "ADMIN") { HomeAdminView hav = new HomeAdminView(); hav.ShowDialog(); } else { CustomerView cv = new CustomerView(); cv.ShowDialog(); } Utility.TraverseVisualTree(this); this.Show(); } }
//Button Seller Login private void btnSellerLogin_Click(object sender, RoutedEventArgs e) { bool success = LoginRegisterViewModel .LoginSeller (tbSellerEmailLogin.Text, tbSellerPasswordLogin.Password); if (success && Session.isLogin) { this.Hide(); if (Session.role.ToUpper() == "ADMIN") { HomeAdminView hav = new HomeAdminView(); hav.ShowDialog(); } else { //Seller View (Diganti kalau sudah ada View) SellerView sv = new SellerView(); sv.ShowDialog(); } this.Show(); Utility.TraverseVisualTree(this); } }