Exemple #1
0
        public override void SetupView()
        {
            // Setup label text
            TitleLabel.Text = "Selected Equipment:";
            TitleLabel.SetBounds(
                margin,
                margin,
                200,
                30);

            process_parameters_label.Text = "Process Parameters:";
            process_parameters_label.SetBounds(
                margin,
                TitleLabel.Top + TitleLabel.Height + padding,
                200,
                20);

            // Setup listview
            SetupProcessParametersListView();

            // Setup EditParameterView
            editParameterView.SetPos(
                processParametersListview.Left + processParametersListview.Width + padding,
                process_parameters_label.Top);
            //300,
            //200);

            // Setup width & height
            this.Width =
                margin +
                processParametersListview.Width + padding +
                editParameterView.Width;

            this.Height =
                margin +
                TitleLabel.Height + padding +
                process_parameters_label.Height + padding +
                processParametersListview.Height + margin;
        }
Exemple #2
0
        // Methods
        public override void SetupView()
        {
            // Set GUI controls dimensions & positions
            // Setup labels
            TitleLabel.Text = "Create Report:";
            TitleLabel.SetBounds(
                margin,
                margin,
                150,
                30);

            yearLabel.Text = "Year:";
            yearLabel.SetBounds(
                margin,
                margin + TitleLabel.Height + padding,
                100,
                20);

            monthLabel.Text = "Month:";
            monthLabel.SetBounds(
                margin,
                yearLabel.Top + yearLabel.Height + padding,
                100,
                20);

            locationLabel.Text = "Location:";
            locationLabel.SetBounds(
                margin,
                monthLabel.Top + monthLabel.Height + padding,
                100,
                20);

            reportNameLabel.Text = "ReportName:";
            reportNameLabel.SetBounds(
                margin,
                locationLabel.Top + locationLabel.Height + padding,
                100,
                20);

            // Setup textboxes
            yearTextBox.SetBounds(
                yearLabel.Left + yearLabel.Width + padding,
                yearLabel.Top,
                50,
                20);

            monthTextBox.SetBounds(
                monthLabel.Left + monthLabel.Width + padding,
                monthLabel.Top,
                100,
                20);

            locationTextBox.SetBounds(
                locationLabel.Left + locationLabel.Width + padding,
                locationLabel.Top,
                150,
                20);

            reportNameTextBox.SetBounds(
                reportNameLabel.Left + reportNameLabel.Width + padding,
                reportNameLabel.Top,
                150,
                20);

            //Setup buttons
            setLocationButton.Text = "Set";
            setLocationButton.SetBounds(
                locationTextBox.Left + locationTextBox.Width + padding,
                locationTextBox.Top,
                50,
                20);

            createReportButton.Text = "Create";
            createReportButton.SetBounds(
                reportNameTextBox.Left,
                reportNameTextBox.Top + reportNameTextBox.Height + padding,
                150,
                20);

            //Setup Folder Dialog
            folderBrowser.Description = "Select the Directory where you want to save the report.";

            // Setup width & height
            this.Width =
                margin +
                locationLabel.Width + padding +
                locationTextBox.Width + padding +
                setLocationButton.Width + margin;

            this.Height =
                margin +
                TitleLabel.Height + padding +
                yearTextBox.Height + padding +
                monthTextBox.Height + padding +
                locationTextBox.Height + padding +
                reportNameTextBox.Height + padding +
                createReportButton.Height + margin;
        }
        public override void SetupView()
        {
            // Set GUI controls dimensions & positions
            // Setup labels
            TitleLabel.Text = "Add New Brew:";
            TitleLabel.SetBounds(
                margin,
                margin,
                150,
                30);

            brandLabel.Text = "Brand:";
            brandLabel.SetBounds(
                margin,
                TitleLabel.Top + TitleLabel.Height + padding,
                100,
                20);

            dateLabel.Text = "Date:";
            dateLabel.SetBounds(
                margin,
                brandLabel.Top + brandLabel.Height + padding,
                100,
                20);

            brewNumberLabel.Text = "BrewNumber:";
            brewNumberLabel.SetBounds(
                margin,
                dateLabel.Top + dateLabel.Height + padding,
                100,
                20);

            // Setup textboxes
            brandNameTextBox.SetBounds(
                brandLabel.Left + brandLabel.Width + padding,
                brandLabel.Top,
                150,
                20);

            dateTextBox.SetBounds(
                dateLabel.Left + dateLabel.Width + padding,
                dateLabel.Top,
                150,
                20);

            brewNumberTextBox.SetBounds(
                brewNumberLabel.Left + brewNumberLabel.Width + padding,
                brewNumberLabel.Top,
                150,
                20);

            // Setup button
            startNewBrewButton.Text = "Start Brew";
            startNewBrewButton.SetBounds(
                brewNumberTextBox.Left,
                brewNumberTextBox.Top + brewNumberTextBox.Height + padding,
                150,
                20);

            // Setup width & height
            this.Width  = margin + brandLabel.Width + padding + brandNameTextBox.Width + margin;
            this.Height = margin +
                          TitleLabel.Height + padding +
                          brandNameTextBox.Height + padding +
                          dateTextBox.Height + padding +
                          brewNumberTextBox.Height + padding +
                          startNewBrewButton.Height + margin;
        }
        protected override Panel ShowDetailPanel(object Obj)
        {
            book  Book        = (book)Obj;
            Panel DetailPanel = new Panel();

            Control[] DetailsCol = new Control[5 * (Book.book_record.Count + 1)];
            //update
            string[] ColumnLabels = { "No", "RecId", "BookCode", "BookId", "Available" };
            for (int i = 0; i < ColumnLabels.Length; i++)
            {
                DetailsCol[i] = new TitleLabel(9)
                {
                    Text = ColumnLabels[i]
                };
            }
            int ControlIndex = 5;

            for (int i = 0; i < Book.book_record.Count; i++)
            {
                book_record BR = Book.book_record.ElementAt(i);
                DetailsCol[ControlIndex++] = new Label()
                {
                    Text = (i + 1).ToString()
                };
                DetailsCol[ControlIndex++] = new TextBoxReadonly()
                {
                    Text = BR.id
                };
                DetailsCol[ControlIndex++] = new TextBoxReadonly()
                {
                    Text = BR.book_code
                };
                DetailsCol[ControlIndex++] = new TextBoxReadonly()
                {
                    Text = BR.book_id
                };
                DetailsCol[ControlIndex++] = new TextBoxReadonly()
                {
                    Text = BR.available == 1 ? "yes" : "-"
                };
            }
            //
            DetailPanel = ControlUtil.GeneratePanel(5, DetailsCol, 5, 80, 20, Color.Orange, 5, 5, 400, 500);

            //picturebox
            string URL = "http://" + Transaction.Host + "/Assets/Image/App/bookCover.jpg";

            if (Book.img != null)
            {
                URL = "http://" + Transaction.Host + "/Assets/Image/Book/" + Book.img;
            }

            PictureBox Picture = new PictureBox();

            //    Picture.BorderStyle = BorderStyle.Fixed3D;
            Picture.ImageLocation = URL;
            Picture.SizeMode      = PictureBoxSizeMode.StretchImage;

            Picture.SetBounds(100, 10, 150, 200);
            Picture.BackColor = Color.Aqua;
            DetailPanel.SetBounds(10, 250, DetailPanel.Width, DetailPanel.Height);

            TitleLabel BookTitle = new TitleLabel(15)
            {
                Text = Book.title
            };

            BookTitle.TextAlign = ContentAlignment.MiddleCenter;
            BookTitle.SetBounds(10, 200, 350, 50);

            Panel Wrapper = new Panel();

            Wrapper.Controls.Add(Picture);
            Wrapper.Controls.Add(BookTitle);
            Wrapper.Controls.Add(DetailPanel);
            Wrapper.SetBounds(5, 5, 500, 1000);
            return(Wrapper);
        }