/// <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( ); }
public virtual void Insert(T Obj) { UserEngine.SessionTimeOut(); HelperLinq.ModeDetail('u', Obj); HelperLinq.ModeDetail('c', Obj); Standard.GetTable(Obj.GetType()).InsertOnSubmit(Obj); }
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); }
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); } }
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); } } }
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]); } }
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); } } }
public virtual void Insert(T Obj) { HelperLinq.ModeDetail('u', Obj); HelperLinq.ModeDetail('c', Obj); Standard.GetTable(Obj.GetType()).InsertOnSubmit(Obj); }