public IList <PNK_Booking> GetList(int langId, string name, int pageIndex, int pageSize, out int total) { IList <PNK_Booking> lst = new List <PNK_Booking>(); DGCParameter[] param = new DGCParameter[4]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } lst = dal_2C.GetList("Booking_Get", param, out total); return(lst); }
public IList <PNK_Country> GetList(int langId, string name, string Id, string newsCateId, int pageIndex, int pageSize, out int total) { IList <PNK_Country> lst = new List <PNK_Country>(); DGCParameter[] param = new DGCParameter[6]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (!string.IsNullOrEmpty(newsCateId)) { param[4] = new DGCParameter(string.Format("{0}cateId", prefixParam), DbType.String, newsCateId); } else { param[4] = new DGCParameter(string.Format("{0}cateId", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(Id)) { param[5] = new DGCParameter(string.Format("{0}Id", prefixParam), DbType.String, Id); } else { param[5] = new DGCParameter(string.Format("{0}Id", prefixParam), DbType.String, DBNull.Value); } string[] keyArr = param.Select(x => x.Value.ToString()).ToArray(); string key = string.Format("Country_Get_{0}_{1}", WebUtils.CurrentUserIP, string.Join("_", keyArr)); Dictionary <string, object> dic = null; total = 0; ////Get cache if (!CacheHelper.Get(key, out lst)) { lst = dal_2C.GetList("Country_Get", param, out total); CacheHelper.Add(lst, key); } else { total = lst.Count(); } ////Get cache //if (!CacheHelper.Get(key, out dic)) //{ // lst = dal_2C.GetList("Country_Get", param, out total); // dic = new Dictionary<string, object>(); // dic.Add("Dict_Country_Get", lst); // dic.Add("Dict_Country_Get_Total", total); // CacheHelper.Add(dic, key); //} //if (dic != null && dic.Count > 0) //{ // lst = dic["Dict_Country_Get"] as IList<PNK_Country>; // total = DBConvert.ParseInt(dic["Dict_Country_Get_Total"]); //} return(lst); }
public IList <PNK_ProductCategory> GetList(int langId, string name, string publish, int id, int parentId, int uncludeMe, bool isTree, string field, int pageIndex, int pageSize, out int total) { IList <PNK_ProductCategory> lst = new List <PNK_ProductCategory>(); DGCParameter[] param = new DGCParameter[10]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int32, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int32, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (parentId != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}parentid", prefixParam), DbType.Int32, parentId); } else { param[2] = new DGCParameter(string.Format("{0}parentid", prefixParam), DbType.Int32, DBNull.Value); } param[3] = new DGCParameter(string.Format("{0}tree", prefixParam), DbType.Boolean, isTree); if (pageIndex != int.MinValue) { param[4] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[4] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[5] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[5] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (!string.IsNullOrEmpty(publish)) { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, publish); } else { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, DBNull.Value); } if (!string.IsNullOrEmpty(field)) { param[7] = new DGCParameter(string.Format("{0}field", prefixParam), DbType.String, field); } else { param[7] = new DGCParameter(string.Format("{0}field", prefixParam), DbType.String, DBNull.Value); } if (id != int.MinValue) { param[8] = new DGCParameter(string.Format("{0}id", prefixParam), DbType.Int32, id); } else { param[8] = new DGCParameter(string.Format("{0}id", prefixParam), DbType.Int32, DBNull.Value); } if (uncludeMe != int.MinValue) { param[9] = new DGCParameter(string.Format("{0}uncludeMe", prefixParam), DbType.Int32, uncludeMe); } else { param[9] = new DGCParameter(string.Format("{0}uncludeMe", prefixParam), DbType.Int32, DBNull.Value); } string[] keyArr = param.Select(x => x.Value.ToString()).ToArray(); string key = string.Format("ProductCategory_GetList_{0}_{1}", WebUtils.CurrentUserIP, string.Join("_", keyArr)); total = 0; //Get cache if (!CacheHelper.Get(key, out lst)) { lst = dal_2C.GetList("ProductCategory_Get", param, out total); CacheHelper.Add(lst, key); } else { total = lst.Count(); } return(lst); }
public IList <PNK_FengShui> GetList(int langId, string publish, int year, string directionHouse, int sex, int pageIndex, int pageSize, out int total) { IList <PNK_FengShui> lst = new List <PNK_FengShui>(); DGCParameter[] param = new DGCParameter[7]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (year != int.MinValue) { param[1] = new DGCParameter(string.Format("{0}year ", prefixParam), DbType.String, year); } else { param[1] = new DGCParameter(string.Format("{0}year ", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (sex != int.MinValue) { param[4] = new DGCParameter(string.Format("{0}sex", prefixParam), DbType.String, sex); } else { param[4] = new DGCParameter(string.Format("{0}sex", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(directionHouse)) { param[5] = new DGCParameter(string.Format("{0}directionHouse", prefixParam), DbType.String, directionHouse); } else { param[5] = new DGCParameter(string.Format("{0}directionHouse", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(publish)) { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, publish); } else { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, DBNull.Value); } lst = dal_2C.GetList("FengShui_Get", param, out total); return(lst); }
public IList <PNK_Product> GetList(int langId, string name, string publish, string newsCateId, string id, string hot, string feature, string post, string tag, int pageIndex, int pageSize, out int total) { IList <PNK_Product> lst = new List <PNK_Product>(); DGCParameter[] param = new DGCParameter[11]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (!string.IsNullOrEmpty(newsCateId)) { param[4] = new DGCParameter(string.Format("{0}cateId", prefixParam), DbType.String, newsCateId); } else { param[4] = new DGCParameter(string.Format("{0}cateId", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(id)) { param[5] = new DGCParameter(string.Format("{0}id", prefixParam), DbType.String, id); } else { param[5] = new DGCParameter(string.Format("{0}id", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(publish)) { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, publish); } else { param[6] = new DGCParameter(string.Format("{0}published", prefixParam), DbType.AnsiString, DBNull.Value); } if (!string.IsNullOrEmpty(hot)) { param[7] = new DGCParameter(string.Format("{0}hot", prefixParam), DbType.AnsiString, hot); } else { param[7] = new DGCParameter(string.Format("{0}hot", prefixParam), DbType.AnsiString, DBNull.Value); } if (!string.IsNullOrEmpty(feature)) { param[8] = new DGCParameter(string.Format("{0}feature", prefixParam), DbType.AnsiString, feature); } else { param[8] = new DGCParameter(string.Format("{0}feature", prefixParam), DbType.AnsiString, DBNull.Value); } if (!string.IsNullOrEmpty(post)) { param[9] = new DGCParameter(string.Format("{0}post", prefixParam), DbType.AnsiString, post); } else { param[9] = new DGCParameter(string.Format("{0}post", prefixParam), DbType.AnsiString, DBNull.Value); } if (!string.IsNullOrEmpty(tag)) { param[10] = new DGCParameter(string.Format("{0}tag", prefixParam), DbType.String, tag); } else { param[10] = new DGCParameter(string.Format("{0}tag", prefixParam), DbType.String, DBNull.Value); } string[] keyArr = param.Select(x => x.Value.ToString()).ToArray(); string key = string.Format("Product_GetList_{0}_{1}", WebUtils.CurrentUserIP, string.Join("_", keyArr)); total = 0; //Get cache //if (!CacheHelper.Get(key, out lst)) //{ lst = dal_2C.GetList("Product_Get", param, out total); CacheHelper.Add(lst, key); //} //else //{ // total = lst.Count(); //} return(lst); }
public IList <PNK_Booking> GetList(int langId, string name, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, out int total) { IList <PNK_Booking> lst = new List <PNK_Booking>(); DGCParameter[] param = new DGCParameter[6]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (fromDate != DateTime.MinValue) { param[4] = new DGCParameter(string.Format("{0}fromDate", prefixParam), DbType.DateTime, fromDate); } else { param[4] = new DGCParameter(string.Format("{0}fromDate", prefixParam), DbType.DateTime, DBNull.Value); } if (toDate != DateTime.MinValue) { param[5] = new DGCParameter(string.Format("{0}toDate", prefixParam), DbType.DateTime, toDate); } else { param[5] = new DGCParameter(string.Format("{0}toDate", prefixParam), DbType.DateTime, DBNull.Value); } //string[] keyArr = param.Select(x => x.Value.ToString()).ToArray(); //string key = string.Format("Booking_{0}_{1}", WebUtils.CurrentUserIP, string.Join("_", keyArr)); //total = 0; //////Get cache //if (!CacheHelper.Get(key, out lst)) //{ lst = dal_2C.GetList("Booking_Get", param, out total); // CacheHelper.Add(lst, key); //} //else //{ // total = lst.Count(); //} return(lst); }
public IList <PNK_ProductGroup> GetList(int langId, string name, string Id, string divisionId, string productTypeId, int pageIndex, int pageSize, out int total) { IList <PNK_ProductGroup> lst = new List <PNK_ProductGroup>(); DGCParameter[] param = new DGCParameter[7]; if (langId != int.MinValue) { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, langId); } else { param[0] = new DGCParameter(string.Format("{0}langId", prefixParam), DbType.Int16, DBNull.Value); } if (!string.IsNullOrEmpty(name)) { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, name); } else { param[1] = new DGCParameter(string.Format("{0}name", prefixParam), DbType.String, DBNull.Value); } if (pageIndex != int.MinValue) { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, pageIndex); } else { param[2] = new DGCParameter(string.Format("{0}pageIndex", prefixParam), DbType.Int32, DBNull.Value); } if (pageSize != int.MinValue) { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, pageSize); } else { param[3] = new DGCParameter(string.Format("{0}pageSize", prefixParam), DbType.Int32, DBNull.Value); } if (!string.IsNullOrEmpty(divisionId)) { param[4] = new DGCParameter(string.Format("{0}divisionId", prefixParam), DbType.String, divisionId); } else { param[4] = new DGCParameter(string.Format("{0}divisionId", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(Id)) { param[5] = new DGCParameter(string.Format("{0}Id", prefixParam), DbType.String, Id); } else { param[5] = new DGCParameter(string.Format("{0}Id", prefixParam), DbType.String, DBNull.Value); } if (!string.IsNullOrEmpty(productTypeId)) { param[6] = new DGCParameter(string.Format("{0}productTypeId", prefixParam), DbType.String, productTypeId); } else { param[6] = new DGCParameter(string.Format("{0}productTypeId", prefixParam), DbType.String, DBNull.Value); } lst = dal_2C.GetList("ProductGroup_Get", param, out total); return(lst); }