示例#1
0
文件: Userdb.cs 项目: SaifAsad/urlbay
 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();
 }
示例#3
0
文件: Userdb.cs 项目: SaifAsad/urlbay
 public void Insert(tbl_User user)
 {
     db.tbl_User.Add(user);
     db.Configuration.ValidateOnSaveEnabled = false;
     Save();
     db.Configuration.ValidateOnSaveEnabled = true;
 }
示例#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");
     }
 }
示例#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");
     }
 }
示例#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");
     }
 }
示例#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");
            }
        }
示例#10
0
文件: UserDb.cs 项目: esrshn/LinkHub
 public void Update(tbl_User category)
 {
     db.Entry(category).State = EntityState.Modified;
     Save();
 }
示例#11
0
文件: UserDb.cs 项目: esrshn/LinkHub
 public void Insert(tbl_User url)
 {
     db.tbl_User.Add(url);
     Save();
 }
示例#12
0
文件: UserBs.cs 项目: SaifAsad/urlbay
 public void Update(tbl_User user)
 {
     objDB.Update(user);
 }
示例#13
0
文件: UserBs.cs 项目: SaifAsad/urlbay
 public void Insert(tbl_User user)
 {
     objDB.Insert(user);
 }
示例#14
0
 public void Update(tbl_User url)
 {
     objDb.Update(url);
 }
示例#15
0
 public void Insert(tbl_User url)
 {
     objDb.Insert(url);
 }