public FrmSelectTransfer(DataTable dataTable, PresenterDetailsInUserDepartment tempPresent, ICtrlDetailDepartament ctrlDetail, int userId)
 {
     _userId = userId;
     InitializeComponent();
     _dataUsers = dataTable;
     LoadCMBdata();
     _tempPresent = tempPresent;
     _ctrlDetail  = ctrlDetail;
     //  _dbAddDetails = new DbAddDetails();
     cmListDep.SelectedIndexChanged += CmListDep_SelectedIndexChanged;
 }
Exemple #2
0
        //Initiazet all presenters contorol
        private void InitailizetAllPresentersCtrls()
        {
            //set string connection from config
            var con = ConfigurationManager.ConnectionStrings["SqlProvider"].ConnectionString;

            //start controlAddDetails presenter
            DbAddDetails dbAdd = new DbAddDetails();

            dbAdd.OpenConnection(con);
            _presenterCrtlAddDetails = new PresenterCrtlAddDetails(_mainMenu.CtrAddDet, dbAdd, _messageService, _userId, _userDep);

            //start controlDetailsOnDepartament presenter
            DbDetailstOnDep dBDetailstOnDep = new DbDetailstOnDep();

            dBDetailstOnDep.OpenConnection(con);
            _presenterDetailsInUserDepartment = new PresenterDetailsInUserDepartment(_mainMenu.CtrlDetailOnDepartment, dBDetailstOnDep, _messageService, _userId, _userDep);

            //Start controlAllDetails
            DBAllDetails dBAllDetails = new DBAllDetails();

            dBAllDetails.OpenConnection(con);
            _presenterCtrlAllDetails = new PresenterCtrlAllDetails(_mainMenu.CtrlAllDetails, _messageService, dBAllDetails);

            //Start controlCreateReport Presenter
            var bDReport = new DBReport();

            bDReport.OpenConnection(con);
            _presenterCtrlCreateReport = new PresenterCtrlCreateReport(_mainMenu.CtrlReport, _messageService, bDReport, _userId, _userDep);

            //Start controlAdmin presenter
            DbAdmin bDAdmin = new DbAdmin();

            bDAdmin.OpenConnection(con);
            new PresenterCtrlAdministration(_mainMenu.CtrlAdministrator, _messageService, bDAdmin);

            //Start controlAllDepartaments presenter
            DBdepartament dBdepartament = new DBdepartament();

            dBdepartament.OpenConnection(con);
            new PresenterCtrlDepartaments(dBdepartament, _messageService, _mainMenu.CtrlDepartaments);
        }