예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
 public string GetPriceTypeNameCSV()
 {
     cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource();
     return(resource.GetPriceTypeNameCSV());
 }
예제 #6
0
 public int GetCount()
 {
     cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource();
     return(resource.GetCount());
 }
예제 #7
0
 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));
 }
예제 #8
0
 public IList <string> GetAllResourceTypeId(string resourceTypeName)
 {
     cn.justwin.resourceDAL.Resource resource = new cn.justwin.resourceDAL.Resource();
     return(resource.GetAllResourceTypeId(resourceTypeName));
 }