Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DrugsEntity          selectedDrug = (DrugsEntity)comboBox1.SelectedItem;
            WarehouseItemsEntity entity       = new WarehouseItemsEntity
            {
                Quantity = Convert.ToInt32(textBox1.Text),
                DrugID   = selectedDrug.ID
            };

            ApplicationLogic.Insert(ApplicationLogic.Tables.Warehouse, entity);
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ManufacturersEntity selectedManufacturer = (ManufacturersEntity)ManufacturersCB.SelectedItem;
            MeasuresEntity      selectedMeasure      = (MeasuresEntity)measuresCB.SelectedItem;
            DrugsEntity         entity = new DrugsEntity
            {
                ManufacturerID = selectedManufacturer.ID,
                MeasureID      = selectedMeasure.ID,
                ExpTerm        = textBoxExpTerm.Text,
                Purpose        = textBoxPurpose.Text,
                Quantity       = Convert.ToInt32(textBoxQuantity.Text),
                Price          = Convert.ToInt32(textBoxPrice.Text),
                Indications    = textBoxIndications.Text,
                Title          = textBoxTitle.Text
            };

            ApplicationLogic.Insert(ApplicationLogic.Tables.Drugs, entity);
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DrugsEntity selectedDrug = (DrugsEntity)drugsCB.SelectedItem;

            ApplicationLogic.Delete(ApplicationLogic.Tables.Drugs, selectedDrug.ID);
        }