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


C# ApplicationType.ToString方法代码示例

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


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

示例1: GetGroups

 internal static string GetGroups(int userId, ApplicationType applicationType, bool sortingMode)
 {
     return "SELECT * FROM " + TblGroupsForUsers + " WHERE UserID=" + userId + " AND AppType = '" + applicationType.ToString() + "' ORDER BY GroupName "+(sortingMode?"ASC":"DESC");
 }
开发者ID:ruslanlyalko,项目名称:DA_SUMMER,代码行数:4,代码来源:DAQueryBuilder.cs

示例2: GetGroupsForUser

        public static List<GroupModel> GetGroupsForUser(int userId, ApplicationType appType)
        {
            var groupList = new List<GroupModel>();

            string sql = "SELECT * FROM " + TblGroupsForUsers + " WHERE UserID = '" + userId + "' AND AppType = '" + appType.ToString() + "' ORDER BY GroupName " + (SortingModeIsAsc ? "ASC" : "DESC");
            var reader = GetReader(sql);
            if (reader != null)
            {
                while (reader.Read())
                {
                    var symbol = new GroupModel
                    {
                        GroupId = reader.GetInt32(2),
                        GroupName = reader.GetString(3),
                        TimeFrame = reader.GetString(4),
                        Start = reader.GetDateTime(5),
                        End = reader.GetDateTime(6),
                        CntType = reader.GetString(7),
                        Depth = reader.GetInt32("Depth"),
                        IsAutoModeEnabled = reader.GetBoolean("IsAutoModeEnabled")
                    };

                    GroupPrivilege privilege;
                    ApplicationType appType1;
                    Enum.TryParse(reader.GetString(8), out privilege);
                    Enum.TryParse(reader.GetString(9), out appType1);

                    symbol.Privilege = privilege;
                    symbol.AppType = appType1;

                    groupList.Add(symbol);
                }
                reader.Close();
            }
            return groupList;
        }
开发者ID:ruslanlyalko,项目名称:DA_SUMMER,代码行数:36,代码来源:DatabaseManager.cs

示例3: GetMyGroupsIds

        private static IEnumerable<int> GetMyGroupsIds(int userId, ApplicationType appType)
        {
            var res = new List<int>();
            string sql = "SELECT * FROM " + TblGroupsForUsers + " WHERE UserID=" + userId + " AND AppType = '" + appType.ToString() + "' AND Privilege = 'Creator' ORDER BY GroupName " + (SortingModeIsAsc ? "ASC" : "DESC");

            var reader = GetReader(sql);
            if (reader != null)
            {
                while (reader.Read())
                {
                    res.Add(reader.GetInt32("GroupId"));
                }

                reader.Close();
            }

            return res;
        }
开发者ID:ruslanlyalko,项目名称:DA_SUMMER,代码行数:18,代码来源:DatabaseManager.cs

示例4: AddGroupForUser

        public static bool AddGroupForUser(int userId, GroupModel group, ApplicationType appType)
        {
            var startDateStr = Convert.ToDateTime(group.Start).ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
            var endDateStr = Convert.ToDateTime(group.End).ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);

            var sql = "INSERT IGNORE INTO " + TblGroupsForUsers
                      + " (`UserID`, `GroupID`, `GroupName`, `TimeFrame`, `Start`, `End`, `CntType`, `Privilege`, `AppType`,`IsAutoModeEnabled`,`Depth`)"
                      + "VALUES('" + userId + "',"
                      + " '" + group.GroupId + "',"
                      + " '" + group.GroupName + "',"
                      + " '" + group.TimeFrame + "',"
                      + " '" + startDateStr + "',"
                      + " '" + endDateStr + "',"
                      + " '" + group.CntType + "',"
                      + " '" + GroupPrivilege.Creator + "',"
                      + " '" + appType.ToString() + "',"
                      + " " + (group.IsAutoModeEnabled ? "1" : "0") + ","
                      + " " + group.Depth + ""
                      + ");COMMIT;";

            return DoSql(sql);
        }
开发者ID:ruslanlyalko,项目名称:DA_SUMMER,代码行数:22,代码来源:DatabaseManager.cs


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