public static OnLineUserLog RetrieveObj(int nUserId) { OnLineUserLogDbo dbo = new OnLineUserLogDbo(); DataTable dt = dbo.RetrieveOneItems(nUserId); if (dt == null || dt.Rows.Count <= 0) { return(null); } OnLineUserLog obj = ChangeObj(dt.Rows[0]); return(obj); }
public static bool DeleteObj(OnLineUserLog ou) { OnLineUserLogDbo dbo = new OnLineUserLogDbo(); OnLineUserLogPo po = new OnLineUserLogPo(); po.USERID = ou.UserId; po.USERNAME = ou.UserName; po.WS_IP = ou.WS_IP; po.WS_MAC = ou.WS_MAC; po.CREATED = ou.Created; return(dbo.Delete(po)); }
public static bool UpdateObj(OnLineUserLog ou) { OnLineUserLogDbo dbo = new OnLineUserLogDbo(); OnLineUserLogPo po = new OnLineUserLogPo(); po.USERID = ou.UserId; po.USERNAME = ou.UserName; po.WS_IP = ou.WS_IP; po.WS_MAC = ou.WS_MAC; po.CREATED = DateTime.Now; return(dbo.Update(po)); }
public static List <OnLineUserLog> RetrieveObjList() { List <OnLineUserLog> list = new List <OnLineUserLog>(); OnLineUserLogDbo dbo = new OnLineUserLogDbo(); DataTable dt = dbo.RetrieveALLItems(); if (dt == null || dt.Rows.Count <= 0) { return(list); } foreach (DataRow dr in dt.Rows) { OnLineUserLog obj = ChangeObj(dr); if (obj != null) { list.Add(obj); } } return(list); }