コード例 #1
0
        public ActionResult profiles(String Hak, String yas, String cinsiyet, String tel)
        {
            GoodChatEntities7 db = new GoodChatEntities7();

            Hak = Request.Form["Hak"];
            yas = Request.Form["yas"];

            cinsiyet = Request.Form["Cinsiyet"];
            tel      = Request.Form["tel"];
            String  mail    = Session["mail"].ToString();
            Account account = new Account();


            int      ys;
            DateTime dogumtarihi;

            dogumtarihi = Convert.ToDateTime(yas);
            ys          = DateTime.Now.Year - dogumtarihi.Year;

            var Context = db.Account.Where(s => s.mail == mail).FirstOrDefault();

            Context.About_me = Hak;
            Context.age      = ys;

            Context.gender = cinsiyet;



            db.SaveChanges();

            return(View());
        }
コード例 #2
0
        public ActionResult SavesLogin(String name, String tel, String pass, String mail)
        {
            name = Request.Form["user"];
            tel  = Request.Form["tel"];
            pass = Request.Form["pass"];
            mail = Request.Form["mail"];

            Account           account = new Account();
            GoodChatEntities7 db      = new GoodChatEntities7();

            account.user_name     = name;
            account.user_password = pass;
            account.phone         = tel;
            account.mail          = mail;
            account.About_me      = "Bilinmiyor";
            account.age           = 0;
            account.gender        = "Bilinmiyor";
            db.Account.Add(account);
            db.SaveChanges();

            var Context = new GoodChatEntities7();
            var sorgu   = Context.Account.Where(e => e.user_name == name && e.user_password == pass);
            var result  = sorgu.Count();

            if (result > 0)
            {
                Session.Add("names", name);
                Session.Add("mail", mail);



                GoodChatEntities7 entities4 = new GoodChatEntities7();



                return(Redirect("profil"));
            }
            else
            {
                Response.Write("kayıt eklenemedi");
            }
            return(null);
        }