public static void addProjectCat(ResoflexClientHandlingSystem.Role.ProjectCategory projectCat) { try { DBConnection.updateDB("insert into proj_category (cat_name) values ('" + projectCat.CategoryName + "')"); } catch (Exception exc) { MessageBox.Show("Error" + exc, "Project NOT added", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void metroButton1_Click(object sender, EventArgs e) { try { string categoryNAme = CatTxt.Text; ResoflexClientHandlingSystem.Role.ProjectCategory projectCat = new Role.ProjectCategory(projectCatId,categoryNAme); Database.addProjectCat(projectCat); MessageBox.Show("Successfully saved", " Project Catagory Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); closeForm(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Project Catagory Updating", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ProjectSubCategory(int projectSubCatId, ProjectCategory projectCat, string subCatName) { this.projectSubCatId = projectSubCatId; this.projectCat = projectCat; this.subCatName = subCatName; }