Exemplo n.º 1
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         LoginDetail lgd = new LoginDetail
         {
             LOGIN_USERNAME = collection["Username"],
             LOGIN_PASSWORD = collection["Password"],
             LOGIN_DISPLAY_NAME = collection["DisplayName"],
             LOGIN_EMAIL = collection["Email"],
             ROLE_ID = 2
         };
         String result = um.Insert(lgd);
         if (result == Constants.INSERT_SUCCESS)
         {
             return RedirectToAction("Login");
         }
         else
         {
             ViewData["Error"] = result;
             return View();
         }
     }
     catch
     {
         return View();
     }
 }
Exemplo n.º 2
0
 public String Insert(LoginDetail lgd)
 {
     db.LoginDetails.InsertOnSubmit(lgd);
     try
     {
         db.SubmitChanges();
         //inser success. Get id and make pass
         int id = lgd.LOGIN_ID;
         string newPass = id + lgd.LOGIN_PASSWORD;
         var update = from lg in db.LoginDetails
                      where lg.LOGIN_ID == lgd.LOGIN_ID
                      select lg;
         string result = Utils.GetHash(newPass, SampleWebsite.Libs.Utils.HashType.SHA1);
         update.Single().LOGIN_PASSWORD = result;
         db.SubmitChanges();
         return Constants.INSERT_SUCCESS;
     }
     catch (Exception ex) {
         return ex.Message;
     }
 }
Exemplo n.º 3
0
 partial void DeleteLoginDetail(LoginDetail instance);
Exemplo n.º 4
0
 partial void UpdateLoginDetail(LoginDetail instance);
Exemplo n.º 5
0
 partial void InsertLoginDetail(LoginDetail instance);
Exemplo n.º 6
0
		private void detach_LoginDetails(LoginDetail entity)
		{
			this.SendPropertyChanging();
			entity.RoleDetail = null;
		}