private void btnAddMaterial_Click(object sender, System.EventArgs e) { OrganizationMaterial organizationMaterial = new OrganizationMaterial { OrganizationId = this.m_Organization.Id }; new OrganizationAddMaterial(organizationMaterial).ShowDialog(); this.UpdateBindingSourceOrganizationMaterials(); }
private void btnChangeMaterial_Click(object sender, System.EventArgs e) { OrganizationMaterial organizationMaterial = new OrganizationMaterial(); organizationMaterial = this.orgMaterialBindingSource.get_Current() as OrganizationMaterial; if (organizationMaterial != null) { new OrganizationAddMaterial(organizationMaterial).ShowDialog(); this.UpdateBindingSourceOrganizationMaterials(); } }
public OrganizationAddMaterial(OrganizationMaterial organizationMaterial) { this.InitializeComponent(); this.orgMaterial = organizationMaterial; }
private void btnDeleteMaterial_Click(object sender, System.EventArgs e) { OrganizationMaterial material = new OrganizationMaterial(); material = this.orgMaterialBindingSource.get_Current() as OrganizationMaterial; if ((material != null) && (System.Windows.Forms.MessageBox.Show("Вы действительно хотите удалить? ", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.No)) { material.Delete(); material.SaveChanges(); this.UpdateBindingSourceOrganizationMaterials(); } }