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(); }
public void Snooze(Commuticate.Repository.QueSchedule queSchudle, TimeSpan delay) { using (var rep = new Entities()) { var snoozeQue = new QueSchedule() { AtTime = DateTime.Now.Add(delay).TimeOfDay, Que = queSchudle.Que, OnDays = queSchudle.OnDays, NotifyEmail = queSchudle.NotifyEmail, NotifySMS = queSchudle.NotifySMS, NotifyTwitter = queSchudle.NotifyTwitter, RunOnce = true }; rep.AddToQueSchedules(snoozeQue); rep.SaveChanges(); } }