Example #1
0
        public ActionResult Log(LoginPage log,Mov move)
        {
            //var log2 = _documentSession.Load<LoginPage>(log.UserID);
            var log1 = _documentSession.Query<Mov>()
                .Where(x => x.Email==log.UserID && x.Password==log.Password)
                .Take(1).ToList();

            //var mov = _documentSession.Load<mov>(move.Email);
               // var mov1 = _documentSession.Load<LoginPage>(log.UserID);
            //var move = _documentSession.Store(mov);
            //var move1 = _documentSession.Load<LoginPage>(UserID);
            if (log1.Count > 0)
            {
                Session["Usr_Nm"] = move.Name;
                Mov[] Mov = _documentSession.Query<Mov>().Where(x => x.Email == log.UserID && x.Password == log.Password).ToArray() ;

                Session["Usr_Nm"] = Mov[0].Name;
                Session["vendor"] = log.UserID;
                Session["user1"] = "us";
                Session["user"] = "******";
                return RedirectToAction("Vendor", "Vendor", new { message = string.Format("Logged In As {0}", log.UserID) });
            }

            else
            {
               // return RedirectToAction("Log","Log", new { message = string.Format("Wrong User Id Or Password {0}") });
                return View(log);
            }
        }
Example #2
0
        public ActionResult Log()
        {
            var model = new LoginPage();
            List<SelectListItem> item = new List<SelectListItem>();

            item.Add(new SelectListItem() { Text = "English", Value = "English", Selected = true });
            item.Add(new SelectListItem() { Text = "French", Value = "French", Selected = false });
            ViewBag.Languages = item;
               // return View(model);
            return View();
        }
        public ActionResult VendorList(Vendor move, LoginPage lg)
        {
            if (Session["vendor"] != null)
            {
                var mov = _documentSession.Query<Vendor>().Where(x => x.EMailUser == Session["vendor"].ToString()).Take(50).ToList();

                //var mov = _documentSession.Query<Vendor>()
                //     .Customize(x => x.WaitForNonStaleResults())
                //     .Take(50).ToList();

                return View(mov);
            }
            else
            {
                return RedirectToAction("LogOff", new { message = string.Format("Please Login Again") });
                //return View();
            }
        }
Example #4
0
 public ActionResult Create(LoginPage log)
 {
     if (!ModelState.IsValid)
         return View();
     _documentSession.Store(log.UserID);
        // _documentSession.SaveChanges();
     return RedirectToAction("CreateLog", new { message = string.Format("LoginPage {0}", log.UserID)});
 }
 public ActionResult Login()
 {
     var model = new LoginPage();
     return View(model);
 }