public static ChargeSet GetChargeSetDetail(string view) { DataTable dt = WebSetDAL.BaseProvider.GetChargeSetDetail(view.Trim()); ChargeSet model = null; if (dt.Rows.Count == 1) { model = new ChargeSet(); model.FillData(dt.Rows[0]); } return(model); }
public static List <ChargeSet> GetChargeSet(string keyWords, string userid, int status, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string begintime = "", string endtime = "") { string tablename = " ChargeSet a left join M_Users b on a.UserID =b.UserID "; string sqlwhere = " a.status<>9 "; if (!string.IsNullOrEmpty(keyWords)) { sqlwhere += " and (b.Name like '%" + keyWords + "%' or a.Remark like '%" + keyWords + "%' or a.View like '%" + keyWords + "%')"; } if (status > -1) { sqlwhere += " and a.status=" + status; } if (!string.IsNullOrEmpty(userid)) { sqlwhere += " and a.UserID='" + userid + "' "; } if (!string.IsNullOrEmpty(begintime)) { sqlwhere += " and a.CreateTime>='" + begintime + " 00:00:00'"; } if (!string.IsNullOrEmpty(endtime)) { sqlwhere += " and a.CreateTime<'" + endtime + " 23:59:59:999'"; } DataTable dt = CommonBusiness.GetPagerData(tablename, "a.*,b.Name as UserName ", sqlwhere, "a.AutoID ", pageSize, pageIndex, out totalCount, out pageCount); List <ChargeSet> list = new List <ChargeSet>(); foreach (DataRow dr in dt.Rows) { ChargeSet model = new ChargeSet(); model.FillData(dr); list.Add(model); } return(list); }