protected void Button2_Click(object sender, EventArgs e) { Kontekstas test = new Kontekstas(conString); test.EditVeisle(TextBox1.Text, int.Parse(TextBox2.Text), TextBox3.Text, DropDownList1.SelectedValue); Server.Transfer("VeisleList.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Kontekstas test = new Kontekstas(conString); #region savininkai savininkaiList = test.GetSavininkas(); List <long> savId = new List <long>(); foreach (Savininkas sav in savininkaiList) { savId.Add(sav.id); } DropDownList1.DataSource = savId; DropDownList1.DataBind(); #endregion #region Veterk arak veterinraiList = test.GetVeterinaras(); List <int> vetId = new List <int>(); foreach (Veterinaras vet in veterinraiList) { vetId.Add(vet.kodas); } DropDownList2.DataSource = vetId; DropDownList2.DataBind(); #endregion } }
protected void Button2_Click(object sender, EventArgs e) { Kontekstas test = new Kontekstas(conString); test.EditRegistracija(int.Parse(TextBox1.Text), DateTime.Parse(TextBox2.Text), TextBox3.Text, long.Parse(DropDownList1.SelectedValue), int.Parse(DropDownList2.SelectedValue)); Server.Transfer("RegistracijosList.aspx"); }
protected void Button2_Click(object sender, EventArgs e) { Kontekstas test = new Kontekstas(conString); test.EditSavininkas(long.Parse(TextBox1.Text), TextBox2.Text, TextBox3.Text, int.Parse(TextBox4.Text), TextBox5.Text, DateTime.Parse(TextBox6.Text), int.Parse(DropDownList1.SelectedValue), int.Parse(DropDownList2.SelectedValue)); Server.Transfer("SavininkaiList.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { try { Kontekstas test = new Kontekstas(conString); if (String.IsNullOrEmpty(TextBox_Vardas.Text)) { throw new Exception("Tuscias vardo laukelis"); } string vardas = TextBox_Vardas.Text; if (String.IsNullOrEmpty(TextBox1.Text)) { throw new Exception("Tuscias datos laukelis"); } DateTime db = Convert.ToDateTime(TextBox1.Text).Date; int lytis = int.Parse(DropDownList1.SelectedValue); long savininkas = long.Parse(DropDownList2.SelectedValue); int isvaizda = int.Parse(DropDownList3.SelectedValue); DateTime vizitoData = DateTime.Parse(DropDownList4.SelectedValue).Date; int mikro = int.Parse(DropDownList5.SelectedValue); int reg = int.Parse(DropDownList6.SelectedValue); string veisle = DropDownList7.SelectedValue; test.AddGyvunas(vardas, db, lytis, savininkas, isvaizda, veisle, vizitoData, mikro, reg); } catch (Exception exception) { Label8.Text = exception.Message; return; } Server.Transfer("GyvunaiList.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <Registracija> bandymas = (List <Registracija>)Session["ArrayRegistracijos"]; int edit = (int)Session["editId"]; TextBox1.Text = bandymas[edit].numeris.ToString(); TextBox2.Text = bandymas[edit].data.ToShortDateString(); TextBox3.Text = bandymas[edit].vieta; Kontekstas test = new Kontekstas(conString); List <Savininkas> savininkai = test.GetSavininkas(); List <long> id = new List <long>(); foreach (Savininkas sav in savininkai) { id.Add(sav.id); } DropDownList1.DataSource = id; DropDownList1.DataBind(); DropDownList1.SelectedValue = bandymas[edit].savininko_id.ToString(); List <Veterinaras> veterinarai = test.GetVeterinaras(); List <int> idv = new List <int>(); foreach (Veterinaras vet in veterinarai) { idv.Add(vet.kodas); } DropDownList2.DataSource = idv; DropDownList2.DataBind(); DropDownList2.SelectedValue = bandymas[edit].veterinaras_id.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Kontekstas test = new Kontekstas(conString); #region lytys lytysList = test.GetLytis(); Dictionary <int, string> lytys = new Dictionary <int, string>(); foreach (Lytis lytis in lytysList) { lytys.Add(lytis.id, lytis.name); } DropDownList1.DataSource = lytys; DropDownList1.DataTextField = "Value"; DropDownList1.DataValueField = "Key"; DropDownList1.DataBind(); #endregion #region adresau=i adresaiList = test.GetAdresas(); Dictionary <int, string> adresai = new Dictionary <int, string>(); foreach (Adresas adresas in adresaiList) { adresai.Add(adresas.id_adresas, adresas.gatve + " " + adresas.buto_nr); } DropDownList2.DataSource = adresai; DropDownList2.DataTextField = "Value"; DropDownList2.DataValueField = "Key"; DropDownList2.DataBind(); #endregion } }
private void updateTable() { Kontekstas test = new Kontekstas(conString); testas = test.GetAA1(); GridView1.DataSource = testas; GridView1.DataBind(); }
public void UpdateTable() { Kontekstas test = new Kontekstas(conString); testas = test.GetAnimalsIn2018(); GridView1.DataSource = testas; GridView1.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { Kontekstas test = new Kontekstas(conString); test.EditGyvunas(TextBox1.Text, DateTime.Parse(TextBox2.Text), int.Parse(DropDownList1.SelectedValue), long.Parse(DropDownList2.SelectedValue), int.Parse(DropDownList3.SelectedValue), DropDownList4.SelectedValue, DateTime.Parse(DropDownList5.SelectedValue), int.Parse(DropDownList6.Text), int.Parse(DropDownList7.SelectedValue)); Server.Transfer("GyvunaiList.aspx"); }
public void showRegistracija() { Kontekstas test = new Kontekstas(conString); testas = test.GetRegistracija(); Session["ArrayRegistracijos"] = testas; gvMysql.DataSource = testas; gvMysql.DataBind(); }
public void showVeisles() { Kontekstas test = new Kontekstas(conString); testas = test.GetVeisle(); Session["ArrayVeisles"] = testas; gvMysql.DataSource = testas; gvMysql.DataBind(); }
public void showSavininkai() { Kontekstas test = new Kontekstas(conString); testas = test.GetSavininkas(); Session["ArraySavininkai"] = testas; gvMysql.DataSource = testas; gvMysql.DataBind(); }
public void ShowKlases() { Kontekstas test = new Kontekstas(conString); testas = test.GetKlase(); Session["ArrayKlase"] = testas; gvMysql.DataSource = testas; gvMysql.DataBind(); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { List <Veisle> bandymas = (List <Veisle>)Session["ArrayVeisles"]; Kontekstas test = new Kontekstas(conString); test.RemoveVeisle(bandymas[e.RowIndex].pavadinimas); showVeisles(); Label2.Text = "Pašalintas elementas indeksu: " + e.RowIndex; }
protected void Button2_Click(object sender, EventArgs e) { Kontekstas test = new Kontekstas(conString); string pav = TextBox1.Text; string tip = TextBox2.Text; string potip = TextBox3.Text; test.EditKlase(pav, tip, potip); Server.Transfer("KlaseList.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { try { Kontekstas test = new Kontekstas(conString); test.AddKlase(TextBox1.Text, TextBox2.Text, TextBox3.Text); } catch (Exception exception) { Label5.Text = exception.Message; return; } Server.Transfer("KlaseList.aspx"); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { List <Savininkas> bandymas = (List <Savininkas>)Session["ArraySavininkai"]; Kontekstas test = new Kontekstas(conString); test.RemoveSavininkas(bandymas[e.RowIndex].id); } catch (Exception exception) { Label2.Text = exception.Message; return; } showSavininkai(); Label2.Text = "Pašalintas elementas indeksu: " + e.RowIndex; }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { List <Registracija> bandymas = (List <Registracija>)Session["ArrayRegistracijos"]; Kontekstas test = new Kontekstas(conString); test.RemoveRegistracija(bandymas[e.RowIndex].numeris); } catch (Exception exception) { Label2.Text = exception.Message; return; } showRegistracija(); Label2.Text = "Pašalintas elementas indeksu: " + e.RowIndex; }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { List <Klase> bandymas = (List <Klase>)Session["ArrayKlase"]; Kontekstas test = new Kontekstas(conString); test.RemoveKlase(bandymas[e.RowIndex].Pavadinimas); } catch (Exception exception) { Label2.Text = exception.Message; return; } ShowKlases(); Label2.Text = "Pašalintas elementas indeksu: " + e.RowIndex; }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { List <Gyvunas> bandymas = (List <Gyvunas>)Session["ArrayGyvunai"]; Kontekstas test = new Kontekstas(conString); test.RemoveGyvunas(bandymas[e.RowIndex].vardas, bandymas[e.RowIndex].gimimo_data); } catch (Exception exception) { Label2.Text = exception.Message; return; } Label2.Text = "Pašalintas elementas indeksu: " + e.RowIndex; showKlases(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Kontekstas test = new Kontekstas(conString); #region Klase klaseList = test.GetKlase(); List <string> klases = new List <string>(); foreach (Klase klas in klaseList) { klases.Add(klas.Pavadinimas); } DropDownList1.DataSource = klases; DropDownList1.DataBind(); #endregion } }
public void UpdateTable() { try { Kontekstas test = new Kontekstas(conString); string vieta = DropDownList1.SelectedValue; DateTime from = DateTime.Parse(TextBox1.Text); DateTime to = DateTime.Parse(TextBox2.Text); testas = test.GetAnimalsInPlace(vieta, from, to); GridView1.DataSource = testas; GridView1.DataBind(); } catch (Exception exception) { Label5.Text = exception.Message; return; } }
protected void Button1_Click(object sender, EventArgs e) { try { Kontekstas test = new Kontekstas(conString); string kilmes_salis = TextBox_Vardas.Text; int gyv_trukme = int.Parse(TextBox1.Text); string pavadinimas = TextBox2.Text; string klase = DropDownList1.SelectedValue; test.AddVeisle(kilmes_salis, gyv_trukme, pavadinimas, klase); } catch (Exception exception) { Label3.Text = exception.Message; return; } Server.Transfer("VeisleList.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Kontekstas test = new Kontekstas(conString); List <Registracija> Registracijos = test.GetRegistracija(); List <String> vietos = new List <string>(); foreach (Registracija reg in Registracijos) { if (!vietos.Contains(reg.vieta)) { vietos.Add(reg.vieta); } } DropDownList1.DataSource = vietos; DropDownList1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { try { Kontekstas test = new Kontekstas(conString); int numeris = int.Parse(TextBox_Vardas.Text); DateTime data = DateTime.Parse(TextBox1.Text); string vieta = TextBox2.Text; long sav_id = long.Parse(DropDownList1.SelectedValue); int vet_id = int.Parse(DropDownList2.SelectedValue); test.AddRegistracija(numeris, data, vieta, sav_id, vet_id); } catch (Exception exception) { Label9.Text = exception.Message; return; } Server.Transfer("RegistracijosList.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <Veisle> bandymas = (List <Veisle>)Session["ArrayVeisles"]; int edit = (int)Session["editId"]; TextBox1.Text = bandymas[edit].kilmes_salis; TextBox2.Text = bandymas[edit].gyvenimo_trukme.ToString(); TextBox3.Text = bandymas[edit].pavadinimas; Kontekstas test = new Kontekstas(conString); List <Klase> klases = test.GetKlase(); List <string> klasespav = new List <string>(); foreach (Klase klase in klases) { klasespav.Add(klase.Pavadinimas); } DropDownList1.DataSource = klasespav; DropDownList1.DataBind(); DropDownList1.SelectedIndex = edit; } }
protected void Button1_Click(object sender, EventArgs e) { try { Kontekstas test = new Kontekstas(conString); long id = long.Parse(TextBox_Vardas.Text); string vardas = TextBox1.Text; string pavarde = TextBox2.Text; int numeris = int.Parse(TextBox3.Text); string email = TextBox4.Text; DateTime data = DateTime.Parse(TextBox5.Text); int lytis = int.Parse(DropDownList1.SelectedValue); int adresas = int.Parse(DropDownList2.SelectedValue); test.AddSavininkas(id, vardas, pavarde, numeris, email, data, lytis, adresas); } catch (Exception exception) { Label3.Text = exception.Message; return; } Server.Transfer("SavininkaiList.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <Savininkas> bandymas = (List <Savininkas>)Session["ArraySavininkai"]; int edit = (int)Session["editId"]; TextBox1.Text = bandymas[edit].id.ToString(); TextBox2.Text = bandymas[edit].vardas; TextBox3.Text = bandymas[edit].pavarde; TextBox4.Text = bandymas[edit].numeris.ToString(); TextBox5.Text = bandymas[edit].email; TextBox6.Text = bandymas[edit].gimimo_data.ToShortDateString(); Kontekstas test = new Kontekstas(conString); List <Lytis> lytysList = test.GetLytis(); Dictionary <int, string> lytys = new Dictionary <int, string>(); foreach (Lytis lytis in lytysList) { lytys.Add(lytis.id, lytis.name); } DropDownList1.DataSource = lytys; DropDownList1.DataTextField = "Value"; DropDownList1.DataValueField = "Key"; DropDownList1.DataBind(); DropDownList1.SelectedIndex = edit; List <Adresas> adresaiList = test.GetAdresas(); Dictionary <int, string> adresai = new Dictionary <int, string>(); foreach (Adresas adresas in adresaiList) { adresai.Add(adresas.id_adresas, adresas.gatve + " " + adresas.buto_nr); } DropDownList2.DataSource = adresai; DropDownList2.DataTextField = "Value"; DropDownList2.DataValueField = "Key"; DropDownList2.DataBind(); DropDownList2.SelectedValue = bandymas[edit].adresas_id.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <Gyvunas> bandymas = (List <Gyvunas>)Session["ArrayGyvunai"]; int edit = (int)Session["editId"]; TextBox1.Text = bandymas[edit].vardas; TextBox2.Text = bandymas[edit].gimimo_data.ToShortDateString(); Kontekstas test = new Kontekstas(conString); #region lytys lytysList = test.GetLytis(); Dictionary <int, string> lytys = new Dictionary <int, string>(); foreach (Lytis lytis in lytysList) { lytys.Add(lytis.id, lytis.name); } DropDownList1.DataSource = lytys; DropDownList1.DataTextField = "Value"; DropDownList1.DataValueField = "Key"; DropDownList1.DataBind(); DropDownList1.SelectedValue = bandymas[edit].lytis_id.ToString(); #endregion #region savininkai savininkaiList = test.GetSavininkas(); List <long> savId = new List <long>(); foreach (Savininkas sav in savininkaiList) { savId.Add(sav.id); } DropDownList2.DataSource = savId; DropDownList2.DataBind(); DropDownList2.SelectedValue = bandymas[edit].savininko_kodas.ToString(); #endregion #region isvaizda isvaizdaList = test.GetIsvaizda(); List <int> isvId = new List <int>(); foreach (Isvaizda isv in isvaizdaList) { isvId.Add(isv.id); } DropDownList3.DataSource = isvId; DropDownList3.DataBind(); DropDownList3.SelectedValue = bandymas[edit].fk_Isvaizda_id.ToString(); #endregion #region mikroschema mikrosList = test.GetMikro(); List <int> mikroList = new List <int>(); foreach (Mikro mik in mikrosList) { mikroList.Add(mik.numeris); } DropDownList6.DataSource = mikroList; DropDownList6.DataBind(); DropDownList6.SelectedValue = bandymas[edit].fk_micro_id.ToString(); #endregion #region registracija regList = test.GetRegistracija(); List <int> registNr = new List <int>(); foreach (Registracija reg in regList) { registNr.Add(reg.numeris); } DropDownList7.DataSource = registNr; DropDownList7.DataBind(); DropDownList7.SelectedValue = bandymas[edit].fk_reg_id.ToString(); #endregion #region sveikata sveikList = test.GetSveikata(); List <DateTime> datuList = new List <DateTime>(); foreach (Sveikata sveik in sveikList) { datuList.Add(sveik.Vizito_data.Date); } DropDownList5.DataSource = datuList; DropDownList5.DataBind(); DropDownList5.SelectedValue = bandymas[edit].fk_vet_viz.ToShortDateString(); #endregion #region veisle veislList = test.GetVeisle(); List <string> veisles = new List <string>(); foreach (Veisle veis in veislList) { veisles.Add(veis.pavadinimas); } DropDownList4.DataSource = veisles; DropDownList4.DataBind(); DropDownList4.SelectedValue = bandymas[edit].fk_veisle; #endregion } }