Esempio 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();
     }
 }
Esempio 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;
     }
 }
Esempio n. 3
0
 partial void DeleteLoginDetail(LoginDetail instance);
Esempio n. 4
0
 partial void UpdateLoginDetail(LoginDetail instance);
Esempio n. 5
0
 partial void InsertLoginDetail(LoginDetail instance);
Esempio n. 6
0
		private void detach_LoginDetails(LoginDetail entity)
		{
			this.SendPropertyChanging();
			entity.RoleDetail = null;
		}