protected void btnSave_ServerClick(object sender, EventArgs e) { try { List<CurrentEventReport> cabListModel = new List<CurrentEventReport>(); CurrentEventReportViewModel _CurrentEventReportViewModel = new CurrentEventReportViewModel(); cabListModel = _CurrentEventReportViewModel.GetAllEventReport(txtEventDate.Value, txtEventDate.Value, ddEventList.SelectedItem.Value); gvTransactionDetails.DataSource = cabListModel; gvTransactionDetails.DataBind(); } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["SVenue"] != null) { if (!IsPostBack) { GetVenueDetails(); List<CurrentEventReport> cabListModel = new List<CurrentEventReport>(); CurrentEventReportViewModel _CurrentEventReportViewModel = new CurrentEventReportViewModel(); cabListModel = _CurrentEventReportViewModel.GetAllEventReport("01/OCt/2013", "01/OCt/2013", "1111"); gvTransactionDetails.DataSource = cabListModel; gvTransactionDetails.DataBind(); } string parameter = Request["__EVENTARGUMENT"]; // parameter if (Request["__EVENTTARGET"] == "GetEvents") { GetEvent(parameter); } } else { ClientScript.RegisterStartupScript(this.GetType(), "scriptid", "window.parent.location.href='/SessionExpire.aspx'", true); Response.Redirect("/SessionExpire.aspx", false); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { ErrHandler.WriteError(ex.Message); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script language='javascript'>"); sb.Append(@"alert('Error : " + ex.Message + "')"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false); } }