protected void GrdViewSerEntry_RowDeleted(object sender, GridViewDeletedEventArgs e) { try { if (e.Exception == null) { GrdViewSerEntry.DataBind(); } else { if (e.Exception.InnerException != null) { StringBuilder script = new StringBuilder(); script.Append("You are not allowed to Update this record. Please contact Supervisor."); if (e.Exception.InnerException != null) { if (e.Exception.InnerException.Message.IndexOf("Invalid Date") == -1) { ((Label)this.frmViewAdd.FindControl("lblError")).Text = script.ToString(); } //ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Exception Occured : " + e.Exception.InnerException.Message + "');", true); } } } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnSearch_Click(object sender, EventArgs e) { try { GrdViewSerEntry.DataBind(); } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void frmViewAdd_ItemInserted(object sender, FormViewInsertedEventArgs e) { try { if (e.Exception == null) { lnkBtnAdd.Visible = true; frmViewAdd.Visible = false; System.Threading.Thread.Sleep(1000); GrdViewSerEntry.DataBind(); //MyAccordion.Visible = true; GrdViewSerEntry.Visible = true; ModalPopupExtender2.Hide(); } else { StringBuilder script = new StringBuilder(); //script.Append("alert('You are not allowed to Update this record. Please contact Supervisor.');"); script.Append("You are not allowed to Update this record. Please contact Supervisor."); if (e.Exception.InnerException != null) { if (e.Exception.InnerException.Message.IndexOf("Invalid Date") == -1) { ((Label)this.frmViewAdd.FindControl("lblError")).Text = script.ToString(); } //ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Exception Occured : " + e.Exception.InnerException.Message + "');", true); } e.KeepInInsertMode = true; e.ExceptionHandled = true; lnkBtnAdd.Visible = false; frmViewAdd.Visible = true; } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }