Esempio n. 1
0
        public void insertPet3(string petName, string petType, string petBreed, int duenyo)
        {
            var count = (from o in db1.PET
                         select o).Count();

            Debug.WriteLine("insertPet.  " + count);
            auxListInsert(petName, petType, petBreed, duenyo);

            var chequeoDueño = (from d in db1.PET_OWNER select d.OwnerID).ToList();
            int maxDueño     = chequeoDueño.Count();

            lg.crearLog("maxDueño: " + maxDueño);

            lg.crearLog("arrayInsertPet[1]: " + arrayInsertPet[1]);
            lg.crearLog("arrayInsertPet[2]: " + arrayInsertPet[2]);
            lg.crearLog("arrayInsertPet[3]: " + arrayInsertPet[3]);
            lg.crearLog("dueño: " + dueño);


            petNewbie = new PET()
            {
                PetID    = count,
                PetName  = arrayInsertPet[1].Trim().ToLower(),
                PetType  = arrayInsertPet[2].Trim().ToLower(),
                PetBreed = arrayInsertPet[3].Trim().ToLower(),
                PetDOB   = DateTime.Now,
                OwnerID  = dueño
            };

            setLBSeleciondo    = String.Format("lbSelecionado: {0}, {1}, {2}", arrayInsertPet[1].Trim().ToLower(), arrayInsertPet[2].Trim().ToLower(), arrayInsertPet[3].Trim().ToLower());
            lbSelecionado.Text = setLBSeleciondo;

            AuxDBInsert();
            auxUGTaskInsert();
        }
Esempio n. 2
0
        //PetID],[PetName],[PetType],[PetBreed],[PetDOB],[OwnerID]

        /* petNewbie = new PET()
         * {
         *  PetName = "Golum",
         *  PetType = "dog",
         *  PetBreed = "chihuaha",
         *  PetDOB = DateTime.Now,
         *  OwnerID = 5
         * };*/

        public void insertPet()
        {
            var count = (from o in db1.PET

                         select o).Count();

            Debug.WriteLine("insertPet.  " + count);
            PET petNewbie2 = new PET()
            {
                PetID    = count,
                PetName  = "Dr Gang ",
                PetType  = "cat",
                PetBreed = "persa",
                PetDOB   = DateTime.Now,
                OwnerID  = 1
            };

            AuxDBInsert();
            auxUGTaskInsert();
            #region dbTask+UGtask

            /*
             * db1.Configuration.AutoDetectChangesEnabled = false;
             * db1.Entry(petNewbie2).State = System.Data.Entity.EntityState.Added;
             * db1.SaveChanges();
             *
             * this.ultraGrid1.DataBind();
             * this.ultraGrid1.SetDataBinding(this.veterianDataSet2, "LovePets");
             * this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
             * var listaPets1 = (from p in db.PET select p).ToList();
             * this.ultraGrid1.DataSource = listaPets1;
             * this.ultraGrid1.DisplayLayout.Bands[0].Columns["PetID"].Header.VisiblePosition = 1;
             * this.ultraGrid1.Refresh();*/

            #endregion
        }