private void AddKierunekCommand(object parameter) { GroupRegistration frm = new GroupRegistration(CurrentStudentId); Nullable <bool> dialogResult = frm.ShowDialog(); ListaGrup = Student.CurentStudentGroupList(_wybranyIndex); }
static public void SaveBlindParticipant(APIServer server, GroupRepository groupRepository) { Console.WriteLine("Enter the group for which you want to register participants:"); var groupName = Console.ReadLine(); Console.WriteLine("Enter participant email address that you want to be saved as blind participant:"); var participantEmail = Console.ReadLine(); var group = server.GetGroupByName(groupName); var factor = File.ReadAllText("BlindFactor.txt"); BigInteger blindFactor = new BigInteger(factor); var fileToRead = (participantEmail.Substring(0, participantEmail.IndexOf("@")) + "PublicKey.txt").ToString(); RsaKeyParameters participantPublicKey = (RsaKeyParameters)RsaKeyUtils.GetDeserializedKPublicKey(File.ReadAllText(fileToRead)); GroupRegistration groupRegistration = new GroupRegistration(group, new ContentBlinder(group.RsaPublicKey, blindFactor), participantPublicKey); ClientParticipant clientParticipant = new ClientParticipant(server, groupRepository); VerifiedParticipant verifiedParticipant = clientParticipant.CheckVerifiedEntity(group, participantEmail, groupRegistration); clientParticipant.AddClientCertificate(verifiedParticipant, group, participantEmail); Console.WriteLine("Enter nickname:"); var nickname = Console.ReadLine(); clientParticipant.AddBlindParticipant(group.Id, verifiedParticipant, nickname); Console.WriteLine(); Console.WriteLine("Participant was saved as a blind participant to the group"); }
public void TestCache() { NHibernateProfiler.Initialize(); var groupNames = new[] { "a1", "b1", "c1" }; using (var session = SessionFactory.OpenSession()) using (var tx = session.BeginTransaction()) { session.CreateSQLQuery("delete from dbo.Registrations;delete from dbo.[Group]") .ExecuteUpdate(); session.CreateSQLQuery("delete from dbo.[User]"); groupNames.ForEach(x => { var group = new Group { Id = Guid.NewGuid(), Name = x, Date = DateTime.UtcNow }; session.Save(group); }); tx.Commit(); } using (var session = SessionFactory.OpenSession()) using (var tx = session.BeginTransaction()) { var user = new User { Name = "User1", Id = Guid.NewGuid(), Date = DateTime.UtcNow }; session.Save(user); tx.Commit(); } using (var session = SessionFactory.OpenSession()) using (var tx = session.BeginTransaction()) { var user = session.Query <User>().First(); var groups = GetGroups(session); var group = groups.First(); var registration = new GroupRegistration { Id = Guid.NewGuid(), User = user, Group = group, Date = DateTime.UtcNow }; user.Registrations.Add(registration); group.Registrations.Add(registration); session.Save(registration); session.Flush(); tx.Commit(); } using (var session = SessionFactory.OpenSession()) { var g = GetGroups(session); } using (var session = SessionFactory.OpenSession()) { var g = GetGroups(session); } }
public static void ClearAll() { SearchResumeBank.SearchManifest = null; SearchResumeBank.SearchBuilder = null; SearchJobPostings.SearchManifest = null; SearchJobPostings.SearchBuilder = null; PlaceAnOrder.ShoppingCart = null; RenewMembership.Membership = null; CustomizePage.Clear(); RenewMembership.Clear(); CreateAccount.Clear(); RegisterForEvent.Clear(); GroupRegistration.Clear(); EnterCompetition.Clear(); PostAJob.Clear(); PlaceAnOrder.Clear(); ViewChapterMembers.Clear(); ViewSectionMembers.Clear(); ViewOrganizationalLayerMembers.Clear(); SearchDirectory.Clear(); SearchJobPostings.Clear(); SearchEventRegistrations.Clear(); SearchResumeBank.Clear(); AddContact.Clear(); CustomizePage.Clear(); // just wipe all keys // throw new NotSupportedException(); /* * List<string> keys = new List<string>(); * foreach (string key in HttpContext.Current.Session.Keys) * if (key.StartsWith("MemberSuite:")) * keys.Add(key); * * foreach( var key in keys ) * HttpContext.Current.Session[key] = null; * */ }