Exemplo n.º 1
0
 public void Update(tbl_User user)
 {
     db.Entry(user).State = EntityState.Modified;
     db.Configuration.ValidateOnSaveEnabled = false;
     Save();
     db.Configuration.ValidateOnSaveEnabled = true;
 }
 public void Insert(tbl_User user)
 {
     user.c_Password = Hashing.HashPassword(user.c_Password);
     user.c_ConfirmPassword = user.c_Password;
     db.tbl_User.Add(user);
     Save();
 }
Exemplo n.º 3
0
 public void Insert(tbl_User user)
 {
     db.tbl_User.Add(user);
     db.Configuration.ValidateOnSaveEnabled = false;
     Save();
     db.Configuration.ValidateOnSaveEnabled = true;
 }
Exemplo n.º 4
0
        public ActionResult Create(tbl_User model)
        {
            if (!ModelState.IsValid)
                return View("Index");

            try
            {
                model.Role = "U";
                objBs.userBs.Insert(model);
                TempData["Msg"] = "Created Successfully";
            }
            catch (Exception exception)
            {
                TempData["Msg"] = "Create Failed : " + exception.Message;
            }

            return RedirectToAction("Index");
        }
 public ActionResult Create(tbl_User user)
 {
     try
     {
         if (ModelState.IsValid)
         {
             user.c_Role = "U";
             _objBl.userBl.Insert(user);
             TempData["Msg"] = "Created Successfully!";
             return RedirectToAction("Index");
         }
         else
         {
             return View("Index");
         }
     }
     catch (Exception e1)
     {
         TempData["Msg"] = "Fail to create new user: "******" Error relate to: " + e1.Source;
         return RedirectToAction("Index");
     }
 }
 public ActionResult SignIn(tbl_User user)
 {
     try
     {
         // Bcrypt no change - Changes insidce ValidateUser
         if (Membership.ValidateUser(user.c_UserEmail, user.c_Password))
         {
             FormsAuthentication.SetAuthCookie(user.c_UserEmail, false);
             return RedirectToAction("Index", "Home", new { area = "Common" });
         }
         else
         {
             TempData["Msg"] = "Login Failure - make sure right user/password combination!";
             return RedirectToAction("Index");
         }
     }
     catch (Exception e1)
     {
         TempData["Msg"] = "Failed: " + e1.Message + " Error relate to: " + e1.Source;
         return RedirectToAction("Index");
     }
 }
Exemplo n.º 7
0
 public ActionResult SignIn(tbl_User user)
 {
     //use the membership class to check if the user exist in the system
     try
     {
         if (Membership.ValidateUser(user.UserEmail, user.Password))
         {
             FormsAuthentication.SetAuthCookie(user.UserEmail, false);
             return RedirectToAction("Index", "Home", new { area = "Common" });
         }
         else
         {
             TempData["Msg"] = "Login Failed  ";
             return RedirectToAction("Index");
         }
     }
     catch (Exception e)
     {
         TempData["Msg"] = "Login Failed  " + e.Message;
         return RedirectToAction("Index");
     }
 }
Exemplo n.º 8
0
 public ActionResult Create(tbl_User user)
 {
     try
     {
         if(ModelState.IsValid)
         {
             user.Role = "U";
             objBs.userBs.Insert(user);
             TempData["Msg"] = "Created Successfully";
             return RedirectToAction("Index");
         }
         else
         {
             return View("Index");
         }
     }
     catch(Exception e)
     {
         TempData["Msg"] = "Create Failed :" + e.Message;
         return RedirectToAction("Index");
     }
 }
Exemplo n.º 9
0
        public ActionResult SignIn(tbl_User model, string returnurl)
        {
            try
            {
                if (!Membership.ValidateUser(model.UserEmail, model.Password))
                {
                    TempData["Msg"] = "Login Failed";
                    return RedirectToAction("Index");
                }

                FormsAuthentication.SetAuthCookie(model.UserEmail, false);

                if (!string.IsNullOrWhiteSpace(returnurl))
                    return Redirect(returnurl);

                return RedirectToAction("Index", "Home", new { area = "Common" });
            }
            catch (Exception exception)
            {
                TempData["Msg"] = "Login Failed" + exception.Message;
                return RedirectToAction("Index");
            }
        }
Exemplo n.º 10
0
 public void Update(tbl_User category)
 {
     db.Entry(category).State = EntityState.Modified;
     Save();
 }
Exemplo n.º 11
0
 public void Insert(tbl_User url)
 {
     db.tbl_User.Add(url);
     Save();
 }
Exemplo n.º 12
0
 public void Update(tbl_User user)
 {
     objDB.Update(user);
 }
Exemplo n.º 13
0
 public void Insert(tbl_User user)
 {
     objDB.Insert(user);
 }
Exemplo n.º 14
0
 public void Update(tbl_User url)
 {
     objDb.Update(url);
 }
Exemplo n.º 15
0
 public void Insert(tbl_User url)
 {
     objDb.Insert(url);
 }