public DataTable Select(string userCode, string typeId, int pageSize, int pageIndex, string codes, string names, string specification, string technicalParameter, string brand) { string condition = DBHelper.GetQuerySql("ResourceCode", codes) + DBHelper.GetQuerySql("ResourceName", names) + DBHelper.GetQuerySql("Specification", specification) + DBHelper.GetQuerySql("TechnicalParameter", technicalParameter) + DBHelper.GetQuerySql("Brand", brand); if (condition.Length >= 4) { condition = condition.Remove(0, 4); } DataTable table = new cn.justwin.resourceDAL.Resource().Select(typeId, pageSize, pageIndex, condition); if (!string.IsNullOrEmpty(userCode)) { try { using (pm2Entities entities = new pm2Entities()) { foreach (var type in from pt in entities.Res_PriceType select new { PriceTypeName = pt.PriceTypeName, UserCodes = pt.UserCodes }) { if (!JsonHelper.GetListFromJson(type.UserCodes).Contains(userCode)) { table.Columns.Remove(type.PriceTypeName); } } return(table); } } catch { } } return(table); }
public int QueryCount(string resTypeId, string codes, string names, string specification, string technicalParameter, string brand, string priceType, string minPrice, string maxPrice) { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); string condition = this.GetConditionString(resTypeId, codes, names, specification, technicalParameter, brand); string priceCondition = this.GetPriceConditionString(priceType, minPrice, maxPrice); return(resource.QueryCount(condition, priceCondition)); }
public DataTable Query(string resTypeId, string codes, string names, string specification, string technicalParameter, string brand, string priceType, string minPrice, string maxPrice, int pageSize, int pageIndex) { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); string condition = this.GetConditionString(resTypeId, codes, names, specification, technicalParameter, brand); string priceTypeCondition = this.GetPriceConditionString(priceType, minPrice, maxPrice); return(resource.Query(pageSize, pageIndex, condition, priceTypeCondition)); }
private DataTable Query(string userCode, string typeName, string codes, string names, string specification, string technicalParameter, string brand) { IList <string> allResourceTypeId = this.GetAllResourceTypeId(typeName); string condition = DBHelper.GetQuerySql("ResourceCode", codes) + DBHelper.GetQuerySql("ResourceName", names) + DBHelper.GetQuerySql("Specification", specification) + DBHelper.GetQuerySql("TechnicalParameter", technicalParameter) + DBHelper.GetQuerySql("r.Brand", brand); if (allResourceTypeId.Count > 0) { condition = condition + string.Format(" AND ResourceType IN ({0})", DBHelper.GetInParameterSql(allResourceTypeId.ToArray <string>())); } cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); IList <string> priceTypeNameList = this.GetPriceTypeNameList(userCode); return(resource.Query(priceTypeNameList, condition)); }
public string GetPriceTypeNameCSV() { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); return(resource.GetPriceTypeNameCSV()); }
public int GetCount() { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); return(resource.GetCount()); }
public DataTable Query(int pageSize, int pageIndex, string condition, string priceTypeCondition) { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); return(resource.Query(pageSize, pageIndex, condition, priceTypeCondition)); }
public IList <string> GetAllResourceTypeId(string resourceTypeName) { cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource(); return(resource.GetAllResourceTypeId(resourceTypeName)); }