protected void ButtonSubmit_Click(object sender, EventArgs e) { if (DropDownListEventID.Text != "") { int i = 0; try { Guid pesid = Guid.NewGuid(); i = PesertaControl.InsertPeserta(new Peserta(pesid, TextBoxNamaPeserta.Text, TextBoxUmur.Text, RadioButtonListGender.Text, DropDownListDesa.Text, TextBoxKelompok.Text, DropDownListFestival.Text)); var festiDetails = FestivalControl.getFestivalDetailList(DropDownListFestival.Text); if (festiDetails != null) { List <EventFassDetail> evFassDet = new List <EventFassDetail>(); foreach (FestivalDetail a in festiDetails) { evFassDet.Add(new EventFassDetail(Guid.Parse(DropDownListEventID.Text), pesid, a.festivalID, a.poinID, 0)); } int j = EventFassControl.InsertEvent(evFassDet); if (j > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('Data telah disimpan');", true); } clearField(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('" + ex.Message + "');", true); } } }
void BindGridViewPeserta(FestivalClass f, Guid evID) { var pesertaList = EventFassControl.getPesertaListByFestival(f, evID); GridViewPeserta.DataSource = pesertaList; GridViewPeserta.DataBind(); }
void BindGridViewPoin(EventFassDetailParent ev) { var poinList = EventFassControl.getPoinPenilaianByPeserta(ev); GridViewScoring.DataSource = poinList; GridViewScoring.DataBind(); }
protected void GridViewScoring_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { TextBox TextScore = (TextBox)GridViewScoring.Rows[e.RowIndex].FindControl("TextBoxScore"); Double score; if (Double.TryParse(TextScore.Text, out score)) { Guid EventID = Guid.Parse(GridViewScoring.DataKeys[e.RowIndex][0].ToString()); string FestivalID = GridViewScoring.DataKeys[e.RowIndex][1].ToString(); Guid PesertaID = Guid.Parse(GridViewScoring.DataKeys[e.RowIndex][2].ToString()); int PoinID = Int32.Parse(GridViewScoring.DataKeys[e.RowIndex][3].ToString()); int i = EventFassControl.UpdateScore(new EventFassDetail(EventID, PesertaID, FestivalID, PoinID, score)); if (i > 0) { GridViewScoring.EditIndex = -1; BindGridViewPoin(new EventFassDetailParent(Guid.Parse(GridViewPeserta.SelectedDataKey[0].ToString()), Guid.Parse(GridViewPeserta.SelectedDataKey[2].ToString()), GridViewPeserta.SelectedDataKey[1].ToString())); BindGridViewPeserta(new FestivalClass(GridViewFestival.SelectedDataKey[0].ToString()), Guid.Parse(DropDownListEventID.Text)); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('Data telah disimpan');", true); BindGridViewDesaScore(Guid.Parse(DropDownListEventID.Text)); } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('" + ex.Message + "');", true); } }
void BindDDLEvent() { var eventlist = EventFassControl.getEventList(); DropDownListEventID.DataSource = eventlist; DropDownListEventID.DataTextField = "namaEvent"; DropDownListEventID.DataValueField = "EventID"; DropDownListEventID.DataBind(); }
protected void ButtonSubmit_Click(object sender, EventArgs e) { try { int i = EventFassControl.InsertEvent(new EventFass(Guid.NewGuid(), DateTime.Now, false, TextBoxEventID.Text)); BindDDLEvent(); BindGridViewDesaScore(Guid.Parse(DropDownListEventID.Text)); PilihEvent.Visible = true; PanelBuatEvent.Visible = false; ButtonGo.Visible = true; if (i > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('Data telah disimpan');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "showPop('" + ex.Message + "');", true); } }