本文整理汇总了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");
}
示例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;
}
示例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;
}
示例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);
}