ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Text;
using System.Reflection;
using System.IO;
using HotelPms.Share.Util;
 
namespace HotelPms.Share.Data.Script;
 
public class ResourceFile
{
    public enum ResType : int
    { 
        SP_GetCreateTableScript = 0,
        SP_CloseDBConnect,
    }
 
    public static string GetName(ResType type)
    {
        string name = string.Empty;
        switch (type)
        { 
            case ResType.SP_GetCreateTableScript:
            case ResType.SP_CloseDBConnect:
                name = string.Format("HotelPms.Share.Data.Script.MsSql.{0}.sql", type.ToString());
                break;
        }
        return name;
    }
 
    public static string GetScript(ResType type)
    {
        Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetName(type));
        byte[] data = CConvert.ToBytes(stream);
        return Encoding.Default.GetString(data);
    }
}