Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            AddCategoryPage addCategoryPage = new AddCategoryPage();

            addCategoryPage.Show();
        }
Exemplo n.º 2
0
 private void btnLogin_Click_1(object sender, EventArgs e)
 {
     if (txtUserName.Text == string.Empty)
     {
         MessageBox.Show("Lütfen Kullanıcı Adı Giriniz!");
         return;
     }
     else
     {
         if (db.AppUsers.Where(x => x.UserName == txtUserName.Text).ToList().Count > 0)
         {
             loginUser = db.AppUsers.FirstOrDefault(x => x.UserName == txtUserName.Text);
             if (loginUser.Password == txtPassword.Text)
             {
                 if (Role.Admin == (Role)Enum.Parse(typeof(Role), cmbSelectRole.SelectedItem.ToString()))
                 {
                     this.Hide();
                     AddCategoryPage addCategoryPage = new AddCategoryPage();
                     addCategoryPage.Show();
                 }
                 else
                 {
                 }
             }
             else
             {
                 MessageBox.Show("Yanlış Şifre Girdiniz!Admin girişi yapmalısınız.");
             }
         }
         else
         {
             MessageBox.Show("Yanlış Kullancı Adı.");
             return;
         }
     }
 }