Exemplo n.º 1
0
        public JsonResult GirisYap(string kulAd, string sifre)
        {
            using (s = new ServiceReference1.Service1Client())
            {
                ServiceReference1.kullanici k = new ServiceReference1.kullanici();
                k.kullaniciAdi = kulAd;
                k.sifre        = sifre;
                int kId = s.GirisYap(k);

                s.Close();

                if (k != null && kId != 0)
                {
                    //Response.Cookies["idUserID"].Value = k.kullaniciId.ToString();
                    //Response.Cookies["idUserID"].Expires = DateTime.Now.AddDays(1);
                    //Response.Cookies["idUserName"].Value = k.kullaniciAdi.ToString();
                    //Response.Cookies["idUserName"].Expires = DateTime.Now.AddDays(1);

                    //HttpCookie aCookie = new HttpCookie("lastVisit");
                    //aCookie.Value = DateTime.Now.ToString();
                    //aCookie.Expires = DateTime.Now.AddDays(1);
                    //Response.Cookies.Add(aCookie);
                    Session.Add("kId", kId);
                    return(Json("+"));
                }
                else
                {
                    return(Json("- Giriş yapılamadı."));
                }
            }
        }
Exemplo n.º 2
0
 public JsonResult Kaydol(ServiceReference1.kullanici kul)
 {
     using (s = new ServiceReference1.Service1Client())
     {
         kul = new ServiceReference1.kullanici()
         {
             kullaniciAdi = kul.kullaniciAdi,
             sifre        = kul.sifre,
             email        = kul.email
         };
         int sonuc = s.KayitOl(kul);
         s.Close();
         if (sonuc == 0)
         {
             return(Json("+"));
         }
         else
         {
             return(Json("-"));
         }
     }
 }