예제 #1
0
        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.dgvSale.SelectedRows.Count != 1)
            {
                MessageBox.Show("Please Select a Row First");
                return;
            }

            this.pnlUpdate.Visible = true;
            this.txtID.Text        = this.dgvSale.CurrentRow.Cells["id"].Value.ToString();
            this.txtName.Text      = this.dgvSale.CurrentRow.Cells["name"].Value.ToString();
            this.txtCompany.Text   = this.dgvSale.CurrentRow.Cells["company"].Value.ToString();
            this.txtQuantity.Text  = this.dgvSale.CurrentRow.Cells["quantity"].Value.ToString();
            this.txtPrice.Text     = this.dgvSale.CurrentRow.Cells["price"].Value.ToString();

            this.txtID.Enabled      = false;
            this.txtName.Enabled    = false;
            this.txtCompany.Enabled = false;
            this.txtPrice.Enabled   = false;
            this.txtQuantity.Select();


            DelegateClassForSale.GridDelegate sDelGrid = PopulateGridView;
            // FormSell fs = new FormSell(sDelGrid, s);
            // fs.Visible = true;
        }
예제 #2
0
        private void sellToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.dgvMedicine.SelectedRows.Count != 1)
            {
                MessageBox.Show("Please Select a Row First");
                return;
            }

             m.id = this.dgvMedicine.CurrentRow.Cells["id"].Value.ToString();
             m.name = this.dgvMedicine.CurrentRow.Cells["name"].Value.ToString();
             m.company = this.dgvMedicine.CurrentRow.Cells["company"].Value.ToString();
             m.quantity = Convert.ToInt32(this.dgvMedicine.CurrentRow.Cells["quantity"].Value);
             m.price = Convert.ToDouble(this.dgvMedicine.CurrentRow.Cells["price"].Value);

            DelegateClassForSale.GridDelegate sDelGrid = PopulateGridView;
            FormSell fs = new FormSell(sDelGrid , m);
            fs.Visible = true;
        }
예제 #3
0
 public FormSell(DelegateClassForSale.GridDelegate sdg, Medicine m)
 {
     InitializeComponent();
     this.sdg = sdg;
     this.m   = m;
 }