using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace New_College.Common.Helper
{
    public static class UniversityTypeRelsove
    {

        /// <summary>
        /// 院校类型转换
        /// </summary>0综合,1理工类，2医学类|3军事类|4语言类|5师范类|6财经类|7政法类|8民族类|9农林类|10艺术类|11体育类|12其他
        /// <param name="type"></param>
        /// <returns></returns>
        public static string GetType(int type)
        {
            string typename = string.Empty;
            switch (type)
            {
                case 0:
                    typename = "综合类";
                    break;
                case 1:
                    typename = "理工类";
                    break;
                case 2:
                    typename = "医学类";
                    break;
                case 3:
                    typename = "军事类";
                    break;
                case 4:
                    typename = "语言类";
                    break;
                case 5:
                    typename = "师范类";
                    break;
                case 6:
                    typename = "财经类";
                    break;
                case 7:
                    typename = "政法类";
                    break;
                case 8:
                    typename = "民族类";
                    break;
                case 9:
                    typename = "农林类";
                    break;
                case 10:
                    typename = "艺术类";
                    break;
                case 11:
                    typename = "体育类";
                    break;
                case 12:
                    typename = "其他";
                    break;


            }



            return typename;
        }


        public static string GetFileJson(string filepath)
        {
            string json = string.Empty;
            using (FileStream fs = new FileStream(filepath, FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite))
            {
                using (StreamReader sr = new StreamReader(fs, Encoding.GetEncoding("utf-8")))
                {
                    json = sr.ReadToEnd().ToString();

                  //  var obj = JsonConvert.DeserializeObject(json);
                }
            }
            return json;
        }


    }
}
