public ProductionStandartForm(ProductionStandart editEntity, ProductStandartFilter filter) : this(filter) { this.editEntity = editEntity; nameTbx.Text = editEntity.operation_name; standartTbx.Text = editEntity.standart + ""; priceTbx.Text = editEntity.operation_price + ""; }
private void okBtn_Click(object sender, EventArgs e) { if (checkFields()) { if (editEntity == null) { ProductionStandart newEntity = new ProductionStandart(filter.department_id, filter.product_id, nameTbx.Text, Convert.ToInt32(standartTbx.Text), Convert.ToDouble(priceTbx.Text.Replace(".", ","))); standartsSet.addEntity(newEntity); MessageBox.Show("Норма выработки добавлена"); } else { editEntity.operation_name = nameTbx.Text; editEntity.standart = (Convert.ToInt32(standartTbx.Text)); editEntity.operation_price = (Convert.ToDouble(priceTbx.Text.Replace(".", ","))); standartsSet.editEntity(editEntity); MessageBox.Show("Норма выработки отредактирована"); } Close(); } }