public frmKasaHareketDokumu(frmAnaSayfa mainForm) { InitializeComponent(); this.mainForm = mainForm; mng = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType()); mngKasa = mng.GetKasaManager(); mngkasaHar = mng.GetKasaHarManager(); LoadKasa(); }
private void btnGiris_Click(object sender, EventArgs e) { try { Kullanici kul = mngUSer.GetKullaniciByUserNamePassword(Kullanici.Encryt(txtSifre.Text), txtKulAdi.Text, cmbSube.Text); //Kullanici kul = mngUSer.GetKullaniciByUserNamePassword(txtSifre.Text, txtKulAdi.Text, int.Parse(cmbSube.Text)); if (kul != null) { UserInfo.Kullanici = kul; UserInfo.Sube = mngSube.GetById(cmbSube.Text, false); mngUSer.CloeseSession(); frmAnaSayfa frm = new frmAnaSayfa(); frm.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı Adı veya şifre yanlış"); } //InitiliazeHanData(); //Kullanici kul = new Kullanici(); //kul.Password = "******"; //kul.Sube = new Sube { Id = 1 }; //mngUSer.BeginTransaction(); //mngUSer.Save(kul); //mngUSer.CommitTransaction(); //Kullanici k2 = mngUSer.GetKullaniciByUserNamePassword("123","hasan",1); //k2.Sube = new Sube { Id = 499 }; //mngUSer.BeginTransaction(); //mngUSer.SaveOrUpdate(k2); //mngUSer.CommitTransaction(); //FinalizeHanData(); } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); } //UserInfo.Sube = new Sube { Id = 1 }; //frmAnaSayfa frm = new frmAnaSayfa(); //frm.Show(); //this.Hide(); }