protected void Page_Load(object sender, EventArgs e) { if (Session["User_Id"] != null) { Response.Redirect("~/AnaSayfa.aspx"); } else { if (!IsPostBack) { HttpCookie LoginCookie = Request.Cookies["SecureOdev_Login"]; if (LoginCookie != null) { TxtKullanici.Text = LoginCookie["User"]; } } if (TxtKullanici.Text == "") { TxtKullanici.Focus(); } else { TxtSifre.Focus(); } } }
private void BtnGiris_Click(object sender, EventArgs e) { if (TxtSifre.Text != "") { SqlParameter[] pCollection = new SqlParameter[] { new SqlParameter("@Sifre", SqlDbType.NVarChar, 50), new SqlParameter("@AktifMi", SqlDbType.Bit) }; pCollection[0].Value = TxtSifre.Text; pCollection[1].Value = true; Cursor.Current = Cursors.WaitCursor; // Yedekleme Sistemi ---------- string Yol = @"C:\AMBAR\YEDEK\"; string Dosya = Yol + DateTime.Now.ToString("dd_MM_yyyy") + ".bak"; if ((!File.Exists(Yol + DateTime.Now.ToString("dd_MM_yyyy") + ".bak"))) { AKBclass.DBMudahale.SQLIsle("BACKUP DATABASE [AMBAR] TO DISK = N'" + Dosya + "' WITH NOFORMAT, NOINIT, NAME = N'AMBAR-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10"); } // ---------------------------- String[] Res = AKBclass.DBMudahale.TekKayitDondur("Operator_Tbl", "Ad,ID", "WHERE Sifre = @Sifre AND AktifMi = @AktifMi", pCollection); Cursor.Current = Cursors.Default; if (Res[0] == "Ad") { MessageBox.Show("Girilen Şifre Doğru Değil!", "Giriş Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Warning); TxtSifre.Focus(); TxtSifre.SelectAll(); } else { AnaFrm.LoginOldum(int.Parse(Res[1])); this.Close(); } } else { TxtSifre.Focus(); } }