private void popBtnAddButton_Click(object sender, RoutedEventArgs e) { if (FormMode == FormModes.View) { this.ActualParent.Close(); return; } SessionEntity.created_by = SessionEntity.updated_by = Utilities.UserSession.UserID; if (FormMode == FormModes.New) { SessionEntity.created_by = Utilities.UserSession.UserID; SessionRepo.Insert(SessionEntity); } else if (FormMode == FormModes.Edit) { SessionRepo.Update(SessionEntity); } var parent = (ucSessionListView)this.ParentContainer; parent.RefreshList(); this.ActualParent.Close(); }
ISession ISessionFacade.Create(string origin) { if (string.IsNullOrEmpty(origin)) { throw new ArgumentNullException("origin"); } Session newSession = new Session() { createDT = DateTimeOffset.UtcNow , expireDT = null , origin = origin , UID = Guid.NewGuid() }; SessionRepo.Insert(newSession); Dimension.SaveChanges(); return(newSession); }