private void gvDeleteContent_Click(object sender, EventArgs e) { try { if (gvContentDetails.FocusedRowHandle != null) { int IVlaue = 0; if (int.TryParse(Convert.ToString(gvContentDetails.GetFocusedRowCellValue("TextID")), out IVlaue)) { if (ObjEProposal == null) { ObjEProposal = new EProposal(); } ObjBProposal = new BProposal(); ObjBProposal.DeleteTextModuleAreas(ObjEProposal, IVlaue); cmbCategory_SelectionChangeCommitted(null, null); gvContentDetails.FocusedRowHandle = IVlaue; } } } catch (Exception ex) { Utility.ShowError(ex); } }
/// <summary> /// to save the entered data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { try { if (cmbCategory.Text == "") { throw new Exception("Bitte wähle Kategorie"); } if (string.IsNullOrEmpty(richEditControlContent.Text)) { throw new Exception("Bitte wähle Inhalt"); } if (ObjEProposal == null) { ObjEProposal = new EProposal(); } ParseTextModuleDetails(); ObjBProposal = new BProposal(); ObjBProposal.SaveTextModule(ObjEProposal); cmbCategory_SelectionChangeCommitted(null, null); // BindTextModuleGrid(); // Setfocus(gvContentDetails, "TextID", ObjEProposal.TextID); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnOk_Click(object sender, EventArgs e) { try { if (_ObjBProposal == null) { _ObjBProposal = new BProposal(); } _ObjBProposal.GetCategories(ObjEProposal, _TextID); if (ObjEProposal.dsCategory != null) { foreach (DataRow dr in ObjEProposal.dsCategory.Tables[0].Rows) { if (dr["CategoryName"].ToString() == txtCategory.Text.Trim()) { if (!Utility._IsGermany) { throw new Exception("Category already exist.!"); } else { throw new Exception("Diese Kategorie existiert berets.!"); } } } } _ObjEProposal.CategoryName = txtCategory.Text; _ObjBProposal.SaveCategory(_ObjEProposal, _TextID); this.Close(); } catch (Exception ex) { Utility.ShowError(ex); } }