Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
		private void attach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.Version = this;
		}
Ejemplo n.º 3
0
		private void detach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.Version = null;
		}
Ejemplo n.º 4
0
 partial void DeleteSession(Session instance);
Ejemplo n.º 5
0
 partial void UpdateSession(Session instance);
Ejemplo n.º 6
0
 partial void InsertSession(Session instance);
Ejemplo n.º 7
0
		private void detach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.ApplicationUser = null;
		}
Ejemplo n.º 8
0
        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);
        }