protected void CreateAccount_Click(object sender, EventArgs e) { using (var ent = new Commuticate.Repository.Entities()) { var comm = new Commuticate.Repository.Commuter() {Email = EmailTextBox.Text, FullName = FullNameTextBox.Text, Password = PasswordTextBox.Text}; ent.AddToCommuters(comm); ent.SaveChanges(); Program.UserId = comm.Id; } this.BindUserDetails(); }
/// <summary> /// Create a new Commuter object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="email">Initial value of the Email property.</param> /// <param name="password">Initial value of the Password property.</param> /// <param name="fullName">Initial value of the FullName property.</param> public static Commuter CreateCommuter(global::System.Int32 id, global::System.String email, global::System.String password, global::System.String fullName) { Commuter commuter = new Commuter(); commuter.Id = id; commuter.Email = email; commuter.Password = password; commuter.FullName = fullName; return commuter; }
/// <summary> /// Deprecated Method for adding a new object to the Commuters EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCommuters(Commuter commuter) { base.AddObject("Commuters", commuter); }