コード例 #1
0
ファイル: Program.cs プロジェクト: savstone/DesignPattern
        public static IShowMsg CreateShowMsg(string errorCode)
        {
            IShowMsg showMsg = null;

            switch (errorCode)
            {
            case "1":
            case "2":
                showMsg = new ResultShowMsg();
                break;

            case "-1":
                showMsg = new ExistShowMsg();
                break;

            default:
                showMsg = new EmtipyShowMsg();
                break;
            }
            return(showMsg);
        }
コード例 #2
0
 public SqlManager(IShowMsg shwMsg = null)
 {
     messageHendler = shwMsg;
 }