private void btnLogin_Click(object sender, EventArgs e) { string userName, password; userName = txtUserName.Text; password = txtPassword.Text; Users user = db.Users.Where(x => x.UserName == userName && x.Password == password).FirstOrDefault(); if (user != null) { if (user.isManager == true) { AdminForms.Dashboard dashboard = new AdminForms.Dashboard(); this.Hide(); dashboard.ShowDialog(); } else { PersonelForms.SmartMedicine sm = new PersonelForms.SmartMedicine(); this.Hide(); sm.ShowDialog(); } } else { MessageBox.Show("Kullanıcı adı veya parola yanlış."); } }
private void btnBack_Click(object sender, EventArgs e) { Dashboard dashboard = new Dashboard(); this.Hide(); dashboard.ShowDialog(); }
private void ManufacturerList_FormClosed(object sender, FormClosedEventArgs e) { Dashboard dashboard = new Dashboard(); this.Hide(); dashboard.ShowDialog(); }
private void MedicineOfDiseasesCreate_FormClosed(object sender, FormClosedEventArgs e) { Dashboard dashboard = new Dashboard(); this.Hide(); dashboard.ShowDialog(); }
private void btnCreate_Click(object sender, EventArgs e) { try { MedicineOfDiseases mod = new MedicineOfDiseases(); mod.M_ID = int.Parse(cmbbxMedicines.SelectedValue.ToString()); mod.D_ID = int.Parse(cmbbxDiseases.SelectedValue.ToString()); mod.MinAge = int.Parse(txtMinAge.Text); if (txtMaxAge.Text != "" && txtMaxAge.Text != null) { mod.MaxAge = int.Parse(txtMaxAge.Text); } db.MedicineOfDiseases.Add(mod); db.SaveChanges(); DialogResult result = MessageBox.Show(this, "Hastalık-ilaç bağlama işlemi başarıyla kayıt edildi.", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Question); if (result == DialogResult.OK) { this.Hide(); Dashboard dashboard = new Dashboard(); dashboard.ShowDialog(); } } catch (Exception) { DialogResult result = MessageBox.Show(this, "Hastalık-ilaç bağlama işlemi kaydedilirken hata ile karşılaşıldı.", "Hata !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCreate_Click(object sender, EventArgs e) { try { Manufacturers manufacturer = new Manufacturers(); manufacturer.Name = txtName.Text; db.Manufacturers.Add(manufacturer); db.SaveChanges(); DialogResult result = MessageBox.Show(this, "Firma başarıyla kayıt edildi.", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Question); if (result == DialogResult.OK) { this.Hide(); Dashboard dashboard = new Dashboard(); dashboard.ShowDialog(); } } catch (Exception ex) { DialogResult result = MessageBox.Show(this, "Firma oluştururken hata ile karşılaşıldı.", "Hata !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }