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