public virtual bool AddMemberAccountLog(MemberAccountLogInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM Member_Account_Log"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["Account_Log_ID"] = entity.Account_Log_ID; DrAdd["Account_Log_MemberID"] = entity.Account_Log_MemberID; DrAdd["Account_Log_Amount"] = entity.Account_Log_Amount; DrAdd["Account_Log_Remain"] = entity.Account_Log_Remain; DrAdd["Account_Log_Note"] = entity.Account_Log_Note; DrAdd["Account_Log_Addtime"] = entity.Account_Log_Addtime; DrAdd["Account_Log_Site"] = entity.Account_Log_Site; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }
public virtual IList <MemberAccountLogInfo> GetMemberAccountLogs(QueryInfo Query) { int PageSize; int CurrentPage; IList <MemberAccountLogInfo> entitys = null; MemberAccountLogInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "Member_Account_Log"; SqlField = "*"; SqlParam = DBHelper.GetSqlParam(Query.ParamInfos); SqlOrder = DBHelper.GetSqlOrder(Query.OrderInfos); SqlList = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize); RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <MemberAccountLogInfo>(); while (RdrList.Read()) { entity = new MemberAccountLogInfo(); entity.Account_Log_ID = Tools.NullInt(RdrList["Account_Log_ID"]); entity.Account_Log_MemberID = Tools.NullInt(RdrList["Account_Log_MemberID"]); entity.Account_Log_Amount = Tools.NullDbl(RdrList["Account_Log_Amount"]); entity.Account_Log_Remain = Tools.NullDbl(RdrList["Account_Log_Remain"]); entity.Account_Log_Note = Tools.NullStr(RdrList["Account_Log_Note"]); entity.Account_Log_Addtime = Tools.NullDate(RdrList["Account_Log_Addtime"]); entity.Account_Log_Site = Tools.NullStr(RdrList["Account_Log_Site"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual MemberAccountLogInfo GetMemberAccountLogByID(int ID) { MemberAccountLogInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM Member_Account_Log WHERE Account_Log_ID = " + ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new MemberAccountLogInfo(); entity.Account_Log_ID = Tools.NullInt(RdrList["Account_Log_ID"]); entity.Account_Log_MemberID = Tools.NullInt(RdrList["Account_Log_MemberID"]); entity.Account_Log_Amount = Tools.NullDbl(RdrList["Account_Log_Amount"]); entity.Account_Log_Remain = Tools.NullDbl(RdrList["Account_Log_Remain"]); entity.Account_Log_Note = Tools.NullStr(RdrList["Account_Log_Note"]); entity.Account_Log_Addtime = Tools.NullDate(RdrList["Account_Log_Addtime"]); entity.Account_Log_Site = Tools.NullStr(RdrList["Account_Log_Site"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool EditMemberAccountLog(MemberAccountLogInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM Member_Account_Log WHERE Account_Log_ID = " + entity.Account_Log_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["Account_Log_ID"] = entity.Account_Log_ID; DrAdd["Account_Log_MemberID"] = entity.Account_Log_MemberID; DrAdd["Account_Log_Amount"] = entity.Account_Log_Amount; DrAdd["Account_Log_Remain"] = entity.Account_Log_Remain; DrAdd["Account_Log_Note"] = entity.Account_Log_Note; DrAdd["Account_Log_Addtime"] = entity.Account_Log_Addtime; DrAdd["Account_Log_Site"] = entity.Account_Log_Site; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual bool EditMemberAccountLog(MemberAccountLogInfo entity) { return(MyDAL.EditMemberAccountLog(entity)); }