예제 #1
0
 public void Insert(int valor)
 {
     if (valor <= this.Valor)
     {
         if (Izq == null)
         {
             this.Izq = new BinaryTree(valor);
         }
         else
         {
             Izq.Insert(valor);
         }
     }
     else
     {
         if (Der == null)
         {
             this.Der = new BinaryTree(valor);
         }
         else
         {
             Der.Insert(valor);
         }
     }
 }
예제 #2
0
    public static void Main()
    {
        object    o = new Der();
        Gen <int> b = (Gen <int>)o;

        b.Test();
    }
예제 #3
0
        public int[] ToArray()
        {
            var temp = new int[0];

            int[] total = new int[0];
            if (this.Izq != null)
            {
                var izqArr = Izq.ToArray();
                total = izqArr;
            }

            temp = new int[total.Length + 1];
            total.CopyTo(temp, 0);
            var valArr = new int[] { this.Valor };

            valArr.CopyTo(temp, total.Length);
            total = temp;

            if (this.Der != null)
            {
                var derArr = Der.ToArray();
                temp = new int[derArr.Length + total.Length];
                total.CopyTo(temp, 0);
                derArr.CopyTo(temp, total.Length);
            }

            total = temp;

            return(total);
        }
예제 #4
0
        static void Main(string[] args)
        {
            int x = 50;

            Console.WriteLine("hello world");

            Der y = new Der("hello world ~~~");
        }
예제 #5
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Der der = await db.Ders.FindAsync(id);

            if (der.active == (int)EnumHelperData.Satatus.Aktif)
            {
                der.active = (int)EnumHelperData.Satatus.Pasif;
            }
            //db.Ders.Remove(der);
            await db.SaveChangesAsync();

            return(RedirectToAction("LectureList", "Home"));
        }
예제 #6
0
        public async Task <ActionResult> Create([Bind(Include = "id,ders_adi,ders_referans,kredi,ref_bolum")] Der der)
        {
            if (ModelState.IsValid)
            {
                der.active = 1;
                db.Ders.Add(der);
                await db.SaveChangesAsync();

                return(RedirectToAction("LectureList", "Home"));
            }

            ViewBag.ref_bolum = new SelectList(db.Bolums, "id", "adi", der.ref_bolum);
            return(View(der));
        }
예제 #7
0
        // GET: Ders/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Der der = await db.Ders.FindAsync(id);

            if (der == null)
            {
                return(HttpNotFound());
            }
            return(View(der));
        }
예제 #8
0
        // GET: Ders/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Der der = await db.Ders.FindAsync(id);

            if (der == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ref_bolum = new SelectList(db.Bolums, "id", "adi", der.ref_bolum);
            return(View(der));
        }
예제 #9
0
        public async Task <ActionResult> Edit([Bind(Include = "id,ders_adi,ders_referans,kredi,ref_bolum,active")] Der der)
        {
            if (ModelState.IsValid)
            {
                if (der.active == null)
                {
                    der.active = 1;
                }
                db.Entry(der).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("LectureList", "Home"));
            }
            ViewBag.ref_bolum = new SelectList(db.Bolums, "id", "adi", der.ref_bolum);
            return(View(der));
        }
예제 #10
0
    }                                                  // Works now

    private void D(Der d)
    {
        Foo = d.Foo;
    }                                          // OK