public static FeedBack GetFeedBackDetail(string id) { DataTable dt = FeedBackDAL.BaseProvider.GetFeedBackDetail(id); FeedBack model= new FeedBack(); if(dt.Rows.Count>0) model.FillData(dt.Rows[0]); return model; }
public static List<FeedBack> GetFeedBacks(string keywords, string beginDate, string endDate, int type, int status,string userID, int pageSize, int pageIndex, out int totalCount, out int pageCount) { string sqlWhere = "1=1"; if (type != -1) { sqlWhere += " and type="+type; } if (status != -1) { sqlWhere += " and status="+status; } if (!string.IsNullOrEmpty(keywords)) { sqlWhere += " and status=" + status; } if (!string.IsNullOrEmpty(userID)) { sqlWhere += " and CreateUserID='" + userID + "'"; } if (!string.IsNullOrEmpty(beginDate)) { sqlWhere += " and createtime>='" + beginDate+"'"; } if (!string.IsNullOrEmpty(endDate)) { sqlWhere += " and createtime<='" +DateTime.Parse(endDate).AddDays(1).ToString("yyyy-MM-dd")+"'"; } DataTable dt = CommonBusiness.GetPagerData("FeedBack", "*", sqlWhere, "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List<FeedBack> list = new List<FeedBack>(); FeedBack model; foreach (DataRow item in dt.Rows) { model = new FeedBack(); model.FillData(item); list.Add(model); } return list; }
public static List<FeedBack> GetFeedBacks(string keywords, string beginDate, string endDate, int type, int status, int pageSize, int pageIndex, out int totalCount, out int pageCount) { string sqlWhere = "1=1"; if (type != -1) { sqlWhere += " and type="+type; } if (status != -1) { sqlWhere += " and status="+status; } if (!string.IsNullOrEmpty(keywords)) { sqlWhere += " and (Title like '%"+keywords+"%'"; sqlWhere += " or ContactName like '%" + keywords + "%'"; sqlWhere += " or MobilePhone like '%" + keywords + "%'"; sqlWhere += " or Remark like '%" + keywords + "%' )"; } if (!string.IsNullOrEmpty(beginDate)) { sqlWhere += " and createtime>=" + beginDate; } if (!string.IsNullOrEmpty(endDate)) { sqlWhere += " and createtime<=" +DateTime.Parse(endDate).AddDays(1); } DataTable dt = CommonBusiness.GetPagerData("FeedBack", "*", sqlWhere, "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List<FeedBack> list = new List<FeedBack>(); FeedBack model; foreach (DataRow item in dt.Rows) { model = new FeedBack(); model.FillData(item); list.Add(model); } return list; }