Ejemplo n.º 1
0
        public virtual void Update(List <T> Obj)
        {
            UserEngine.SessionTimeOut();
            T NewObj = default(T);

            System.Data.Linq.ITable Table = null;
            for (int i = 0; i < Obj.Count; i++)
            {
                if (i == 0)
                {
                    Table = Standard.GetTable(Obj[i].GetType());
                }
                HelperLinq.ModeDetail('u', Obj[i]);
                if (Table.GetOriginalEntityState(Obj[i]) == null)
                {
                    NewObj = Detach(Obj[i]);
                    Table.Attach(NewObj, true);
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void Delete(List <T> Obj)
        {
            UserEngine.SessionTimeOut();
            T NewObj = default(T);

            System.Data.Linq.ITable Table = null;
            for (int i = 0; i < Obj.Count; i++)
            {
                if (i == 0)
                {
                    Table = Standard.GetTable(Obj[i].GetType());
                }
                if (Table.GetOriginalEntityState(Obj[i]) == null)
                {
                    NewObj = Detach(Obj[i]);
                    Table.Attach(NewObj);
                    Table.DeleteOnSubmit(NewObj);
                }
                else
                {
                    Table.DeleteOnSubmit(Obj[i]);
                }
            }
        }