public bool Register(string username, string password) { if (!CheckValidUsername(username)) return false; bool result = false; try { RSSDBDataContext dt = new RSSDBDataContext(); int randomvalue = RANDOM.Next(0, int.MaxValue); string md5pass = ServiceUtility.CalculateMD5Hash(password + randomvalue.ToString()); Account account = new Account() { Username = username, Password = md5pass, Salt = randomvalue, }; dt.Accounts.InsertOnSubmit(account); dt.SubmitChanges(); result = true; } catch { result = false; } finally { } return result; }
partial void UpdateAccount(Account instance);
partial void DeleteAccount(Account instance);
partial void InsertAccount(Account instance);