using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MasterLinkFutures.Helper;
namespace MasterLinkFutures.Data
{
    public class rtnMsg : SingletonBase<rtnMsg>
    {
        #region[Login回應參數內容]
        private const string LoginMsg4 = "部分需要的元件不存在或未註冊";
        private const string LoginMsg3 = "連線中";
        private const string LoginMsg2 = "登入失敗(帳號或密碼錯誤)";
        private const string LoginMsg1 = "連線失敗(主機連不到等錯誤)";
        private const string LoginMsg0 = "連線參數錯誤(缺少帳號或密碼等錯誤)";
        private const string LoginMsg_1 = "交易物件產生失敗(缺少IceGlobalTradeAPI.ocx或未註冊)";
        private const string LoginMsg_2 = "TouchanceLogin尚未呼叫過";
        private const string LoginMsg_3 = "無權限";
        private const string LoginMsg_4 = "交易物件不存在(缺少某個Adapter OCX或未註冊)";
        private const string LoginMsg_5 = "暫存資料存取失敗";
        private const string LoginMsg_6 = "權限資料錯誤";
        private const string LoginMsg_7 = "該Session已經連線";
        private const string LoginMsg_ = "未定義的錯誤";
        #endregion
        #region[ProcessOrder參數內容]
        private const string POMsg1 = "成功，表示此委託單已經送出";
        private const string POMsg0 = "連線未完成 或 記憶體錯誤";
        private const string POMsg_1 = "密碼未填";
        private const string POMsg_2 = "帳號未填(分公司代碼)";
        private const string POMsg_3 = "帳號未填";
        private const string POMsg_6 = "商品代碼未填";
        private const string POMsg_7 = "買賣別未填";
        private const string POMsg_8 = "委託別未填";
        private const string POMsg_9 = "盤別未填";
        private const string POMsg_10 = "價格別未填";
        private const string POMsg_11 = "委託價未填";
        private const string POMsg_12 = "數量未填";
        private const string POMsg_13 = "User Key未填";
        private const string POMsg_14 = "倉別未填";
        private const string POMsg_15 = "商品年月未填";
        private const string POMsg_16 = "C/P未填";
        private const string POMsg_17 = "Strike Price未填";
        private const string POMsg_23 = "市場別未填";
        private const string POMsg_24 = "交易所未填";
        private const string POMsg_25 = "停損價未填";
        private const string POMsg_26 = "當沖未填";
        private const string POMsg_27 = "代表刪單改價減量時,找不到對應的可刪改回報";
        private const string POMsg_29 = "委託書號未填";
        private const string POMsg_50 = "Type錯誤";
        private const string POMsg_51 = "數量錯誤";
        private const string POMsg_52 = "委託書號錯誤";
        private const string POMsg_53 = "帳號錯誤";
        private const string POMsg_54 = "商品ID錯誤";
        private const string POMsg_55 = "委託別錯誤";
        private const string POMsg_56 = "買賣別錯誤";
        private const string POMsg_57 = "價格別錯誤";
        private const string POMsg_58 = "價格錯誤";
        private const string POMsg_59 = "市場別錯誤";
        private const string POMsg_60 = "盤別錯誤";
        private const string POMsg_61 = "當沖錯誤";
        private const string POMsg_62 = "新平倉錯誤";
        private const string POMsg_88 = "簽章錯誤";
        private const string POMsg_100 = "委託取消";
        private const string POMsg_101 = "委託測試";
        private const string POMsg_200 = "帳號號對應的連線已經移除，請重新登入!";
        private const string POMsg_ = "未定義的錯誤";

        #endregion
        public string getLoginMsg(int cnt)
        {
            string str = string.Empty;
            switch (cnt)
            {
                case 4:
                    str = LoginMsg4;
                    break;
                case 3:
                    str = LoginMsg3;
                    break;
                case 2:
                    str = LoginMsg2;
                    break;
                case 1:
                    str = LoginMsg1;
                    break;
                case 0:
                    str = LoginMsg0;
                    break;
                case -1:
                    str = LoginMsg_1;
                    break;
                case -2:
                    str = LoginMsg_2;
                    break;
                case -3:
                    str = LoginMsg_3;
                    break;
                case -4:
                    str = LoginMsg_4;
                    break;
                case -5:
                    str = LoginMsg_5;
                    break;
                case -6:
                    str = LoginMsg_6;
                    break;
                case -7:
                    str = LoginMsg_7;
                    break;
                default:
                    str = LoginMsg_;
                    break;
            }
            return str;
        }
        public string getProcessOrder(int cnt)
        {
            string str = string.Empty;
            switch (cnt)
            {
                case 1: str = POMsg1; break;
                case 0: str = POMsg0; break;
                case -1: str = POMsg_1; break;
                case -2: str = POMsg_2; break;
                case -3: str = POMsg_3; break;
                case -6: str = POMsg_6; break;
                case -7: str = POMsg_7; break;
                case -8: str = POMsg_8; break;
                case -9: str = POMsg_9; break;
                case -10: str = POMsg_10; break;
                case -11: str = POMsg_11; break;
                case -12: str = POMsg_12; break;
                case -13: str = POMsg_13; break;
                case -14: str = POMsg_14; break;
                case -15: str = POMsg_15; break;
                case -16: str = POMsg_16; break;
                case -17: str = POMsg_17; break;
                case -23: str = POMsg_23; break;
                case -24: str = POMsg_24; break;
                case -25: str = POMsg_25; break;
                case -26: str = POMsg_26; break;
                case -27: str = POMsg_27; break;
                case -29: str = POMsg_29; break;
                case -50: str = POMsg_50; break;
                case -51: str = POMsg_51; break;
                case -52: str = POMsg_52; break;
                case -53: str = POMsg_53; break;
                case -54: str = POMsg_54; break;
                case -55: str = POMsg_55; break;
                case -56: str = POMsg_56; break;
                case -57: str = POMsg_57; break;
                case -58: str = POMsg_58; break;
                case -59: str = POMsg_59; break;
                case -60: str = POMsg_60; break;
                case -61: str = POMsg_61; break;
                case -62: str = POMsg_62; break;
                case -88: str = POMsg_88; break;
                case -100: str = POMsg_100; break;
                case -101: str = POMsg_101; break;
                case -200: str = POMsg_200; break;
                default: str = POMsg_; break;
            }
            return str;
        }
    }
}
