Пример #1
0
        public static string TransPackageClientTypeToString(Common.Entities.Enum.PackageClientType packageClientType)
        {
            string sClientType = "";

            switch (packageClientType)
            {
            case Common.Entities.Enum.PackageClientType.androidPad:
                sClientType = "Pad/Android";
                break;

            case Common.Entities.Enum.PackageClientType.androidPhone:
                sClientType = "Phone/Android";
                break;

            case Common.Entities.Enum.PackageClientType.iPad:
                sClientType = "Pad/iOS";
                break;

            case Common.Entities.Enum.PackageClientType.iPhone:
                sClientType = "Phone/iOS";
                break;

            case Common.Entities.Enum.PackageClientType.web:
                sClientType = "web";
                break;
            }
            return(sClientType);
        }
Пример #2
0
        public DataSet GetBBPackageList(Common.Entities.Enum.PackageClientType packageClientType, string unitCode, int is_webapp)
        {
            string sql         = "select * from smc_packageext where 1=1 and pe_usefulststus=1";
            string sClientType = EnumTranslator.TransPackageClientTypeToString(packageClientType);

            if (packageClientType != Common.Entities.Enum.PackageClientType.All)
            {
                sql += " and pe_clienttype='" + sClientType + "' and pe_isbb=1";
            }
            if (!String.IsNullOrEmpty(unitCode))
            {
                sql += " and pe_UnitCode='" + unitCode + "'";
            }
            if (is_webapp > 0)
            {
                sql += " and tablename='webapplication'";
            }
            else if (is_webapp < 0)
            {
                sql += " and tablename<>'webapplication'";
            }
            DataSet ds = this.ExecuteDataset(sql, CommandType.Text);

            return(ds);
        }
Пример #3
0
        public static Common.Entities.Enum.PackageClientType TransPackageClientTypeToString(string sClientType)
        {
            Common.Entities.Enum.PackageClientType packageClientType = Entities.Enum.PackageClientType.iPhone;
            switch (sClientType)
            {
            case "Pad/Android":
                packageClientType = Common.Entities.Enum.PackageClientType.androidPad;
                break;

            case "Phone/Android":
                packageClientType = Common.Entities.Enum.PackageClientType.androidPhone;
                break;

            case "Pad/iOS":
                packageClientType = Common.Entities.Enum.PackageClientType.iPad;
                break;

            case "Phone/iOS":
                packageClientType = Common.Entities.Enum.PackageClientType.iPhone;
                break;

            case "web":
                packageClientType = Common.Entities.Enum.PackageClientType.web;
                break;
            }
            return(packageClientType);
        }
Пример #4
0
        public DataSet SearchPackageList(string keyword, string category, string unitCode, Common.Entities.Enum.PackageClientType clientType, Common.Entities.Enum.PackageTrait trait, int page, int pageSize, out int pageCount, out int recordCount, string uid, int is_webapp)
        {
            if (pageSize == 0)
            {
                pageSize = 10;
            }
            string sClientType = EnumTranslator.TransPackageClientTypeToString(clientType);
            string sql         = "select * from smc_packageext where 1=1";

            sql += " and pe_usefulststus=1";
            if (!String.IsNullOrEmpty(keyword))
            {
                sql += " and pe_Name like '%" + keyword + "%'";
            }

            if (!String.IsNullOrEmpty(category))
            {
                sql += " and pe_CategoryID like '%" + category + "%'";
            }

            if (!String.IsNullOrEmpty(unitCode))
            {
                sql += " and pe_UnitCode = '" + unitCode + "'";
            }

            if (!String.IsNullOrEmpty(sClientType))
            {
                sql += " and pe_ClientType = '" + sClientType + "'";
            }

            if (is_webapp > 0)
            {
                sql += " and tablename='WebApplication' ";
            }
            else if (is_webapp < 0)
            {
                sql += " and tablename <>'WebApplication' ";
            }

            if (trait != Common.Entities.Enum.PackageTrait.All)
            {
                if (trait == Common.Entities.Enum.PackageTrait.Bibei)
                {
                    sql += " and pe_Isbb=1";
                }
                else if (trait == Common.Entities.Enum.PackageTrait.Tuijian)
                {
                    sql += " and pe_IsTJ=1";
                }
            }

            string order = "pe_CreatedTime desc";

            if (trait == Common.Entities.Enum.PackageTrait.Sc)
            {
                sql   = "select ext.* from smc_collect c join smc_packageext ext on ext.pe_id=c.pe_id where c.uid='" + uid + "'";
                sql  += " and ext.pe_usefulststus=1";
                order = "ext.pe_CreatedTime desc";
            }

            string tableName = SmartBox.Console.Common.StoredProcedureHelper.GetTableName(sql);
            string columns   = SmartBox.Console.Common.StoredProcedureHelper.GetColumns(sql);

            string where = SmartBox.Console.Common.StoredProcedureHelper.GetWhere(sql);

            if (trait == Common.Entities.Enum.PackageTrait.ZX)
            {
                columns = " top 20 " + columns;
            }


            string table = sql;

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@TableName", tableName),
                new SqlParameter("@Columns", columns),
                new SqlParameter("@CurrentPageIndex", page),
                new SqlParameter("@PageSize", pageSize),
                new SqlParameter("@RecordCount", 0),
                new SqlParameter("@PAGECOUNT", 0),
                new SqlParameter("@OrderByColumns", order),
                new SqlParameter("@Where", where),
                new SqlParameter("@WITH", "")
            };
            pars[4].Direction = ParameterDirection.InputOutput;
            pars[5].Direction = ParameterDirection.InputOutput;
            DataSet ds = this.ExecuteDataset("Select_Pagination_ex", CommandType.StoredProcedure, pars);

            pageCount   = Convert.ToInt32(pars[5].Value);
            recordCount = Convert.ToInt32(pars[4].Value);

            return(ds);
        }