Beispiel #1
0
        public ActionResult ComplainerRegistraion(Registration g)
        {
            DatabaseDropYourComplainEntities3 db = new DatabaseDropYourComplainEntities3();

            db.Registrations.Add(g);
            var st = db.SaveChanges();

            if (st > 0)
            {
                ViewBag.msg = "Registration Done Successfully";
                return(RedirectToAction("CheckComplaiStatus"));
            }
            else
            {
                ViewBag.msg = "Invailed! Email or Password";
            }
            ModelState.Clear();
            return(View());
        }
Beispiel #2
0
        public ActionResult ComplainerLogin(Registration lg)
        {
            if (ModelState.IsValid)
            {
                using (DatabaseDropYourComplainEntities3 ue = new DatabaseDropYourComplainEntities3())
                {
                    var log = ue.Registrations.Where(a => a.UserName.Equals(lg.UserName) && a.Passwords.Equals(lg.Passwords)).FirstOrDefault();
                    if (log != null)
                    {
                        Session["UserName"] = log.UserName;
                        return(RedirectToAction("CheckComplaiStatus", "Complain"));
                    }

                    else
                    {
                        Response.Write("<script> alert('Invaild password')</script>");
                    }
                }
            }
            return(View());
        }