private void mSMaterial_Click(object sender, EventArgs e) { FMaterial fMaterial = new FMaterial(); if (this.TopMost) fMaterial.TopMost = true; fMaterial.ShowDialog(); }
private void btnFindMaterial_Click(object sender, EventArgs e) { FMaterial fMaterial = new FMaterial(); fMaterial.OnSearchMode = true; fMaterial.ShowDialog(); if (fMaterial.OnSearchMode) { //Check if material exists on tempMaterial. bool finded = false; finded = Global.materialUsed.checkIfMaterialIsInTempTable(connString); if (!finded) { //Search for the image associated with the material used. Byte[] image = Global.materialUsed.loadImageForMatID(connString, Global.materialUsed.MatID); //Update value into data set. updateTempMaterial(connString, Global.materialUsed.MatID, Global.materialUsed.MatName, Global.materialUsed.MatModel, Global.materialUsed.MatBrand, image, -1); // Loads data into the 'trainITDataSet.TempMaterial' table. this.tempMaterialTableAdapter.Fill(this.trainITDataSet.TempMaterial); //Enable or disable the button to delete object from the tempMaterial. setModForMatOptions(); fMaterial.OnSearchMode = false; } else { MessageBox.Show("El material '" + Global.materialUsed.MatName + "' ya está incluido en la lista de materiales usados en la sesión."); } } }