Exemple #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Utilities.FormPreferences.FromSettings(this);
     dgwListe.DataSource = _cksManager.GetAll();
     Utilities.FormPreferences.DataGridSettings(dgwListe, new string[] { "Id" });
     cmboxMahalleKoy.DataSource     = Utilities.RequiredLists.VillageNameList();
     dgwListe.Columns[1].HeaderText = "Dosya No";
     dgwListe.Columns[2].HeaderText = "Tc Numarası";
     dgwListe.Columns[3].HeaderText = "İsim";
     dgwListe.Columns[4].HeaderText = "Baba Adı";
     dgwListe.Columns[5].HeaderText = "Mahalle/Köy";
     dgwListe.Columns[6].HeaderText = "Cep Telefonu";
     dgwListe.Columns[7].HeaderText = "Ev Telefonu";
     dgwListe.Columns[8].HeaderText = "Kayıt Tarihi";
     dgwListe.Columns[9].HeaderText = "Not";
     txtAddDosyaNo.Text             = _cksManager.DosyaNoFactory().ToString();
 }
Exemple #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     Utilities.ErrorHandle._try(() =>
     {
         if (Islem == Operation.EklemeIslemi)
         {
             var ciftci = FormToEntity();
             int result = _ciftcilerManager.Add(ciftci);
             if (result > 0)
             {
                 dgwList.DataSource = _ciftcilerManager.GetAll().OrderByDescending(I => I.Id).ToList();
                 Utilities.Mesaj.MessageBoxInformation("Kayıt Başarılı");
                 if (_formNerdenGeldi == FormNerdenGeldi.CksKayitDefteri)
                 {
                     Form f = Application.OpenForms["CksForm"];
                     foreach (var item in f.Controls)
                     {
                         if (item is DataGridView)
                         {
                             DataGridView dgw      = (DataGridView)item;
                             CksManager cksManager = new CksManager();
                             dgw.DataSource        = cksManager.GetAll();
                         }
                     }
                     this.Close();
                 }
             }
         }
         else if (Islem == Operation.GuncellemeIslemi)
         {
             //guncelleme işlemi yap.
             var ciftci = FormToEntity();
             ciftci.Id  = (int)txtTc.Tag;
             int result = _ciftcilerManager.Update(ciftci);
             //formu temizle
             FormuTemizle();
             //Listeyi güncelle
             dgwList.DataSource = _ciftcilerManager.GetAll().OrderByDescending(I => I.Id).ToList();
             btnAdd.Text        = "Yeni Kayıt Ekle";
             Islem = Operation.EklemeIslemi;
         }
     });
 }