/// <summary> /// get chaxun /// </summary> /// <returns></returns> EyouSoft.Model.MDiZhiChaXunInfo GetChaXunInfo() { var info = new EyouSoft.Model.MDiZhiChaXunInfo(); info.GongSiId = YongHuInfo.GongSiId; info.Name = Utils.GetQueryStringValue("txtName"); return info; }
/// <summary> /// init dizhi repeater /// </summary> void InitDiZhiRpt() { int recordCount = 0; var chaXun = new EyouSoft.Model.MDiZhiChaXunInfo(); chaXun.GongSiId = YongHuInfo.GongSiId; chaXun.Name = string.Empty; var items = new EyouSoft.BLL.BDiZhi().GetDiZhis(100, 1, ref recordCount, chaXun); if (items != null && items.Count > 0) { rptDiZhi.DataSource = items; rptDiZhi.DataBind(); } else { phDiZhiEmpty.Visible = true; } }
/// <summary> /// 获取地址集合 /// </summary> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页面序号</param> /// <param name="recordCount">总记录数</param> /// <param name="chaXun">查询</param> /// <returns></returns> public IList <EyouSoft.Model.MDiZhiInfo> GetDiZhis(int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.MDiZhiChaXunInfo chaXun) { if (pageSize <= 0) { pageSize = 1; } if (pageIndex <= 0) { pageIndex = 1; } var items = dal.GetDiZhis(pageSize, pageIndex, ref recordCount, chaXun); return(items); }
/// <summary> /// 获取地址集合 /// </summary> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页面序号</param> /// <param name="recordCount">总记录数</param> /// <param name="chaXun">查询</param> /// <returns></returns> public IList <EyouSoft.Model.MDiZhiInfo> GetDiZhis(int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.MDiZhiChaXunInfo chaXun) { IList <EyouSoft.Model.MDiZhiInfo> items = new List <EyouSoft.Model.MDiZhiInfo>(); string fields = "*"; StringBuilder sql = new StringBuilder(); string tableName = "tbl_DiZhi"; string orderByString = " IsMoRen DESC,IssueTime DESC "; string heJiString = ""; #region sql sql.Append(" IsDelete='0' "); if (chaXun != null) { if (!string.IsNullOrEmpty(chaXun.GongSiId)) { sql.AppendFormat(" AND GongSiId='{0}' ", chaXun.GongSiId); } } #endregion using (IDataReader rdr = DbHelper.ExecuteReader1(_db, pageSize, pageIndex, ref recordCount, tableName, fields, sql.ToString(), orderByString, heJiString)) { while (rdr.Read()) { var item = new EyouSoft.Model.MDiZhiInfo(); item.CaoZuoRenId = rdr["CaoZuoRenId"].ToString(); item.DianHua = rdr["DianHua"].ToString(); item.DiZhi = rdr["DiZhi"].ToString(); item.DiZhiId = rdr["DiZhiId"].ToString(); item.GongSiId = rdr["GongSiId"].ToString(); item.IsMoRen = rdr["IsMoRen"].ToString() == "1"; item.IssueTime = rdr.GetDateTime(rdr.GetOrdinal("IssueTime")); item.Name = rdr["Name"].ToString(); item.ShouJi = rdr["ShouJi"].ToString(); item.YongHuId = rdr["YongHuId"].ToString(); items.Add(item); } } return(items); }