public static clsEvent parseEvent(string json) { clsResponse Response = parseResponse(json); clsEvent Event = JsonConvert.DeserializeObject <clsEvent>(Convert.ToString(Response.Data)); return(Event); }
public void saveEvent() { try { clsEvent ev = new clsEvent(); ev.Event_Title = txtEventTitle.Text; ev.Event_Description = txtEventDescription.Text; if (!string.IsNullOrEmpty(txtEventDate.Text)) ev.Event_Date = Convert.ToDateTime(txtEventDate.Text); ev.Organized_by = txtOrganizedBy.Text; if (fu1.HasFile) { string filename = Path.GetFileName(fu1.PostedFile.FileName); string path = "../images/" + filename; fu1.SaveAs(Server.MapPath("~/images/") + filename); ev.Event_Image = path; // Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('Image saved!')", true); } if (!string.IsNullOrEmpty(txtEventTitle.Text) && !string.IsNullOrEmpty(txtEventDescription.Text) && !string.IsNullOrEmpty(txtEventDate.Text) && !string.IsNullOrEmpty(txtOrganizedBy.Text)) { ev.addEvent(ev); bindEvents(); txtEventTitle.Text = ""; txtEventDescription.Text = ""; txtEventDate.Text = ""; txtOrganizedBy.Text = ""; } } catch (Exception ex) { } }
public void bindEvents() { clsEvent e = new clsEvent(); DataSet ds = e.listEvent(); gvEvent.DataSource = ds; gvEvent.DataBind(); }
private void BrnRemove_Click(object sender, EventArgs e) { try { if (dgvInvitesSent.SelectedRows.Count < 1) { MessageBox.Show("Por favor selecione pelo menos um evento"); return; } Int32 intQntRows = dgvInvitesSent.SelectedRows.Count; if (MessageBox.Show("Deseja remover o convite de " + intQntRows + " evento(s)?", "Aviso", MessageBoxButtons.YesNo) == DialogResult.Yes) { foreach (DataGridViewRow r in dgvInvitesSent.SelectedRows) { Int32 intIdEvent = Convert.ToInt32(r.Cells[0].Value); string strDescription = r.Cells[1].Value.ToString(); string strStartDatetime = r.Cells[2].Value.ToString(); string strFinalDatetime = r.Cells[3].Value.ToString(); string strAccessTo = r.Cells[5].Value.ToString(); clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); ev.DeleteInvitation(strAccessTo); } MessageBox.Show("Convite(s) excluido(s) com sucesso."); } PopulateDataGridView(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public bool addEvent(clsEvent e) { SqlParameter[] sp = new SqlParameter[5]; sp[0] = new SqlParameter("@Event_Title",e.Event_Title); sp[1] = new SqlParameter("@Event_Description", e.Event_Description); sp[2] = new SqlParameter("@Event_Date", e.Event_Date); sp[3] = new SqlParameter("@Organized_by", e.Organized_by); sp[4] = new SqlParameter("@Event_Image", e.Event_Image); return datalayer.Execute_NonQuery("sp_AddEvent", CommandType.StoredProcedure, sp); }
public string getEventInfo(int pintEventId) { clsEvent Event = new clsEvent(); clsResponse response = new clsResponse(); FacadeDA.geteventinfo(ref Event, ref response, pintEventId); response.Data = serializer.Serialize(Event); return(serializer.Serialize(response)); }
public frmEventInsertAlter(clsEvent ev) { InitializeComponent(); this.intIdEvent = ev.IntIdEvent; rtbDescription.Text = ev.StrDescription; dtpStartDate.Text = ev.StrStartDatetime.ToString(); dtpFinalDate.Text = ev.StrFinalDatetime.ToString(); mtbStartTime.Text = ev.StrStartDatetime.Substring(11, 5); mtbFinalTime.Text = ev.StrFinalDatetime.Substring(11, 5); }
public async Task <ActionResult> NewEvent(int userId, string EventTitle, string EventDate, string EventTime, bool EventType, string EventState, string EventLocation, string EventContent) { System.Diagnostics.Debug.WriteLine(userId); System.Diagnostics.Debug.WriteLine(EventTitle); System.Diagnostics.Debug.WriteLine(EventDate); System.Diagnostics.Debug.WriteLine(EventTime); System.Diagnostics.Debug.WriteLine(EventType); System.Diagnostics.Debug.WriteLine(EventState); System.Diagnostics.Debug.WriteLine(EventLocation); System.Diagnostics.Debug.WriteLine(EventContent); clsEvent form = new clsEvent(); form.Date = EventDate; form.Description = EventContent; form.IsConcert = EventType; form.State = EventState; form.Location = EventLocation; form.Time = EventTime; form.Date = EventDate; form.Title = EventTitle; string response = await clsBandRequests.getBandAlbums(userId); string response2 = await clsEventRequests.createEvent(userId, form); //Hubo error if (!ErrorParser.parse(response).Equals("")) { ViewBag.Message = "Something wrong with, create event"; } BandProfileViewModel profile = new BandProfileViewModel(); profile.Id = Int32.Parse(Session["Id"].ToString()); profile.Username = Session["Username"].ToString(); profile.Name = Session["Name"].ToString(); profile.Albums = DataParser.parseAlbums(response); int Id = DataParser.parseEventForm(response2); System.Diagnostics.Debug.WriteLine("Got id: " + Id); return(Json(new { redirectUrl = Url.Action("Index", "Events", new { userId = Int32.Parse(Session["Id"].ToString()), id = Id }), isRedirect = true })); }
public int createEvent(ref clsEvent pclsEvent, ref clsResponse pclsResponse, int pintUserCode) { int tmp = new int(); try { TimeSpan time = TimeSpan.Parse(pclsEvent.Time); DateTime dat = Convert.ToDateTime(pclsEvent.Date, CultureInfo.InvariantCulture); SqlCommand cmd = new SqlCommand("myFan.SP_IngresarEvento", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add("@strNombre", System.Data.SqlDbType.VarChar).Value = pclsEvent.Title; cmd.Parameters.Add("@strDescripcion", System.Data.SqlDbType.VarChar).Value = pclsEvent.Description; cmd.Parameters.Add("@strUbicacion", System.Data.SqlDbType.VarChar).Value = pclsEvent.Location; cmd.Parameters.Add("@btEsConcierto", System.Data.SqlDbType.Bit).Value = pclsEvent.IsConcert; cmd.Parameters.Add("@strEstado", System.Data.SqlDbType.VarChar).Value = pclsEvent.State; cmd.Parameters.Add("@intCodUsuario", System.Data.SqlDbType.Int).Value = pintUserCode; cmd.Parameters.Add("@dtFechaHora", System.Data.SqlDbType.DateTime).Value = dat + time; SqlParameter id = cmd.Parameters.Add("@intCodEvento", SqlDbType.Int); id.Direction = ParameterDirection.Output; SqlParameter message = cmd.Parameters.Add("@strMessageError", SqlDbType.VarChar, 256); message.Direction = ParameterDirection.Output; SqlParameter cod = cmd.Parameters.Add("@strCodError", SqlDbType.VarChar, 4); cod.Direction = ParameterDirection.Output; conn.Open(); cmd.ExecuteNonQuery(); tmp = Convert.ToInt32(id.Value); pclsResponse.Code = 0; pclsResponse.Message = "Done"; pclsResponse.Success = true; } catch (SqlException ex) { pclsResponse.Code = 1; pclsResponse.Success = false; pclsResponse.Message = ex.Message; } catch (Exception ex) { pclsResponse.Code = 2; pclsResponse.Success = false; pclsResponse.Message = ex.Message; } finally { conn.Close(); } return(tmp); }
public clsEvent DeserializeEvent(string pstringData) { clsEvent Event = new clsEvent(); dynamic data = JObject.Parse(pstringData); Event.Title = Convert.ToString(data.Title); Event.IsConcert = Convert.ToBoolean(data.IsConcert); Event.Description = Convert.ToString(data.Description); Event.Date = Convert.ToString(data.Date); Event.Location = Convert.ToString(data.Location); Event.Time = Convert.ToString(data.Time); Event.State = Convert.ToString(data.State); return(Event); }
public static void Main() { clsBandRead a = new clsBandRead(); clsResponse b = new clsResponse(); clsEvent d = new clsEvent(); Serializer r = new Serializer(); //a.geteventinfo(ref d,ref b,4); Console.WriteLine(r.Serialize(d)); Console.WriteLine(b.Message); Console.ReadKey(); }
private void BtnAlterEvent_Click(object sender, EventArgs e) { if (dgvEvent.SelectedRows.Count > 1) { MessageBox.Show("Por favor selecione apenas 1 evento"); return; } if (dgvEvent.SelectedRows.Count < 1) { MessageBox.Show("Por favor selecione pelo menos um evento"); return; } string strOwner = dgvEvent.SelectedRows[0].Cells[4].Value.ToString(); if (!clsClient.Instance.GetUser().Equals(strOwner)) { MessageBox.Show("Você não pode alterar um evento que não é seu."); return; } string strFinalDatetime = dgvEvent.SelectedRows[0].Cells[3].Value.ToString(); if (Convert.ToDateTime(strFinalDatetime) < DateTime.Now) { MessageBox.Show("Você não pode alterar um evento que já terminou."); return; } string strStartDatetime = dgvEvent.SelectedRows[0].Cells[2].Value.ToString(); if (Convert.ToDateTime(strStartDatetime) < DateTime.Now) { MessageBox.Show("Você não pode alterar um evento que já começou."); return; } Int32 intIdEvent = Convert.ToInt32(dgvEvent.SelectedRows[0].Cells[0].Value); string strDescription = dgvEvent.SelectedRows[0].Cells[1].Value.ToString(); clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); frmEventInsertAlter objEventInsertAlter = new frmEventInsertAlter(ev); objEventInsertAlter.ShowDialog(); PopulateDataGridView(); }
private void FillSeason() { clsEvent e = new clsEvent(); clsEventController ec = new clsEventController(); DataTable dt = new DataTable(); dt = ec.GetSeasonIDAndSeasonName(); if (dt.Rows.Count > 0) { ddlSeason.DataSource = dt; ddlSeason.DataTextField = "SeasonName"; ddlSeason.DataValueField = "SeasonID"; ddlSeason.DataBind(); ddlSeason.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillTeamMember() { clsEvent e = new clsEvent(); clsEventController ec = new clsEventController(); DataTable dt = new DataTable(); dt = ec.FillTeamMemberIDAndTeamMemberName(); if (dt.Rows.Count > 0) { ddlTeamMember.DataSource = dt; ddlTeamMember.DataTextField = "TeamMemberName"; ddlTeamMember.DataValueField = "TeamMemberID"; ddlTeamMember.DataBind(); ddlTeamMember.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillCompetition(int SportID) { clsEvent e = new clsEvent(); clsEventController ec = new clsEventController(); DataTable dt = new DataTable(); dt = ec.GetCompetitionIDAndCompetitionName(SportID); if (dt.Rows.Count > 0) { ddlCompetition.DataSource = dt; ddlCompetition.DataTextField = "CompetitionName"; ddlCompetition.DataValueField = "CompetitionId"; ddlCompetition.DataBind(); ddlCompetition.Items.Insert(0, new ListItem("-- Select Competition --", "0")); } }
private void FillTeam(int SportID, int ClubID) { clsEvent e = new clsEvent(); clsEventController ec = new clsEventController(); DataTable dt = new DataTable(); dt = ec.GetTeamIDAndTeamName(SportID, ClubID); if (dt.Rows.Count > 0) { ddlTeam.DataSource = dt; ddlTeam.DataTextField = "TeamName"; ddlTeam.DataValueField = "TeamId"; ddlTeam.DataBind(); ddlTeam.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillClubOwner(int ClubID) { clsEvent e = new clsEvent(); clsEventController ec = new clsEventController(); DataTable dt = new DataTable(); dt = ec.GetClubOwnerIDAndClubOwnerName(ClubID); if (dt.Rows.Count > 0) { ddlClubOwner.DataSource = dt; ddlClubOwner.DataTextField = "ClubOwnerName"; ddlClubOwner.DataValueField = "ClubOwnersId"; ddlClubOwner.DataBind(); ddlClubOwner.Items.Insert(0, new ListItem("-- Select --", "0")); } }
public void bindEvents() { clsEvent ev = new clsEvent(); DataSet ds = ev.listEvent(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { rpEvent.DataSource = ds; rpEvent.DataBind(); } else { rpEvent.Visible = false; } } }
public static async Task <string> createEvent(int userId, clsEvent form) { Serializer serializer = new Serializer(); string RequestBody = serializer.Serialize(form); clsRequest RequestObject = new clsRequest("-1", userId, RequestBody); HttpResponseMessage request = await clsHttpClient.getClient().PostAsJsonAsync("users/bands/" + userId + "/events", RequestObject); if (request.IsSuccessStatusCode) { string response = request.Content.ReadAsStringAsync().Result; return(await Task.FromResult(response)); } else { return(await Task.FromResult("Unexpected error ocurred")); } }
private void BtnInvite_Click(object sender, EventArgs e) { if (dgvEvent.SelectedRows.Count > 1) { MessageBox.Show("Por favor selecione apenas 1 evento"); return; } if (dgvEvent.SelectedRows.Count < 1) { MessageBox.Show("Por favor selecione pelo menos um evento"); return; } string strOwner = dgvEvent.CurrentRow.Cells[4].Value.ToString(); if (!clsClient.Instance.GetUser().Equals(strOwner)) { MessageBox.Show("Você não pode convidar alguém para um evento que não é seu"); return; } string strFinalDatetime = dgvEvent.SelectedRows[0].Cells[3].Value.ToString(); if (Convert.ToDateTime(strFinalDatetime) < DateTime.Now) { MessageBox.Show("Você não pode alterar um evento que já terminou."); return; } string strStartDatetime = dgvEvent.SelectedRows[0].Cells[2].Value.ToString(); if (Convert.ToDateTime(strStartDatetime) < DateTime.Now) { MessageBox.Show("Você não pode alterar um evento que já começou."); return; } Int32 intIdEvent = Convert.ToInt32(dgvEvent.CurrentRow.Cells[0].Value); string strDescription = dgvEvent.SelectedRows[0].Cells[1].Value.ToString(); clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); frmMakeInvitation objGiveAccess = new frmMakeInvitation(ev); objGiveAccess.ShowDialog(); }
public void geteventinfo(ref clsEvent pclsEvent, ref clsResponse pclsResponse, int pintEventCode) { try { SqlCommand cmd = new SqlCommand("myFan.SP_GetEvent", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add("@intCodEvent", System.Data.SqlDbType.Int).Value = pintEventCode; conn.Open(); SqlDataReader result = cmd.ExecuteReader(); while (result.Read()) { pclsEvent.Title = (result["Nombre"].ToString()); pclsEvent.Description = (result["strDescripcion"].ToString()); pclsEvent.IsConcert = Convert.ToBoolean(result["Concierto"].ToString()); DateTime dat = Convert.ToDateTime(result["Fecha"].ToString()); pclsEvent.Date = dat.ToString("yyyy-MM-dd"); pclsEvent.Time = dat.ToString("HH:mm:ss"); pclsEvent.State = (result["Estado"].ToString()); pclsEvent.Location = (result["Ubicacion"].ToString()); } pclsResponse.Code = 0; pclsResponse.Message = "Done"; pclsResponse.Success = true; } catch (SqlException ex) { pclsResponse.Code = 1; pclsResponse.Success = false; pclsResponse.Message = ex.Message; } catch (Exception ex) { pclsResponse.Code = 2; pclsResponse.Success = false; pclsResponse.Message = ex.Message; } finally { conn.Close(); } }
public string createEvent(string pstringRequest, int pintBandId) { clsRequest request = JsonConvert.DeserializeObject <clsRequest>(pstringRequest); clsEvent Event = DeserializeJson.DeserializeEvent(request.Data.ToString()); clsResponse response = new clsResponse(); if (request.Id == pintBandId) { Event.Id = FacadeDA.createEvent(ref Event, ref response, pintBandId); } Event.Title = null; Event.Description = null; Event.State = null; Event.Location = null; Event.IsConcert = false; Event.Title = null; response.Data = serializer.Serialize(Event); return(serializer.Serialize(response)); }
private void BtnSave_Click(object sender, EventArgs e) { try { clsDbConnection _db = clsDbConnection.Instance; string strStartDatetime = Convert.ToDateTime(dtpStartDate.Text).ToString("yyyy-MM-dd") + " " + mtbStartTime.Text + ":00"; string strFinalDatetime = Convert.ToDateTime(dtpFinalDate.Text).ToString("yyyy-MM-dd") + " " + mtbFinalTime.Text + ":00"; DateTime dttStart = Convert.ToDateTime(strStartDatetime); DateTime dttFinal = Convert.ToDateTime(strFinalDatetime); if (DateTime.Compare(dttStart, dttFinal) > 0) { MessageBox.Show("A data final deve vir cronologicamente depois da data inicial"); return; } if (DateTime.Compare(dttStart, dttFinal) == 0) { MessageBox.Show("As datas devem ser diferentes"); return; } if (_db.GetEventNumberByPeriodAndOwner(intIdEvent, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()) > 0) { MessageBox.Show("Já existem eventos cadastrados pra esse período, por favor selecione outro"); return; } string strDescription = rtbDescription.Text; clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); ev.CreateOrUpdateEventOnDb(); this.Close(); }catch (FormatException fEx) { MessageBox.Show("Data incorreta, por favor corrija e tente novamente"); }catch (Exception ex) { MessageBox.Show("Erro ao gerenciar evento: " + ex.Message); } }
private void BtnAccept_Click(object sender, EventArgs e) { try { if (dgvInvitesReceived.SelectedRows.Count < 1) { MessageBox.Show("Por favor selecione pelo menos um evento"); return; } if (dgvInvitesReceived.CurrentRow.Cells[5].Value.ToString().Equals("aceito")) { MessageBox.Show("Você já aceitou o convite deste evento"); return; } Int32 intQntRows = dgvInvitesReceived.SelectedRows.Count; if (MessageBox.Show("Deseja aceitar " + intQntRows + " evento(s)?", "Aviso", MessageBoxButtons.YesNo) == DialogResult.Yes) { foreach (DataGridViewRow r in dgvInvitesReceived.SelectedRows) { Int32 intIdEvent = Convert.ToInt32(r.Cells[0].Value); string strDescription = r.Cells[1].Value.ToString(); string strStartDatetime = r.Cells[2].Value.ToString(); string strFinalDatetime = r.Cells[3].Value.ToString(); clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); ev.AcceptInvite(clsClient.Instance.GetUser()); } MessageBox.Show("Convite(s) aceito(s) com sucesso."); } PopulateDataGridView(); }catch (Exception ex) { MessageBox.Show("Erro ao aceitar convite: " + ex.Message); } }
private void BtnDelEvent_Click(object sender, EventArgs e) { Int32 intQntRows = dgvEvent.SelectedRows.Count; foreach (DataGridViewRow r in dgvEvent.SelectedRows) { string strOwner = r.Cells[4].Value.ToString(); if (!clsClient.Instance.GetUser().Equals(strOwner)) { MessageBox.Show("Você não pode remover um evento que não é seu"); return; } } if (MessageBox.Show("Deseja remover " + intQntRows + " evento(s)?", "Aviso", MessageBoxButtons.YesNo) == DialogResult.Yes) { try { foreach (DataGridViewRow r in dgvEvent.SelectedRows) { Int32 intIdEvent = Convert.ToInt32(r.Cells[0].Value); string strDescription = dgvEvent.SelectedRows[0].Cells[1].Value.ToString(); string strStartDatetime = dgvEvent.SelectedRows[0].Cells[2].Value.ToString(); string strFinalDatetime = dgvEvent.SelectedRows[0].Cells[3].Value.ToString(); clsEvent ev = new clsEvent(intIdEvent, strDescription, strStartDatetime, strFinalDatetime, clsClient.Instance.GetUser()); ev.DeleteEventFromDb(); } PopulateDataGridView(); }catch (Exception ex) { MessageBox.Show("Erro ao deletar evento: " + ex.Message); } } }
protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { hdnEventID.Value = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionEventID")).Text; string ddlSelectedValue = ((DropDownList)sender).SelectedValue; if (ddlSelectedValue == "Edit") { funClearData(); FillSport(); FillSeason(); FillCompetition(); FillClub(); FillClubOwner(); FillClubMember(); FillTeam(); FillTeamMember(); FillSponsor(); LinkButton btn = sender as LinkButton; clsEvent cs = new clsEvent(); clsEventController csc = new clsEventController(); DataTable dt = new DataTable(); dt = csc.GetEventDataByEventID(eventID); if (dt.Rows.Count > 0) { hidRegID.Value = dt.Rows[0]["EventID"].ToString(); ddlSports.SelectedValue = dt.Rows[0]["SportsId"].ToString(); ddlSeason.SelectedValue = dt.Rows[0]["SeasonId"].ToString(); ddlCompetition.SelectedValue = dt.Rows[0]["CompetitionId"].ToString(); ddlClub.SelectedValue = dt.Rows[0]["ClubId"].ToString(); ddlClubOwner.SelectedValue = dt.Rows[0]["ClubOwnersId"].ToString(); ddlClubMember.SelectedValue = dt.Rows[0]["ClubMemberId"].ToString(); ddlTeam.SelectedValue = dt.Rows[0]["TeamId"].ToString(); ddlTeamMember.SelectedValue = dt.Rows[0]["TeamMemberId"].ToString(); ddlSponsor.SelectedValue = dt.Rows[0]["SponsorId"].ToString(); txtEventName.Text = dt.Rows[0]["EventName"].ToString(); txtEventDetail.Text = dt.Rows[0]["EventDetail"].ToString(); txtEventStartDateTime.Text = dt.Rows[0]["EventStartDateTime"].ToString(); txtEventEndDateTime.Text = dt.Rows[0]["EventEndDateTime"].ToString(); if (dt.Rows[0]["EventActive"].ToString() == "1") { ChkIsActive.Checked = true; } else { ChkIsActive.Checked = false; } ddlEventPriority.SelectedValue = dt.Rows[0]["EventPriority"].ToString(); pnlEventEntry.Visible = true; PnlGridEvent.Visible = false; btnUpdateEvent.Visible = true; btnSaveEvent.Visible = false; } } else if (ddlSelectedValue == "Delete") { //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "javascript:confirm('Are You Sure? Want To Delete.');", true); //Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "javascript:Confirmation();", true); //int competition_Id = 0; //int.TryParse(str, out competition_Id); //CompRegInfo.DeleteCompetitionReg(competition_Id); //FillGridView(); if (csc.IsEventHasOtherData(eventID).Rows[0]["RefData"].ToString() != "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "DeleteConfirm('" + "Delete" + "');;", true); } else { DeleteEvent(); } } }
public void geteventinfo(ref clsEvent pclsEvent, ref clsResponse pclsResponse, int pintEventCode) { EventsRead.geteventinfo(ref pclsEvent, ref pclsResponse, pintEventCode); }
public int createEvent(ref clsEvent pclsEvent, ref clsResponse pclsResponse, int pintUserCode) { return(EventsWrite.createEvent(ref pclsEvent, ref pclsResponse, pintUserCode)); }
public frmMakeInvitation(clsEvent ev) { InitializeComponent(); this.ev = ev; }