private void UpdateItem() { string oldCode = SelectedItem.Code; string oldName = SelectedItem.Name; SelectedItem.Code = this.InputCode; SelectedItem.Name = this.InputName; SettingsDao.UpdateColor(oldCode, oldName, SelectedItem); ClearInput(); }
private void CreateItem() { MaterialItemModel item = new MaterialItemModel() { Code = GetNewMaterialCode(_listModel), Name = InputName }; SettingsDao.CreateMaterial(item); this._listModel.Add(item); ClearInput(); }
private void DeleteItem() { if (this.SelectedItems != null) { for (int i = SelectedItems.Count - 1; i >= 0; i--) { SettingsDao.DeleteMaterial(((MaterialItemModel)SelectedItems[i]).Code); this._listModel.Remove((MaterialItemModel)SelectedItems[i]); } } ClearInput(); }
private void CreateItem() { ColorItemModel item = new ColorItemModel() { Code = this.InputCode.Trim(), Name = this.InputName, }; SettingsDao.CreateColor(item); this._listModel.Add(item); ClearInput(); }
private void UpdateItem() { SelectedItem.Name = this.InputName; SettingsDao.UpdateMaterial(SelectedItem); ClearInput(); }