コード例 #1
0
        public void Delete()
        {
            DataLists dataLists = DataStorage.GetInstance().DataLists;

            dataLists.Markers.Remove(this);
        }
コード例 #2
0
        private void InitializeForm()
        {
            Width         = 500;
            Height        = 500;
            Name          = "DocumentForm";
            Text          = "Document Form";
            BackColor     = Color.MediumTurquoise;
            StartPosition = FormStartPosition.CenterScreen;

            Label title = new Label
            {
                Text = "Название:"
            };

            title.SetBounds(10, 20, 80, 30);

            TextBox titleBox = new TextBox
            {
                Name = "titleBox"
            };

            titleBox.SetBounds(95, 20, 150, 30);

            Label type = new Label
            {
                Text = "Тип:"
            };

            type.SetBounds(10, 55, 80, 30);

            ComboBox typeBox = new ComboBox
            {
                Name          = "typeBox",
                DropDownStyle = ComboBoxStyle.DropDownList,
                DataSource    = DataStorage.GetInstance().DataLists.DocumentTypes
            };

            typeBox.SetBounds(95, 55, 150, 30);

            Label documentCode = new Label
            {
                Text = "Код:"
            };

            documentCode.SetBounds(10, 90, 80, 30);

            TextBox documentCodeBox = new TextBox
            {
                Name = "documentCodeBox"
            };

            documentCodeBox.SetBounds(95, 90, 150, 30);

            Label receiver = new Label
            {
                Text = "Получатель:"
            };

            receiver.SetBounds(10, 125, 80, 30);

            ComboBox companiesBox = new ComboBox
            {
                Name          = "companiesBox",
                DropDownStyle = ComboBoxStyle.DropDownList,
                DataSource    = DataStorage.GetInstance().DataLists.Companies
            };

            companiesBox.SetBounds(95, 125, 150, 30);

            Label text = new Label
            {
                Text = "Содержание:"
            };

            text.SetBounds(10, 155, 80, 30);

            TextBox textBox = new TextBox
            {
                Name      = "textBox",
                Multiline = true
            };

            textBox.SetBounds(10, 190, 235, 100);

            Button commitButton = new Button
            {
                Name      = "commitButton",
                BackColor = Color.Tomato,
                Font      = new Font("Monotype Corsiva", 14.25F, FontStyle.Italic, GraphicsUnit.Point, ((byte)(204))),
                Text      = "Добавить"
            };

            commitButton.SetBounds(10, 295, 235, 30);
            commitButton.Click += new EventHandler(CommitEvent);

            Controls.Add(title);
            Controls.Add(titleBox);
            Controls.Add(type);
            Controls.Add(typeBox);
            Controls.Add(documentCode);
            Controls.Add(documentCodeBox);
            Controls.Add(receiver);
            Controls.Add(companiesBox);
            Controls.Add(text);
            Controls.Add(textBox);
            Controls.Add(commitButton);
        }
コード例 #3
0
        private void InitializeForm()
        {
            Width         = 600;
            Height        = 400;
            Name          = "CompanyForm";
            Text          = "Company Adder Form";
            BackColor     = Color.Orange;
            StartPosition = FormStartPosition.CenterScreen;

            Label name = new Label
            {
                Text = "Название:"
            };

            name.SetBounds(10, 20, 80, 30);

            TextBox nameBox = new TextBox
            {
                Name = "nameBox"
            };

            nameBox.SetBounds(95, 20, 150, 30);

            Label address = new Label
            {
                Text = "Адрес:"
            };

            address.SetBounds(10, 55, 80, 30);

            TextBox addressBox = new TextBox
            {
                Name = "addressBox"
            };

            addressBox.SetBounds(95, 55, 150, 30);

            Label type = new Label
            {
                Text = "Тип:"
            };

            type.SetBounds(10, 90, 80, 30);

            ComboBox typeBox = new ComboBox
            {
                Name          = "typeBox",
                DropDownStyle = ComboBoxStyle.DropDownList,
                DataSource    = DataStorage.GetInstance().DataLists.CompanyTypes
            };

            typeBox.SetBounds(95, 90, 150, 30);

            Button directorChooseButton = new Button
            {
                Name      = "directorChooseButton",
                BackColor = Color.Tomato,
                Font      = new Font("Monotype Corsiva", 14.25F, FontStyle.Italic, GraphicsUnit.Point, ((byte)(204))),
                Text      = "Выбрать директора"
            };

            directorChooseButton.SetBounds(10, 125, 235, 30);
            directorChooseButton.Click += new EventHandler(DirectorChooseButton_Click);

            ComboBox personsBox = new ComboBox
            {
                Name          = "personsBox",
                DropDownStyle = ComboBoxStyle.DropDownList,
                DataSource    = DataStorage.GetInstance().DataLists.Persons.Where(p => !p.Working).ToList()
            };

            personsBox.SetBounds(10, 160, 235, 30);

            Button addCompanyButton = new Button
            {
                Name      = "addCompanyButton",
                BackColor = Color.Tomato,
                Font      = new Font("Monotype Corsiva", 14.25F, FontStyle.Italic, GraphicsUnit.Point, ((byte)(204))),
                Text      = "Добавить организацию"
            };

            addCompanyButton.SetBounds(10, 250, 235, 30);
            addCompanyButton.Click += new EventHandler(AddCompanyButton_Click);

            Controls.Add(name);
            Controls.Add(nameBox);
            Controls.Add(address);
            Controls.Add(addressBox);
            Controls.Add(type);
            Controls.Add(typeBox);
            Controls.Add(directorChooseButton);
            Controls.Add(personsBox);
            Controls.Add(addCompanyButton);
        }