示例#1
0
        private void AddOrUpdateColumn(string addOrUpdate)
        {
            r.Id           = int.Parse(textBoxRamId.Text);
            r.Manufacturer = textBoxRamManufacturer.Text;
            r.Name         = textBoxRamName.Text;
            r.Speed        = textBoxRamSpeed.Text;
            r.Size         = int.Parse(textBoxRamSize.Text);
            r.Price        = double.Parse(textBoxRamPrice.Text);

            bool success = addOrUpdate == "added" ? r.Insert(r) : r.Update(r);

            helperMethods.DisplayMessage(success, addOrUpdate, this, r, componentName, ramBrowseGV);
        }