예제 #1
0
 /// <summary>
 /// Burada Kullanıcı tanıtma işlemlerini yapıyoruz.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void kullanıcıTanıtmaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms["UIUserIdentification"] == null)
     {
         UIUserIdentification user = new UIUserIdentification();
         user.MdiParent = this.MdiParent;
         user.Show();
         user.Location = new Point(270, 190);
     }
     else
     {
         MessageBox.Show("Hasta işlemleri formu zaten açılmıştır. Tekrar açmaya çalışmayınız !! ",
                         "Bildiri",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
     }
 }
예제 #2
0
 /// <summary>
 /// Sil (Delete) butonuna basıldığında ilgili kullanıcının veritabanından silinmesi işlemi gerçekleşmektedir ...
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSil_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Silmek istediğinize emin misiniz ?",
                         "Uyarı",
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         KullaniciContract crud = new KullaniciContract();
         crud.DeletedUser(txtKullaniciKod.Text);
         MessageBox.Show("Başarı ile silme işlemi gerçekleşmiştir. Silinen Kayıt : " +
                         txtKullaniciKod.Text,
                         "Bilgi",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
         UIUserIdentification user = new UIUserIdentification();
         user.LoadUser();
         this.Close();
     }
 }
예제 #3
0
        /// <summary>
        /// Duruma göre Insert / Update işlemi yapılmaktadır .. .
        /// </summary>
        public void AddOrUpdateByStataus()
        {
            #region Buton = "Kaydet" ise -->
            if (btnGüncelle.Text.Equals("Kaydet"))
            {
                #region Eklenecek veriler kullanici tablosundaki ilgili alanlara aktarılıyor ..
                kullanici user = new kullanici();
                user.Code          = txtKullaniciKod.Text;
                user.TCKN          = txtTcNo.Text;
                user.PlateOfBirthh = txtDogumYeri.Text;
                user.FatherName    = txtBabaAdi.Text;
                user.MotherName    = txtAnneAdi.Text;
                user.Title         = cmbUnvan.Text;
                user.Name          = txtAd.Text;
                user.MobilePhone   = txtTelNo.Text;
                user.SurName       = txtSoyad.Text;
                user.Salary        = txtMaas.Text;
                user.HomePhone     = txtGsm.Text;
                user.StartWork     = Convert.ToDateTime(dtIseBaslama.Value.ToShortDateString());
                user.DateOfBirth   = Convert.ToDateTime(dtDogumTarih.Value.ToShortDateString());
                user.Gender        = cmbCinsiyet.Text;
                user.BloodGroup    = cmbKanGrubu.Text;
                user.MarialStatus  = cmbMedeniHal.Text;
                user.Address       = txtAdres.Text;
                user.UserName      = txtKullaniciAdi.Text;
                user.Password      = txtSifre.Text;
                if (chkYetkiliKullanici.Checked)
                {
                    user.Authority = "var";
                }
                else
                {
                    user.Authority = "yok";
                }
                KullaniciContract crud = new KullaniciContract();
                if (!crud.InsertUserTable(user))
                {
                    MessageBox.Show("Lütfen Tüm alanları doldurunuz !");
                }

                UIUserIdentification userIden = new UIUserIdentification();
                userIden.LoadUser();
                this.Close();
                MessageBox.Show("Kayıt işlemi gerçekleşmiştir. Kaydedilen Kayıt : " + txtKullaniciKod.Text, "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                #endregion
            }
            #endregion
            #region Buton = "Güncelle" ise -->
            else
            {
                #region Güncellenecek bilgiler değişiklik sonucunda kullanici tablosundakii ilgili alanlara aktarılmaktadır ..
                DialogResult result = MessageBox.Show("Güncellemek istediğinize emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    kullanici user = new kullanici();
                    user.Code          = txtKullaniciKod.Text;
                    user.TCKN          = txtTcNo.Text;
                    user.PlateOfBirthh = txtDogumYeri.Text;
                    user.FatherName    = txtBabaAdi.Text;
                    user.MotherName    = txtAnneAdi.Text;
                    user.Title         = cmbUnvan.Text;
                    user.Name          = txtAd.Text;
                    user.MobilePhone   = txtTelNo.Text;
                    user.SurName       = txtSoyad.Text;
                    user.Salary        = txtMaas.Text;
                    user.HomePhone     = txtGsm.Text;
                    user.StartWork     = Convert.ToDateTime(dtIseBaslama.Value.ToShortDateString());
                    user.DateOfBirth   = Convert.ToDateTime(dtDogumTarih.Value.ToShortDateString());
                    user.Gender        = cmbCinsiyet.Text;
                    user.BloodGroup    = cmbKanGrubu.Text;
                    user.MarialStatus  = cmbMedeniHal.Text;
                    user.Address       = txtAdres.Text;
                    user.UserName      = txtKullaniciAdi.Text;
                    user.Password      = txtSifre.Text;
                    if (chkYetkiliKullanici.Checked)
                    {
                        user.Authority = "var";
                    }
                    else
                    {
                        user.Authority = "yok";
                    }
                    KullaniciContract crud = new KullaniciContract();
                    if (!crud.UpdateUserTable(user))
                    {
                        MessageBox.Show("Lütfen Tüm alanları doldurunuz !");
                    }
                    MessageBox.Show("Güncelleme işlemi gerçekleşmiştir. Güncellenen Kayıt : " + txtKullaniciKod.Text,
                                    "Bilgi",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    UIUserIdentification userIden = new UIUserIdentification();
                    userIden.LoadUser();
                    this.Close();
                }
                #endregion
            }
            #endregion
        }