상속: 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);
        }