Exemplo n.º 1
0
        public ContractorsListForm()
        {
            InitializeComponent();

            query = new QueryContractors();

            this.Text = Properties.Resources.Contractors;

            labelSearch.Text         = Properties.Resources.Search;
            labelContractorType.Text = Properties.Resources.ContractorType;


            buttonCreate.Text  = Properties.Resources.Create;
            buttonEdit.Text    = Properties.Resources.Edit;
            buttonDelete.Text  = Properties.Resources.Delete;
            buttonRefresh.Text = Properties.Resources.Refresh;
            buttonSearch.Text  = Properties.Resources.Search;

            dataGridView1.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.ReadOnly            = true;
            dataGridView1.AllowUserToAddRows  = false;
            dataGridView1.RowHeadersVisible   = false;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView1.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
            dataGridView1.ScrollBars          = ScrollBars.Both;

            DataGridViewTextBoxColumn col00 = new DataGridViewTextBoxColumn();

            col00.HeaderText = Properties.Resources.ID;

            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();

            col0.HeaderText = Properties.Resources.Title;

            DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();

            col1.HeaderText = Properties.Resources.ContractorType;


            dataGridView1.Columns.Add(col00);
            dataGridView1.Columns.Add(col0);
            dataGridView1.Columns.Add(col1);

            addGridView(query.querySelectContractors(0));

            List <ObjectComboBox> lObj = new List <ObjectComboBox>();

            lObj.Add(new ObjectComboBox(0, Properties.Resources.All));
            lObj.Add(new ObjectComboBox(1, Properties.Resources.Customer));
            lObj.Add(new ObjectComboBox(2, Properties.Resources.Provider));

            comboBoxContractorType.DataSource = lObj;

            comboBoxContractorType.ValueMember   = "Id";
            comboBoxContractorType.DisplayMember = "Name";
        }
Exemplo n.º 2
0
        public SuppluEditForm(SupplyListForm instance)
        {
            this.instance = instance;

            InitializeComponent();

            query            = new QueryContractSupply();
            queryProd        = new QueryProducts();
            queryContractors = new QueryContractors();

            this.Text             = Properties.Resources.Supply;
            labelId.Text          = Properties.Resources.SupplyContract;
            label2.Text           = Properties.Resources.Date;
            label3.Text           = Properties.Resources.Goods;
            label4.Text           = Properties.Resources.Number;
            labelAmount.Text      = Properties.Resources.Amount;
            labelWasReceived.Text = Properties.Resources.Received;
            labelContractors.Text = Properties.Resources.Contractor;

            buttonCancel.Text = Properties.Resources.Cancel;
            buttonOK.Text     = Properties.Resources.OK;

            ArrayList lObjPr = new ArrayList();

            foreach (var item in queryProd.querySelectProducts())
            {
                lObjPr.Add(new { Id = item.Id, Name = item.Name });
            }

            comboBoxProducts.DataSource    = lObjPr;
            comboBoxProducts.ValueMember   = "Id";
            comboBoxProducts.DisplayMember = "Name";

            List <bool> lObjBool = new List <bool> {
                true, false
            };

            comboBoxWasReceived.DataSource = lObjBool;

            ArrayList lObjContr = new ArrayList();

            foreach (var item in queryContractors.querySelectContractors(2))
            {
                lObjContr.Add(new { Id = item.Id, Name = item.Name });
            }

            comboBoxContractors.DataSource    = lObjContr;
            comboBoxContractors.ValueMember   = "Id";
            comboBoxContractors.DisplayMember = "Name";
        }
Exemplo n.º 3
0
        public ContractorEditForm(ContractorsListForm instance)
        {
            this.instance = instance;
            InitializeComponent();

            query = new QueryContractors();

            this.Text = Properties.Resources.Contractor;

            label1.Text = Properties.Resources.ContractorType;
            label2.Text = Properties.Resources.Title;

            comboBox1.DataSource = new List <String> {
                Properties.Resources.Customer, Properties.Resources.Provider
            };

            buttonCancel.Text = Properties.Resources.Cancel;
            buttonOK.Text     = Properties.Resources.OK;
        }