Пример #1
0
 /// <summary>
 /// Asigna una colección de objeto a un CheckList.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="elem"></param>
 /// <param name="lst"></param>
 /// <param name="key"></param>
 /// <param name="val"></param>
 public static void DataBind <T>(CheckBoxList elem, IEnumerable <T> lst, Expression <Func <T, int> > key, Expression <Func <T, string> > val)
 {
     elem.DataSource     = lst;
     elem.DataTextField  = HelperLinq.GetExpresionName(val);
     elem.DataValueField = HelperLinq.GetExpresionName(key);
     elem.DataBind( );
 }
Пример #2
0
 public virtual void Insert(T Obj)
 {
     UserEngine.SessionTimeOut();
     HelperLinq.ModeDetail('u', Obj);
     HelperLinq.ModeDetail('c', Obj);
     Standard.GetTable(Obj.GetType()).InsertOnSubmit(Obj);
 }
Пример #3
0
 public virtual void Insert(List <T> Obj)
 {
     for (int i = 0; i < Obj.Count; i++)
     {
         HelperLinq.ModeDetail('u', Obj[i]);
         HelperLinq.ModeDetail('c', Obj[i]);
     }
     Standard.GetTable(Obj.GetType()).InsertAllOnSubmit(Obj);
 }
Пример #4
0
        public virtual void Update(T Obj)
        {
            T NewObj = default(T);

            HelperLinq.ModeDetail('u', Obj);
            if (Standard.GetTable(Obj.GetType()).GetOriginalEntityState(Obj) == null)
            {
                NewObj = Detach(Obj);
                Standard.GetTable(Obj.GetType()).Attach(NewObj, true);
            }
        }
Пример #5
0
        public virtual void Update(List <T> Obj)
        {
            T NewObj = default(T);

            for (int i = 0; i < Obj.Count; i++)
            {
                HelperLinq.ModeDetail('u', Obj[i]);
                if (Standard.GetTable(Obj[i].GetType()).GetOriginalEntityState(Obj[i]) == null)
                {
                    NewObj = Detach(Obj[i]);
                    Standard.GetTable(Obj[i].GetType()).Attach(NewObj, true);
                }
            }
        }
Пример #6
0
 public virtual void Insert(List <T> Obj)
 {
     UserEngine.SessionTimeOut();
     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]);
         HelperLinq.ModeDetail('c', Obj[i]);
         Table.InsertOnSubmit(Obj[i]);
     }
 }
Пример #7
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);
                }
            }
        }
Пример #8
0
 public virtual void Insert(T Obj)
 {
     HelperLinq.ModeDetail('u', Obj);
     HelperLinq.ModeDetail('c', Obj);
     Standard.GetTable(Obj.GetType()).InsertOnSubmit(Obj);
 }