コード例 #1
0
        public MyAssetsPageControl(FormMain form, string message)
        {
            InitializeComponent();
            formMain = form;
            DataBaseAccess dataBase = new DataBaseAccess();

            dataBase.StartConnection();
            if (message == "project")
            {
                curUserProjects = dataBase.getOwnedProjectsOfUser((int)formMain.UsersAccounts.GetCurrentUser().GetUserID());
            }
            else if (message == "asset")
            {
                curUserAssets = dataBase.getAssetsOfUser((int)formMain.UsersAccounts.GetCurrentUser().GetUserID());
            }
            dataBase.CloseConnection();

            if (curUserAssets != null && message == "asset")
            {
                HelperTools.CreateAssetButtons(new Point(48, 104), formMain, this, curUserAssets.Count, 5, curUserAssets);
            }
            else if (curUserProjects != null && message == "project")
            {
                HelperTools.CreateAssetButtons(new Point(48, 104), formMain, this, curUserProjects.Count, 5, null, curUserProjects);
            }
        }