コード例 #1
0
 public AdminForm(clinicEntities clinicEntities)
 {
     _clinicEntities       = clinicEntities;
     _medicineRepository   = new MedicineRepository(_clinicEntities);
     _serviceRepository    = new ServiceRepository(_clinicEntities);
     _permissionRepository = new PermissionRepository(_clinicEntities);
     _accountRepository    = new AccountRepository(_clinicEntities);
     _billRepository       = new BillRepository(_clinicEntities);
     _staffRepository      = new StaffRepository(_clinicEntities, _permissionRepository, _accountRepository);
     _statisticRepository  = new StatisticRepository(_clinicEntities);
     _presenter            = new AdminPresenter(this, _medicineRepository, _staffRepository, _serviceRepository, _billRepository, _statisticRepository);
     InitializeComponent();
 }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            clinicEntities clinicEntities = new clinicEntities();

            IAccountRepository accountRepository = new AccountRepository(clinicEntities);
            var form = new LoginForm(accountRepository);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (permissionId == 1)
                {
                    Application.Run(new AdminForm(clinicEntities));
                }
                else
                {
                    Application.Run(new ReceptionForm(clinicEntities));
                }
            }
        }