private void BtnDeleteFrame_Click(object sender, EventArgs e) { try { technovisionDataSetTableAdapters.framesTableAdapter t = new technovisionDataSetTableAdapters.framesTableAdapter(); t.DeleteByID(int.Parse(GridFrame.SelectedRows[0].Cells[0].Value.ToString())); this.framesTableAdapter.Fill(this.technovisionDataSet.frames); CommonFunctions.WriteUserLog(Session.Username, "Deleted Frame" + GridFrame.SelectedRows[0].Cells[1].Value.ToString()); CommonFunctions.ShowSuccess(this, "Frame Deleted Successfully..."); } catch (Exception ex) { CommonFunctions.ShowError(this, "Nothing To Delete Or Not Selected..."); CommonFunctions.WriteToErrorLog(ex.Message.ToString()); } }
private void BtnAddFrame_Click(object sender, EventArgs e) { try { if (TxtAddFrame.Text == "") { CommonFunctions.ShowError(this, "Please Enter Value In Textbox..."); } else { technovisionDataSetTableAdapters.framesTableAdapter t = new technovisionDataSetTableAdapters.framesTableAdapter(); t.Insert(TxtAddFrame.Text); this.framesTableAdapter.Fill(this.technovisionDataSet.frames); CommonFunctions.ShowSuccess(this, "New Frame Saved Successfully..."); TxtAddFrame.Text = ""; CommonFunctions.WriteUserLog(Session.Username, "Added new Frame" + TxtAddFrame.Text); } } catch (Exception ex) { CommonFunctions.WriteToErrorLog(ex.Message.ToString()); } }