public BlueprintViewer(Session aSession, LoggedInView aParent, Blueprint aBlueprint)
        {
            InitializeComponent();

            CurrentSession        = aSession;
            parent                = aParent;
            selectedBluePrint     = aBlueprint;
            wallPen               = new Pen(Brushes.Black, 5);
            beamPen               = new Pen(Brushes.DarkRed, 8);
            doorPen               = new Pen(Brushes.DarkGoldenrod, 6);
            windowPen             = new Pen(Brushes.Sienna, 5);
            BlueprintPanel.Cursor = Cursors.Cross;

            gridLinesMarginToLayerInPixels    = 1;
            drawSurfaceMarginToWindowInPixels = 10;
            gridCellCountX         = aBlueprint.Length;
            gridCellCountY         = aBlueprint.Width;
            windowXBoundryInPixels = this.BlueprintPanel.Width;
            windowYBoundryInPixels = this.BlueprintPanel.Height;
            setUpDrawSurface(40);

            PaintWalls();
            PaintBeams();
            PaintOpenings();
            calulateCostsAndPrices();
        }
 public ClientChooseBlueprintView(Session aSession, LoggedInView aControl)
 {
     InitializeComponent();
     parent               = aControl;
     CurrentSession       = aSession;
     permissionController = new BlueprintController(CurrentSession);
 }
        public CreateBlueprint(Session aSession, LoggedInView aControl)
        {
            InitializeComponent();
            parent         = aControl;
            CurrentSession = aSession;
            IRepository <User> usersStorage = new UserRepository();

            permissionController = new UserAdministrator(CurrentSession, usersStorage);
        }
        public AdminUserManagement(Session aSession, LoggedInView aControl)
        {
            InitializeComponent();
            parent         = aControl;
            CurrentSession = aSession;
            IRepository <User> repository = new UserRepository();

            controller = new UserAdministrator(CurrentSession, repository);
        }
Exemple #5
0
        public ChooseBlueprintView(Session aSession, LoggedInView aControl)
        {
            InitializeComponent();
            parent         = aControl;
            CurrentSession = aSession;
            IRepository <IBlueprint> bpStorage = new BlueprintRepository();

            permissionController = new BlueprintController(CurrentSession, bpStorage);
        }
        public ManageCostsView(LoggedInView aControl, Session aSession)
        {
            InitializeComponent();
            parent  = aControl;
            current = aSession;
            IPriceCostRepository catalog = new PriceCostRepository();

            costsNprices = new CostsAndPricesManager(current, catalog);
            costPriceInfo.Hide();
        }
Exemple #7
0
        public CreateUserView(LoggedInView aControl, Permission aFeature, Session aSession)
        {
            InitializeComponent();
            parent         = aControl;
            CurrentSession = aSession;
            IRepository <User> userStorage = new UserRepository();

            permissionController = new UserAdministrator(CurrentSession, userStorage);
            particularFeature    = aFeature;
            ShowExtraFields();
        }
        public EditBlueprintView(Session aSession, LoggedInView aParent, Blueprint aBlueprint)
        {
            InitializeComponent();

            CurrentSession                 = aSession;
            parent                         = aParent;
            selectedBluePrint              = aBlueprint;
            parent.ParentForm.FormClosing += new FormClosingEventHandler(CheckSignmentEventHandler);

            BlueprintPanel.Cursor = Cursors.Cross;
            IRepository <IBlueprint> bpStorage           = new BlueprintRepository();
            IRepository <Template>   templatesRepository = new OpeningTemplateRepository();

            editor = new BlueprintEditor(aSession, aBlueprint, bpStorage, templatesRepository);
            IRepository <Template> templates = new OpeningTemplateRepository();

            openingFactory = new OpeningFactory(templates);


            int gridLinesMarginToLayerInPixels    = 1;
            int drawSurfaceMarginToWindowInPixels = 10;
            int gridCellCountX         = aBlueprint.Length;
            int gridCellCountY         = aBlueprint.Width;
            int windowXBoundryInPixels = this.BlueprintPanel.Width;
            int windowYBoundryInPixels = this.BlueprintPanel.Height;

            drawer = new Drawer(gridCellCountX, gridCellCountY, 40, windowXBoundryInPixels, windowYBoundryInPixels, gridLinesMarginToLayerInPixels, drawSurfaceMarginToWindowInPixels);
            LoadGridPaintStrategies();
            setUpDrawSurface(40);

            PaintWalls();
            PaintBeams();
            PaintOpenings();
            PaintColumns();
            calulateCostsAndPrices();
            ShowOrHideSignButton();
            ShowOrHideTools();

            ICollection <Template> templatesInDB = editor.GetTemplates();

            cmbTemplates.DataSource = templatesInDB;
        }