//protected void btnDeleteFuturePeriod_Click(object sender, System.EventArgs e) //{ // // Delete future period // int EventID; // try // { // EventID = int.Parse(Session["EventID"].ToString()); // } // catch // { // EventID = -1; // } // BusinessServices.Event objEvent = new BusinessServices.Event(); // objEvent.DeleteFuturePeriod(EventID); // Response.Redirect(@"\Administration\CPD\cpdeventdefault.aspx"); //} private void BindEventType() { int OrganisationID = UserContext.UserData.OrgID; BusinessServices.Event objEvent = new BusinessServices.Event(); DataTable dtPolicyPoints = objEvent.GetEventType(OrganisationID); if (dtPolicyPoints.Rows.Count > 0) //No policies exist - hide relevant controls and display message { ddlEventType.DataSource = dtPolicyPoints; ddlEventType.DataValueField = "EventTypeId"; ddlEventType.DataTextField = "EventTypeName"; ddlEventType.DataBind(); } }
protected void EventType() { BusinessServices.Event objEvent = new BusinessServices.Event(); int PageSize = ApplicationSettings.PageSize; this.gvImage.PageSize = PageSize; int OrganisationID = UserContext.UserData.OrgID; DataTable dtPolicyPoints = objEvent.GetEventType(OrganisationID); if (dtPolicyPoints.Rows.Count > 0) { gvImage.DataSource = dtPolicyPoints; gvImage.DataBind(); } }
protected void btnSave_Click(object sender, System.EventArgs e) { lblMessage.Text = ""; if (Page.IsValid) { if (txtEventTypeName.Text.ToString().Trim() != "") { BusinessServices.Event objEvent = new BusinessServices.Event(); int OrganisationID = UserContext.UserData.OrgID; DataTable dtEventType = objEvent.GetEventType(txtEventTypeName.Text.ToString().Trim(), OrganisationID); if (dtEventType.Rows.Count > 0) { lblMessage.Text = ResourceManager.GetString("EventExists"); } else { objEvent.AddEventType(txtEventTypeName.Text.ToString().Trim(), OrganisationID, Convert.ToInt32(cboStatus.SelectedValue)); EventType(); lblMessage.Text = ResourceManager.GetString("SaveSuccess"); } } } }