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); } } }
public static void Main() { object o = new Der(); Gen <int> b = (Gen <int>)o; b.Test(); }
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); }
static void Main(string[] args) { int x = 50; Console.WriteLine("hello world"); Der y = new Der("hello world ~~~"); }
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")); }
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)); }
// 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)); }
// 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)); }
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)); }
} // Works now private void D(Der d) { Foo = d.Foo; } // OK