コード例 #1
0
ファイル: Program.cs プロジェクト: kotasha/Chsharp
 public static void Main(string[] args)
 {
     try
     {
         IBusinessInterface myObj = BusinessFactoryClass.CreateInstance <IBusinessInterface>(ObjectType.Employee);
         //Console.Read();
     }
     catch (Exception obj)
     {
         obj.Log();
     }
     Console.Read();
 }
コード例 #2
0
        //BusinessFactoryClass myObject = default(BusinessFactoryClass);

        public static T CreateInstance <T>(ObjectType enumobj) where T : IBusinessInterface
        {
            IBusinessInterface business = default(IBusinessInterface);

            switch (enumobj)
            {
            case ObjectType.Customer:
                business = new Customer();
                break;

            case ObjectType.Employee:
                business = new Employee();
                break;

            default:
                throw new Exception("Class Not Implemented");
            }

            return((T)business);
        }
コード例 #3
0
 public ContactController(IContactRepository r, IBusinessInterface b)
 {
     repoContact = r;
     business    = b;
 }
コード例 #4
0
 public CESBClient(String _CCode = "00000")
 {
     _CESBClient = new RequestWsProvider <IBusinessInterface>(_CCode).ReqClient;
 }