public cCash doUpdate(string username, CashCategory key, double?cash, AccountAuditType addspend) { cCash ret = null; spCashReadListTableAdapter ta = new spCashReadListTableAdapter(); var dt = ta.doUpdate(username, key.ToString(), cash, addspend.ToString(), DateTime.Now); if (dt != null) { if (dt.Rows.Count > 0) { var dr = dt.FirstOrDefault(); ret = getCash(dr); } } return(ret); }
public cCash getCash(ds_cash.spCashReadListRow dr) { cCash ret = new cCash(); ret.accUserName = dr.accUserName; ret.accFirstName = dr.accFirstName; ret.accLastName = dr.accLastName; ret.pcaDT = dr.pcaDT; ret.pcaAmount = dr.pcaAmount; if (!dr.IspcaTotalNull()) { ret.pcaTotal = dr.pcaTotal; } ret.pccKey = dr.pccKey; ret.pccName = dr.pccName; return(ret); }
public List <cCash> doReadList() { List <cCash> ret = null; spCashReadListTableAdapter ta = new spCashReadListTableAdapter(); var dt = ta.doReadList(); if (dt != null && dt.Rows.Count > 0) { ret = new List <cCash>(); foreach (var dr in dt) { cCash cash = getCash(dr); ret.Add(cash); ; } } return(ret); }