コード例 #1
0
ファイル: admin.aspx.cs プロジェクト: ysBayram/MTakip
 protected void btnKaydet_Click(object sender, EventArgs e)
 {
     try
     {
         ADMIN mn = new ADMIN();
         mn.K_AD = tbK_Ad.Text;
         mn.SFR  = tbPass.Text;
         mn.MAIL = tbMail.Text;
         mn.YET  = rbtnYetki.SelectedValue;
         if (AddEdit == 0)
         {
             ADMINCRUD.Kaydet(mn);
             Page.ClientScript.RegisterStartupScript(this.GetType(), "bilgi", "$.jGrowl('" + "Kaydetme Başarılı" + "', { header: 'Sonuç' });", true);
         }
         else
         {
             mn.SON_GRS = DateTime.Now.ToShortDateString().ToString() + " - " + DateTime.Now.ToShortTimeString().ToString();
             mn.ID      = AddEdit;
             ADMINCRUD.Guncelle(mn);
             Page.ClientScript.RegisterStartupScript(this.GetType(), "bilgi", "$.jGrowl('" + "Güncelleme Başarılı" + "', { header: 'Sonuç' });", true);
         }
         ADMGetir();
     }
     catch
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "bilgi", "$.jGrowl('" + "İşleminizde Hata Oluştu Lütfen Kontrol Ediniz!" + "', { header: 'Sonuç' });", true);
     }
 }
コード例 #2
0
ファイル: login.aspx.cs プロジェクト: ysBayram/MTakip
        protected void btnGiris_Click(object sender, EventArgs e)
        {
            int adminsay = Convert.ToInt32(ADMINCRUD.TekDegerGetir("SELECT COUNT(*) FROM ADMIN"));

            for (int i = 1; i <= adminsay; i++)
            {
                ADMIN admin = ADMINCRUD.IdyeGoreADMINGetir(i);

                if (tbK_Ad.Text == admin.K_AD && tbPass.Text == admin.SFR)
                {
                    Session["anahtar"] = "acik";
                    Session["admin"]   = admin.ID.ToString();
                    admin.SON_GRS      = DateTime.Now.ToShortDateString().ToString() + " - " + DateTime.Now.ToShortTimeString().ToString();
                    admin.MAIL         = admin.MAIL;
                    admin.ID           = admin.ID;
                    ADMINCRUD.Guncelle(admin);
                    Response.Redirect("Anasayfa");
                }
                else
                {
                    divSonuc.Visible = true;
                }
            }
        }