public Form1() { #region enchegar db = new VeterianEntities(); Debug.AutoFlush = true; InitializeComponent(); CBTipoAnimal.Items.Add("default"); setCBTipoAnimal(); DTPtimeToday(); CBTipoAnimal.SelectedIndex = CBTipoAnimal.FindStringExact("default"); logs.crearLog("inicio correcto"); //UltraGrid1 ug = new #endregion #region chequeoDB using (VeterianEntities db2 = new VeterianEntities()) { var queryVet1 = (from p in db2.PET where p.PetName == "kira" select new { PetType = p.PetType }).FirstOrDefault(); Console.WriteLine("PreChequeoQueryVet1 = {0}", queryVet1.PetType); MessageBox.Show("PreChequeoQueryVet1 = " + queryVet1.PetType); Debug.WriteLine("PreChequeoDebug--queryVet1 = " + queryVet1.PetType); Trace.WriteLine("PreChequeoTrace--queryVet1 = " + queryVet1.PetType); } #endregion }
private void nuIdMascotas_ValueChanged(object sender, EventArgs e) { //obetenrmos valores de SQL ed.getSQLDatePET(ref db, ref listaMascotas, ref arrayPets); #region ObtencionMAXNUFromDDBB //valor maximo registros decimal numeroMascotas = arrayPets.Length; Debug.WriteLine("numeroMascotas: " + numeroMascotas); nuIdMascotas.Maximum = numeroMascotas; int max = (int)numeroMascotas; #endregion int valor = Convert.ToInt16(nuIdMascotas.Value); Debug.WriteLine("valor: " + valor); Debug.Write("BottonPruebasArrray: "); foreach (PET item in arrayPets) { if (valor == item.PetID) { Debug.Write(" " + item.PetBreed.ToString().Trim()); tbRaza.Text = item.PetBreed.ToString().Trim(); tbNombre.Text = item.PetName.ToString().Trim(); CBTipoAnimal.SelectedIndex = CBTipoAnimal.FindStringExact(item.PetType.ToString().Trim()); //myDate = item.PetDOB; DTPFechaNacimiento.CustomFormat = "dd-MM-yyy"; DTPFechaNacimiento.Format = DateTimePickerFormat.Custom; DTPFechaNacimiento.Value = item.PetDOB.Value; #region pruebaFallidaautomatizacioncarga /* * extraNom1 en= delegate (string j) * { * j = item.PetName.ToString().Trim(); * }; */ #endregion /* * extraNom1 en= delegate (string j) * { * j = item.PetName.ToString().Trim(); * }; */ } } Debug.WriteLine(""); }
private void btClear_Click(object sender, EventArgs e) { tbNombre.Text = "foo"; tbRaza.Text = "bar"; nuAmo.Value = 99; nuIdMascotas.Value = 15; CBTipoAnimal.SelectedIndex = CBTipoAnimal.FindStringExact("default"); DTPtimeToday(); //Combox1.SelectedIndex = Combox1.FindStringExact("test1") //comboBox2.SelectedValue.ToString(); //SelectedItem("default"); }