当前位置: 首页>>代码示例>>C#>>正文


C# Zippy.Take方法代码示例

本文整理汇总了C#中Zippy.Take方法的典型用法代码示例。如果您正苦于以下问题:C# Zippy.Take方法的具体用法?C# Zippy.Take怎么用?C# Zippy.Take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zippy的用法示例。


在下文中一共展示了Zippy.Take方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDepots

        public static List<Z10Cabbage.Entity.Z10Depot> GetDepots(Guid tenantID, Zippy.Data.IDalProvider db)
        {
            if (System.Web.HttpContext.Current.Cache["Depots"].IsNotNullOrEmpty())
                return System.Web.HttpContext.Current.Cache["Depots"] as List<Z10Cabbage.Entity.Z10Depot>;

            List<Z10Cabbage.Entity.Z10Depot> xdepots = db.Take<Z10Cabbage.Entity.Z10Depot>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
            System.Web.HttpContext.Current.Cache["Depots"] = xdepots;
            return xdepots;
        }
开发者ID:honj51,项目名称:EAP,代码行数:9,代码来源:Helper.cs

示例2: GetRoles

        /// <summary>
        /// 获取角色
        /// </summary>
        /// <param name="db"></param>
        /// <param name="tenantID"></param>
        /// <returns></returns>
        public static List<Role> GetRoles(Zippy.Data.IDalProvider db, Guid tenantID)
        {
            //if (System.Web.HttpContext.Current.Cache["Roles_" + tenantID].IsNotNullOrEmpty())
            //    return System.Web.HttpContext.Current.Cache["Roles_" + tenantID] as List<Role>;

            List<Role> xroles = db.Take<Role>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
            System.Web.HttpContext.Current.Cache["Roles_" + tenantID] = xroles;
            return xroles;
        }
开发者ID:honj51,项目名称:EAP,代码行数:15,代码来源:Helper.cs

示例3: GetCurrencies

        /// <summary>
        /// 获取货币
        /// </summary>
        /// <param name="db"></param>
        /// <returns></returns>
        public static List<Currency> GetCurrencies(Zippy.Data.IDalProvider db)
        {
            //if (System.Web.HttpContext.Current.Cache["Currencies"].IsNotNullOrEmpty())
            //    return System.Web.HttpContext.Current.Cache["Currencies"] as List<Currency>;

            List<EAP.Bus.Entity.Currency> xcurrencies = db.Take<EAP.Bus.Entity.Currency>("1=1 order by DisplayOrder");
            System.Web.HttpContext.Current.Cache["Currencies"] = xcurrencies;
            return xcurrencies;
        }
开发者ID:honj51,项目名称:EAP,代码行数:14,代码来源:Helper.cs

示例4: LoadFromDB

 /// <summary>
 /// 从数据库中载入订单
 /// </summary>
 /// <param name="orderID"></param>
 /// <param name="tenantID"></param>
 /// <param name="db"></param>
 /// <returns></returns>
 public static Order LoadFromDB(long orderID, Guid tenantID, Zippy.Data.IDalProvider db)
 {
     Order order = new Order();
     order.Z10Order = db.FindUnique<Z10Order>("[email protected] and [email protected]",
         db.CreateParameter("OrderID", orderID),
         db.CreateParameter("TenantID", tenantID));
     order.Items = db.Take<Z10OrderItem>("[email protected] and [email protected]",
         db.CreateParameter("OrderID", orderID),
         db.CreateParameter("TenantID", tenantID));
     return order;
 }
开发者ID:honj51,项目名称:EAP,代码行数:18,代码来源:Order.cs

示例5: PaperTemplateSelectOptions

        /// <summary>
        /// 合同条款下拉列表
        /// </summary>
        /// <param name="tenantID"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public static string PaperTemplateSelectOptions(Guid tenantID, Zippy.Data.IDalProvider db)
        {
            StringBuilder sb = new StringBuilder();
            List<Z01PaperTemplate> xobjs =  db.Take<Z01PaperTemplate>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
            foreach (var xobj in xobjs)
            {
                sb.AppendLine("<option value='" + xobj.TemplateID + "'>" + xobj.Title + "</option>");
            }

            return sb.ToString();
        }
开发者ID:honj51,项目名称:EAP,代码行数:17,代码来源:HtmlHelper.cs

示例6: GetTitleIDEntitiesHtmlOption

 /// <summary>
 /// 表示 [父分类] 被选实体集合的 option html
 /// </summary>
 public static string GetTitleIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, Guid tenantID, System.Int64? selectedValue)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     List<Z01Title> objs = db.Take<Z01Title>("[email protected]", db.CreateParameter("TenantID", tenantID));
     foreach (var obj in objs)
     {
         if (selectedValue == obj.TitleID)
             sb.AppendLine("<option value='" + obj.TitleID + "' selected='selected'>" + obj.Title + "</option>");
         else
             sb.AppendLine("<option value='" + obj.TitleID + "'>" + obj.Title + "</option>");
     }
     return sb.ToString();
 }
开发者ID:honj51,项目名称:EAP,代码行数:16,代码来源:Z01UserInfoHelper.cs

示例7: GetParentIDEntitiesHtmlOption

 /// <summary>
 /// 表示 [父分类] 被选实体集合的 option html
 /// </summary>
 public static string GetParentIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, System.Int64? selectedValue)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     List<Permission> objs = db.Take<Permission>("ParentID=0");
     foreach (var obj in objs)
     {
         if (selectedValue == obj.PermissionID)
             sb.AppendLine("<option value='" + obj.PermissionID + "' selected='selected'>" + obj.Title + "</option>");
         else
             sb.AppendLine("<option value='" + obj.PermissionID + "'>" + obj.Title + "</option>");
     }
     return sb.ToString();
 }
开发者ID:honj51,项目名称:EAP,代码行数:16,代码来源:PermissionHelper.cs

示例8: GetParentIDEntitiesHtmlOption

 /// <summary>
 /// 表示 [父分类] 被选实体集合的 option html
 /// </summary>
 public static string GetParentIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, Guid tenantID, long? selectedValue, long removeID)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     List<Z01CustomerCategory> objs = db.Take<Z01CustomerCategory>("[email protected]", db.CreateParameter("TenantID", tenantID));
     List<Z01CustomerCategory> newObjs = new List<Z01CustomerCategory>();
     ReGroup(objs, newObjs, 0, "├", removeID);
     foreach (var obj in newObjs)
     {
         if (selectedValue == obj.CategoryID)
             sb.AppendLine("<option value='" + obj.CategoryID + "' selected='selected'>" + obj.Title + "</option>");
         else
             sb.AppendLine("<option value='" + obj.CategoryID + "'>" + obj.Title + "</option>");
     }
     return sb.ToString();
 }
开发者ID:honj51,项目名称:EAP,代码行数:18,代码来源:Z01CustomerCategoryHelper.cs

示例9: GetPermissions

        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <param name="db"></param>
        /// <param name="tenantID"></param>
        /// <returns></returns>
        public static List<Permission> GetPermissions(Zippy.Data.IDalProvider db, Guid? tenantID)
        {
            //if (System.Web.HttpContext.Current.Cache["Permissions_" + tenantID].IsNotNullOrEmpty())
            //    return System.Web.HttpContext.Current.Cache["Permissions_" + tenantID] as List<Permission>;

            List<Permission> xobjs = db.Take<Permission>();
            //按照父子关系顺序重建
            List<Permission> newRecords = new List<Permission>();
            IEnumerable<Permission> rootRecords = xobjs.Where(s => (s.ParentID ?? 0) == 0).OrderBy(s => s.DisplayOrder);
            foreach (Permission per in rootRecords)
            {
                newRecords.Add(per);
                newRecords.AddRange(xobjs.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder));
            }

            System.Web.HttpContext.Current.Cache["Permissions_" + tenantID] = newRecords;
            return newRecords;
        }
开发者ID:honj51,项目名称:EAP,代码行数:24,代码来源:Helper.cs

示例10: ToJsonMenu

        /// <summary>
        /// j将当前用户的url都显示出来
        /// </summary>
        /// <param name="user"></param>
        /// <param name="tenantID"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public static string ToJsonMenu(Zippy.SaaS.Entity.User user, Guid? tenantID, Zippy.Data.IDalProvider db)
        {
            System.Text.StringBuilder menus = new StringBuilder();
            menus.AppendLine("{");
            List<Permission> xobjs = GetPermissions(db, tenantID);
            List<EAP.Logic.Bus.View.V_UserPermission> mePers = null;
            if (!user.UserType.BitIs(Zippy.SaaS.UserTypes.SystemAdministrator))
            {
                mePers = db.Take<EAP.Logic.Bus.View.V_UserPermission>("[email protected]", db.CreateParameter("UserID", user.UserID));
            }

            var rootRecords = xobjs.Where(s => (s.ParentID ?? 0) == 0 && s.PermissionStatus == 1).OrderBy(s => s.DisplayOrder);
            foreach (Permission per in rootRecords)
            {
                if (mePers == null || (mePers != null && mePers.Exists(s => s.PermissionID == per.PermissionID)))
                {
                    if (per.PermissionStatus == 1)
                        menus.AppendLine("'" + per.PermissionID + "' : [['" + per.PermissionID + "','" + per.Title + "','" + per.Icon + "'],{");

                    var subRecords = xobjs.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder);
                    foreach (Permission subper in subRecords)
                    {
                        if (mePers == null || (mePers != null && mePers.Exists(s => s.PermissionID == subper.PermissionID)))
                        {
                            if (subper.PermissionStatus == 1)
                                menus.AppendLine("'" + subper.PermissionID + "' : ['" + subper.Title + "','" + subper.Url + "','" + subper.Icon + "'],");
                        }

                    }
                    //if (menus.ToString().EndsWith(",")) menus.Remove(menus.Length - 1, 1);
                    menus.AppendLine("}],");

                }
            }
            //if (menus.ToString().EndsWith(",\n")) menus.Remove(menus.Length - 1, 1);

            menus.AppendLine("}");

            return menus.ToString().Replace(",\r\n}", "\r\n}");
        }
开发者ID:honj51,项目名称:EAP,代码行数:47,代码来源:Helper.cs

示例11: Take

 public static List<Z01FinancialCategory> Take(Zippy.Data.IDalProvider db,string sqlEntry, params System.Data.Common.DbParameter[] cmdParameters)
 {
     return db.Take<Z01FinancialCategory>(sqlEntry, cmdParameters);
 }
开发者ID:honj51,项目名称:EAP,代码行数:4,代码来源:Z01FinancialCategoryHelper.cs

示例12: Take

 public static List<Z01UserInfo> Take(Zippy.Data.IDalProvider db,int count)
 {
     return db.Take<Z01UserInfo>(count, true);
 }
开发者ID:honj51,项目名称:EAP,代码行数:4,代码来源:Z01UserInfoHelper.cs

示例13: GetTitleIDEntities

 /// <summary>
 /// 表示 [头衔/职务] 被选实体集合
 /// </summary>
 public static List<Z01Title> GetTitleIDEntities(Zippy.Data.IDalProvider db)
 {
     return db.Take<Z01Title>();
 }
开发者ID:honj51,项目名称:EAP,代码行数:7,代码来源:Z01UserInfoHelper.cs

示例14: Query

        public static PaginatedList<Permission> Query(Zippy.Data.IDalProvider db, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
        {
            PaginatedList<Permission> rtn = new PaginatedList<Permission>();
            List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();

            string where = " 1=1";

            #region 开始查询
            if (paras != null)
            {
                object qTitle = paras["qTitle"];
                if (qTitle.IsNotNullOrEmpty())
                {
                    where += " and [Title] like @Title";
                    dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
                }
                object qUrl = paras["qUrl"];
                if (qUrl.IsNotNullOrEmpty())
                {
                    where += " and [Url] like @Url";
                    dbParams.Add(db.CreateParameter("Url", "%" + qUrl + "%"));
                }
                object qFlag = paras["qFlag"];
                if (qFlag.IsNotNullOrEmpty())
                {
                    where += " and [Flag] like @Flag";
                    dbParams.Add(db.CreateParameter("Flag", "%" + qFlag + "%"));
                }
                object qParentID = paras["qParentID"];
                if (qParentID.IsNotNullOrEmpty())
                {
                    where += " and [ParentID] = @ParentID";
                    dbParams.Add(db.CreateParameter("ParentID", qParentID));
                }
            }
            #endregion

            string orderBy = " [DisplayOrder] asc";

            int RecordCount = db.Count<Permission>(where, dbParams.ToArray());
            int PageCount = 0;
            if (RecordCount % PageSize == 0)
            {
                PageCount = RecordCount / PageSize;
            }
            else
            {
                PageCount = RecordCount / PageSize + 1;
            }
            if (PageIndex > PageCount)
                PageIndex = PageCount;
            if (PageIndex < 1)
                PageIndex = 1;

            List<Permission> records = db.Take<Permission>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
            //重组 records
            List<Permission> newRecords = new List<Permission>();
            IEnumerable<Permission> rootRecords = records.Where(s => (s.ParentID ?? 0) == 0).OrderBy(s => s.DisplayOrder);
            foreach (Permission per in rootRecords)
            {
                newRecords.Add(per);
                newRecords.AddRange(records.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder));
            }

            rtn.AddRange(newRecords);
            rtn.PageIndex = PageIndex;
            rtn.PageSize = PageSize;
            rtn.TotalCount = RecordCount;

            return rtn;
        }
开发者ID:honj51,项目名称:EAP,代码行数:71,代码来源:PermissionHelper.cs

示例15: GetParentID_Permissions

 /// <summary>
 /// 获取 [权限表 的 父权限] 的 [权限表] 集合
 /// </summary>
 public static List<Permission> GetParentID_Permissions(Zippy.Data.IDalProvider db, Permission entity)
 {
     if (entity.PermissionID.HasValue)
         return db.Take<Permission>("[email protected]", db.CreateParameter("ParentID", entity.PermissionID));
     return new List<Permission>();
 }
开发者ID:honj51,项目名称:EAP,代码行数:9,代码来源:PermissionHelper.cs


注:本文中的Zippy.Take方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。