Ejemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            CommonConnection connection = ConnectionFactory.createConnection("mysql", "remotemysql.com", "WEJMD9dLmJ", "WEJMD9dLmJ", "CqlKK8zDL3", 3306);

            MyContainer.RegisterInstance <CommonConnection>(connection);
            Login login = new Login
            {
                SuccessAction = roles =>
                {
                    Role role = new Role
                    {
                        isAllowedAdd    = roles.Contains("C"),
                        isAllowedRead   = roles.Contains("R"),
                        isAllowedUpdate = roles.Contains("U"),
                        isAllowedDelete = roles.Contains("D")
                    };
                    MyContainer.RegisterInstance <Role>(role);
                    new MainForm().Show();
                }
            };

            Application.Run(login);
        }
Ejemplo n.º 2
0
 public static void RegisterConnection(CommonConnection conn)
 {
     MyContainer.RegisterInstance <CommonConnection>(conn);
 }
Ejemplo n.º 3
0
 public Database(CommonConnection connection)
 {
     this.Connection = connection;
 }