示例#1
0
 partial void DeleteAuthorizationData(AuthorizationData instance);
示例#2
0
		private void detach_AuthorizationDatas(AuthorizationData entity)
		{
			this.SendPropertyChanging();
			entity.ClientData = null;
		}
示例#3
0
 partial void InsertAuthorizationData(AuthorizationData instance);
示例#4
0
 partial void UpdateAuthorizationData(AuthorizationData instance);
示例#5
0
 private void detach_AuthorizationDatas(AuthorizationData entity)
 {
     this.SendPropertyChanging();
     entity.ClientData = null;
 }
示例#6
0
		private void attach_AuthorizationDatas(AuthorizationData entity)
		{
			this.SendPropertyChanging();
			entity.ScopeData = this;
		}
示例#7
0
 partial void UpdateAuthorizationData(AuthorizationData instance);
示例#8
0
 partial void DeleteAuthorizationData(AuthorizationData instance);
示例#9
0
 partial void InsertAuthorizationData(AuthorizationData instance);
示例#10
0
 private void attach_AuthorizationDatas(AuthorizationData entity)
 {
     this.SendPropertyChanging();
     entity.ScopeData = this;
 }
示例#11
0
 public Authorization( AuthorizationData data )
 {
     Load( data );
 }
示例#12
0
        private void Load( AuthorizationData data )
        {
            Init();

            if ( data != null )
            {
                AuthorizationId = data.authorization_id;
                ClientId = data.client_id;
                ScopeId = data.scope_id;
                LoginId = data.login_id;
                DateCreated = data.date_created;
                Active = data.active;
            }
        }
示例#13
0
        public bool Save()
        {
            using ( OAuthDataContext context = OAuthContextHelper.GetContext() )
            {
                AuthorizationData data;

                if ( AuthorizationId > 0 )
                {
                    data = context.AuthorizationDatas.FirstOrDefault( a => a.authorization_id == AuthorizationId );
                }
                else
                {
                    data = new AuthorizationData();
                    data.date_created = DateTime.Now;
                }

                data.client_id = ClientId;
                data.login_id = LoginId;
                data.scope_id = ScopeId;
                data.active = Active;

                if ( AuthorizationId == 0 )
                {
                    context.AuthorizationDatas.InsertOnSubmit( data );
                }

                context.SubmitChanges();

                Load( data );

                return AuthorizationId > 0;
            }
        }