61 lines
1.6 KiB
C#
61 lines
1.6 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Data;
|
|||
|
using System.Data.OleDb;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Reflection;
|
|||
|
using System.Text;
|
|||
|
using System.Text.RegularExpressions;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using static PDDCircleFriends.Enums;
|
|||
|
|
|||
|
namespace PDDCircleFriends
|
|||
|
{
|
|||
|
public class Tools
|
|||
|
{
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 将枚举中的string转int
|
|||
|
/// </summary>
|
|||
|
/// <param name="data"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static int FindCategoryNum(string data)
|
|||
|
{
|
|||
|
return (int)((CategoryType)Enum.Parse(typeof(CategoryType), data));
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取中文店铺枚举对应的数值值
|
|||
|
/// </summary>
|
|||
|
/// <param name="shopScore"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static int FindShopScoreVlaue(ShopScoreType shopScore)
|
|||
|
{
|
|||
|
int value = -1;
|
|||
|
switch (shopScore)
|
|||
|
{
|
|||
|
case ShopScoreType.不限:
|
|||
|
case ShopScoreType.四点六:
|
|||
|
value = 460;
|
|||
|
break;
|
|||
|
case ShopScoreType.五点零:
|
|||
|
value = 500;
|
|||
|
break;
|
|||
|
case ShopScoreType.四点九:
|
|||
|
value = 490;
|
|||
|
break;
|
|||
|
case ShopScoreType.四点八:
|
|||
|
value = 480;
|
|||
|
break;
|
|||
|
case ShopScoreType.四点七:
|
|||
|
value = 470;
|
|||
|
break;
|
|||
|
}
|
|||
|
return value;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|