/// <exclude />
        public void Remove(object entity, string tableName)
        {
            EnsureTableInitialized(tableName);

            ITable table = _tables[tableName];

            table.Attach(entity);
            table.DeleteOnSubmit(entity);
        }
예제 #2
0
 void IDAL.IAdmin.Remove(AdminInfo admin)
 {
     try
     {
         DataContext ctx    = new DataContext(connection);
         ITable      admins = ctx.GetTable <AdminInfo>();
         admins.Attach(admin);
         admins.DeleteOnSubmit(admin);
         ctx.SubmitChanges();
     }
     finally
     {
     }
 }
예제 #3
0
파일: Teacher.cs 프로젝트: Ideal2014/Ideal
        void IDAL.ITeacher.Remove(TeacherInfo teacher)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable teachers = ctx.GetTable <TeacherInfo>();
                teachers.Attach(teacher);
                teachers.DeleteOnSubmit(teacher);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #4
0
        void IDAL.IBalance.Remove(BalanceInfo balance)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable balances = ctx.GetTable <BalanceInfo>();
                balances.Attach(balance);
                balances.DeleteOnSubmit(balance);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #5
0
        void IDAL.IClassRecord.Remove(ClassRecordInfo classRecord)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable classRecords = ctx.GetTable <ClassRecordInfo>();
                classRecords.Attach(classRecord);
                classRecords.DeleteOnSubmit(classRecord);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #6
0
        void IDAL.IBook.Remove(BookInfo book)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable books = ctx.GetTable <BookInfo>();
                books.Attach(book);
                books.DeleteOnSubmit(book);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #7
0
파일: Feedback.cs 프로젝트: Ideal2014/Ideal
        void IDAL.IFeedback.Remove(FeedbackInfo feedback)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable feedbacks = ctx.GetTable <FeedbackInfo>();
                feedbacks.Attach(feedback);
                feedbacks.DeleteOnSubmit(feedback);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #8
0
        void IDAL.IStudent.Remove(StudentInfo student)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable students = ctx.GetTable <StudentInfo>();
                students.Attach(student);
                students.DeleteOnSubmit(student);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #9
0
        void IDAL.IOrderRecord.Remove(OrderRecordInfo orderRecord)
        {
            try
            {
                DataContext ctx = new DataContext(connection);

                ITable orderRecords = ctx.GetTable <OrderRecordInfo>();
                orderRecords.Attach(orderRecord);
                orderRecords.DeleteOnSubmit(orderRecord);
                ctx.SubmitChanges();
            }
            finally
            {
            }
        }
예제 #10
0
        void ITable.AttachAll(IEnumerable entities, bool asModified)
        {
            if (entities == null)
            {
                throw Error.ArgumentNull("entities");
            }
            CheckReadOnly();
            context.CheckNotInSubmitChanges();
            context.VerifyTrackingEnabled();
            List <object> list   = entities.Cast <object>().ToList();
            ITable        itable = this;

            foreach (object entity in list)
            {
                itable.Attach(entity, asModified);
            }
        }
예제 #11
0
        void ITable.AttachAll(IEnumerable entities, bool asModified)
        {
            if (entities == null)
            {
                throw System.Data.Linq.Error.ArgumentNull("entities");
            }
            this.CheckReadOnly();
            this.context.CheckNotInSubmitChanges();
            this.context.VerifyTrackingEnabled();
            List <object> list  = System.Linq.Enumerable.ToList <object>(System.Linq.Enumerable.Cast <object>(entities));
            ITable        table = (ITable)this;

            foreach (object entity in list)
            {
                table.Attach(entity, asModified);
            }
        }
예제 #12
0
        public void Update(IEnumerable <IData> dataset)
        {
            using (DataContext dataContext = CreateDataContext())
            {
                foreach (IData data in dataset)
                {
                    Verify.ArgumentCondition(data != null, "dataset", "The data set shouldn't contain any null values.");

                    // TODO: Check if it's necessury to make an optimization here
                    ITable table = GetTable(dataContext, data);
                    table.Attach(data);

                    IEntity entity = (IEntity)data;
                    entity.Commit();
                }

                SubmitChanges(dataContext);
            }
        }
예제 #13
0
 public void Attach(object entity)
 {
     _Table.Attach(entity);
 }
 public void Attach(ITable table, object row) {
     table.Attach(row);
 }
예제 #15
0
 public void Attach(ITable table, object row)
 {
     table.Attach(row);
 }