예제 #1
0
        public bool CreateNotify(Notify instance)
        {
            if (instance.ID == 0)
            {
                Db.Notifies.InsertOnSubmit(instance);
                Db.Notifies.Context.SubmitChanges();
                return true;
            }

            return false;
        }
예제 #2
0
        public bool UpdateNotify(Notify instance)
        {
            var cache = Db.Notifies.FirstOrDefault(p => p.ID == instance.ID);
            if (cache != null)
            {
                cache.UserID = instance.UserID;
                cache.Message = instance.Message;
                cache.AddedDate = instance.AddedDate;
                cache.IsReaded = instance.IsReaded;
                Db.Notifies.Context.SubmitChanges();
                return true;
            }

            return false;
        }
 partial void DeleteNotify(Notify instance);
 partial void UpdateNotify(Notify instance);
 partial void InsertNotify(Notify instance);
		private void detach_Notifies(Notify entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Notifies(Notify entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}