Exemplo n.º 1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            var hardwareInfo = new HWEntity();

            hardwareInfo.Hardware_Name   = HWChangesTextBox.Text;
            hardwareInfo.Hardware_Brand  = HWBrandTextBox.Text;
            hardwareInfo.Hardware_Model  = HWModelTextBox.Text;
            hardwareInfo.Hardware_Type   = HWTypeTextBox.Text;
            hardwareInfo.Hardware_Status = HWStatusTextBox.Text;
            hardwareInfo.Hardware_Price  = Convert.ToDecimal(HWPriceTextBox.Text);
            hwContext.HWEntities.Add(hardwareInfo);
            hwContext.SaveChanges();

            RefreshView();
        }
Exemplo n.º 2
0
        private void SaveChangesButton_Click(object sender, EventArgs e)
        {
            //hwController.ShowCSharpHWForm();
            var hardwareInfo = new HWEntity();

            hardwareInfo.Hardware_Name   = HWChangesTextBox.Text;
            hardwareInfo.Hardware_Brand  = HWBrandTextBox.Text;
            hardwareInfo.Hardware_Model  = HWModelTextBox.Text;
            hardwareInfo.Hardware_Type   = HWTypeTextBox.Text;
            hardwareInfo.Hardware_Status = HWStatusTextBox.Text;
            hardwareInfo.Hardware_Price  = Convert.ToDecimal(HWPriceTextBox.Text);
            hwContext.HWEntities.Add(hardwareInfo);
            hwContext.SaveChanges();

            RefreshView();

            /*
             *          this.Validate();
             *          this.hardware_PurchasedBindingSource.EndEdit();
             *          this.tableAdapterManager.UpdateAll(this.may2020EquipmentHWDatabaseDataSet);
             */
        }