public void CreateSession(string sessionKey, DateTime clientStartTime, string callerIp, Guid versionKey, Guid? applicationUserKey, Guid? machineKey, string environment, DateTime serverTime) { using (var context = GetDataContext()) { var newSession = new Session { SessionKey = sessionKey, CallerIp = callerIp, StartClientTime = clientStartTime, StartServerTime = serverTime, LastUsedServerTime = serverTime, EndServerTime = null, ApplicationUserId = applicationUserKey != null ? context.ApplicationUsers.Single(x => x.ApplicationUserKey == applicationUserKey).ApplicationUserId : (int?)null, MachineId = machineKey != null ? context.Machines.Single(x => x.MachineKey == machineKey).MachineId : (int?)null, Enviroment = environment, VersionId = context.Versions.Single(x => x.VersionKey == versionKey).VersionId, }; context.Sessions.InsertOnSubmit(newSession); context.SubmitChanges(); } }
private void attach_Sessions(Session entity) { this.SendPropertyChanging(); entity.Version = this; }
private void detach_Sessions(Session entity) { this.SendPropertyChanging(); entity.Version = null; }
partial void DeleteSession(Session instance);
partial void UpdateSession(Session instance);
partial void InsertSession(Session instance);
private void detach_Sessions(Session entity) { this.SendPropertyChanging(); entity.ApplicationUser = null; }
private static void AddIssueTypePageIssue(Issue issue, IssueType issueType, Version version, Application application, Project project, Session session, Quilt4DataContext context) { //var dataDictionary = JsonConvert.SerializeObject(issue.IssueDatas.ToDictionary(data => data.Name, data => data.Value)); //var issueTypePageIssue = new IssueTypePageIssue //{ // ProjectKey = project.ProjectKey, // ApplicationKey = application.ApplicationKey, // VersionKey = version.VersionKey, // IssueTypeKey = issueType.IssueTypeKey, // Data = dataDictionary, // Enviroment = session.Enviroment, // ApplicationUserName = session.ApplicationUser != null ? session.ApplicationUser.UserName : "******", // LastUpdateServerTime = issue.CreationServerTime, //}; //context.IssueTypePageIssues.InsertOnSubmit(issueTypePageIssue); }