Пример #1
0
        public Item(OrderDesignControl container)
        {
            this.Container = container;
            int nTopBlank = (int)this.Container.Font.GetHeight() + 2;

            label_color = new Label();
            label_color.Dock = DockStyle.Fill;
            label_color.Size = new Size(6, 28);
            label_color.Margin = new Padding(1, 0, 1, 0);

            // 书目号
            this.textBox_catalogNo = new TextBox();
            textBox_catalogNo.BorderStyle = BorderStyle.None;
            textBox_catalogNo.Dock = DockStyle.Fill;
            textBox_catalogNo.MinimumSize = new Size(80, 28);
            // textBox_price.Multiline = true;
            textBox_catalogNo.Margin = new Padding(6, nTopBlank + 6, 6, 0);
            textBox_catalogNo.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            // this.textBox_catalogNo.Visible = false;

            // 渠道
            comboBox_seller = new ComboBox();
            comboBox_seller.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_seller.FlatStyle = FlatStyle.Flat;
            comboBox_seller.Dock = DockStyle.Fill;
            comboBox_seller.MaximumSize = new Size(150, 28);
            comboBox_seller.Size = new Size(100, 28);
            comboBox_seller.MinimumSize = new Size(50, 28);
            comboBox_seller.DropDownHeight = 300;
            comboBox_seller.DropDownWidth = 300;
            comboBox_seller.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            comboBox_seller.Text = "";
            comboBox_seller.Margin = new Padding(6, nTopBlank + 6, 6, 0);
            // this.comboBox_seller.Visible = false;

            // 经费来源
            comboBox_source = new DoubleComboBox();

            comboBox_source.ComboBox.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_source.ComboBox.FlatStyle = FlatStyle.Flat;
            comboBox_source.ComboBox.DropDownHeight = 300;
            comboBox_source.ComboBox.DropDownWidth = 300;
            comboBox_source.ComboBox.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            comboBox_source.Margin = new Padding(6, nTopBlank,  // + 3,
                6, 0);

            comboBox_source.TextBox.ReadOnly = true;
            comboBox_source.TextBox.BorderStyle = BorderStyle.None;
            comboBox_source.TextBox.ForeColor = SystemColors.GrayText;

            comboBox_source.Dock = DockStyle.Fill;
            comboBox_source.MaximumSize = new Size(110, 28*2);
            comboBox_source.Size = new Size(80, 28*2);
            comboBox_source.MinimumSize = new Size(50, 28);


            // 范围
            dateRange_range = new DateRangeControl();

            if (container != null && container.SeriesMode == false)
            {
                // dateRange_range.Visible = false; // ????
            }

            // dateRange_range.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            dateRange_range.BorderStyle = BorderStyle.None;

            dateRange_range.Dock = DockStyle.Fill;
            /*
            dateRange_range.MaximumSize = new Size(150, 28 * 2);
            dateRange_range.Size = new Size(150, 28 * 2);
            dateRange_range.MinimumSize = new Size(130, 28 * 2);
             * */
            dateRange_range.Margin = new Padding(1, nTopBlank, // + 3,
                1, 0);
            // this.dateRange_range.Visible = false;

            // 期数
            /*
            textBox_issueCount = new TextBox();
            textBox_issueCount.BorderStyle = BorderStyle.None;
            textBox_issueCount.Dock = DockStyle.Fill;
            textBox_issueCount.MinimumSize = new Size(100, 28);
            textBox_issueCount.Margin = new Padding(6, 3, 6, 0);
            textBox_issueCount.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            */
            comboBox_issueCount = new ComboBox();

            if (container != null && container.SeriesMode == false)
                this.comboBox_issueCount.Visible = false;

            comboBox_issueCount.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_issueCount.FlatStyle = FlatStyle.Flat;
            comboBox_issueCount.DropDownHeight = 300;
            comboBox_issueCount.DropDownWidth = 100;
            comboBox_issueCount.Dock = DockStyle.Fill;
            comboBox_issueCount.MaximumSize = new Size(100, 28);
            comboBox_issueCount.Size = new Size(70, 28);
            comboBox_issueCount.MinimumSize = new Size(50, 28);
            comboBox_issueCount.Items.AddRange(new object[] {
            "6",
            "12",
            "24",
            "36"});

            comboBox_issueCount.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            comboBox_issueCount.Margin = new Padding(6, nTopBlank + 6, // + 3,
                6, 0);
            // this.comboBox_issueCount.Visible = false;

            // 复本数
            /*
            comboBox_copy = new ComboBox();
            comboBox_copy.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_copy.FlatStyle = FlatStyle.Flat;
            comboBox_copy.DropDownHeight = 300;
            comboBox_copy.DropDownWidth = 250;
            comboBox_copy.Dock = DockStyle.Fill;
            comboBox_copy.MaximumSize = new Size(100, 28);
            comboBox_copy.Size = new Size(70, 28);
            comboBox_copy.MinimumSize = new Size(50, 28);

            comboBox_copy.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
             * */
            comboBox_copy = new DoubleComboBox();
            comboBox_copy.ComboBox.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_copy.ComboBox.FlatStyle = FlatStyle.Flat;
            comboBox_copy.ComboBox.DropDownHeight = 300;
            comboBox_copy.ComboBox.DropDownWidth = 250;
            comboBox_copy.ComboBox.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            comboBox_copy.Margin = new Padding(6, nTopBlank, // + 3,
                6, 0);

            comboBox_copy.TextBox.ReadOnly = true;
            comboBox_copy.TextBox.BorderStyle = BorderStyle.None;
            comboBox_copy.TextBox.ForeColor = SystemColors.GrayText;

            comboBox_copy.Dock = DockStyle.Fill;
            comboBox_copy.MaximumSize = new Size(60, 28*2);
            comboBox_copy.Size = new Size(40, 28*2);
            comboBox_copy.MinimumSize = new Size(30, 28*2);
            // this.comboBox_copy.Visible = false;

            // 单价
            textBox_price = new DoubleTextBox();
            textBox_price.TextBox.BorderStyle = BorderStyle.None;
            textBox_price.TextBox.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;

            textBox_price.SecondTextBox.ReadOnly = true;
            textBox_price.SecondTextBox.BorderStyle = BorderStyle.None;
            textBox_price.SecondTextBox.ForeColor = SystemColors.GrayText;

            textBox_price.Dock = DockStyle.Fill;
            textBox_price.MaximumSize = new Size(90, 28 * 2);
            textBox_price.Size = new Size(70, 28 * 2);
            textBox_price.MinimumSize = new Size(50, 28 * 2);
            textBox_price.Margin = new Padding(6, nTopBlank + 1,
                6, 0);
            // textBox_price.BorderStyle = BorderStyle.FixedSingle;
            // this.textBox_price.Visible = false;

            // 去向
            location = new LocationEditControl();
            location.ArriveMode = this.Container.ArriveMode;
            location.BorderStyle = BorderStyle.None;
            location.Dock = DockStyle.Fill;
            // location.MinimumSize = new Size(100, 28);
            location.Margin = new Padding(6, nTopBlank + 6,
                6, 0);

            location.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            location.AutoScaleMode = AutoScaleMode.None;    // 防止它内部的控件放上去后被重新挪动位置
            // location.BorderStyle = BorderStyle.FixedSingle;
            location.DbName = container.BiblioDbName;

            // 类别
            comboBox_class = new ComboBox();
            comboBox_class.DropDownStyle = ComboBoxStyle.DropDown;
            comboBox_class.FlatStyle = FlatStyle.Flat;
            comboBox_class.Dock = DockStyle.Fill;
            comboBox_class.MaximumSize = new Size(150, 28);
            comboBox_class.Size = new Size(100, 28);
            comboBox_class.MinimumSize = new Size(50, 28);
            comboBox_class.DropDownHeight = 300;
            comboBox_class.DropDownWidth = 300;
            comboBox_class.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            comboBox_class.Text = "";
            comboBox_class.Margin = new Padding(6, nTopBlank + 6,
                6, 0);
            // this.comboBox_class.Visible = false;

            // 渠道地址
            this.label_sellerAddress = new Label();
            this.label_sellerAddress.BorderStyle = BorderStyle.None;
            this.label_sellerAddress.Dock = DockStyle.Fill;
            this.label_sellerAddress.MinimumSize = new Size(40, 28 * 2);
            // this.label_sellerAddress.Multiline = true;
            this.label_sellerAddress.Margin = new Padding(6, nTopBlank + 6,
                6, 0);
            this.label_sellerAddress.AutoSize = true;

            this.label_sellerAddress.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
            // this.label_sellerAddress.Visible = false;

            // 其他
            this.label_other = new Label();
            this.label_other.BorderStyle = BorderStyle.None;
            this.label_other.Dock = DockStyle.Fill;
            this.label_other.MinimumSize = new Size(50, 28 * 2);
            // this.label_other.Multiline = true;
            this.label_other.Margin = new Padding(6, nTopBlank + 6,
                6, 0);
            this.label_other.AutoSize = true;
            // this.label_other.Visible = false;

            this.label_other.ForeColor = this.Container.tableLayoutPanel_content.ForeColor;
        }
Пример #2
0
        internal string m_otherXml = "";    // 表示其他信息的XML记录

        void DisposeChildControls()
        {
            label_color.Dispose();
            textBox_catalogNo.Dispose();
            comboBox_seller.Dispose();
            comboBox_source.Dispose();
            dateRange_range.Dispose();
            comboBox_issueCount.Dispose();
            comboBox_copy.Dispose();
            textBox_price.Dispose();
            location.Dispose();
            comboBox_class.Dispose();
            label_sellerAddress.Dispose();
            label_other.Dispose();
            Container = null;
        }