static void Main(string[] args) { int angka = 0; Console.WriteLine("Masukan angka"); string inputan = Console.ReadLine(); int.TryParse(inputan, out angka); //angka = angka < angka; for (int i = 0; i < angka; i++) { Console.WriteLine("angka= " + i + ", kuadrat=" + Math.Pow(i, 2)); } // Mahasiswa budi = new Mahasiswa(); // Mahasiswa iwan = new Mahasiswa(); // Mahasiswa wati = new Mahasiswa(); // Mahasiswa Badu = new Mahasiswa(); // budi.menulis(); // Console.WriteLine(Badu.membaca()); // Badu.bernafas(); // DutaKampus widya = new Dutakampus(); // Console.WriteLine(widya.membaca()); // widya.mempromosikan(); Desa desa = new Desa(); desa.namaDesa(); desa.namakota(); desa.namaprovinsi(); }
public async Task <ActionResult> DeleteConfirmed(string id) { Desa desa = await db.Desas.FindAsync(id); db.Desas.Remove(desa); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public void Add(Desa entity) { entity.RecordStatus = "A"; using (var context = new AISContext <Desa>()) { context.DBEntities.Add(entity); context.SaveChanges(); } }
public async Task <ActionResult> Edit([Bind(Include = "KodeDesa,KodeKec,NamaDesa,KearifanLokal")] Desa desa) { if (ModelState.IsValid) { db.Entry(desa).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.KodeKec = new SelectList(db.Kecamatans, "KodeKec", "KodeKab", desa.KodeKec); return(View(desa)); }
// GET: Desa/Details/5 public async Task <ActionResult> Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Desa desa = await db.Desas.FindAsync(id); if (desa == null) { return(HttpNotFound()); } return(View(desa)); }
// GET: Desa/Edit/5 public async Task <ActionResult> Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Desa desa = await db.Desas.FindAsync(id); if (desa == null) { return(HttpNotFound()); } ViewBag.KodeKec = new SelectList(db.Kecamatans, "KodeKec", "KodeKab", desa.KodeKec); return(View(desa)); }
public void Update(Desa entity) { using (var context = new AISContext <Desa>()) { Desa data = context.DBEntities.Where(i => i.IDDesa == entity.IDDesa).FirstOrDefault(); if (data == null) { //TBD for error exception data not exist throw new Exception("Data Not Exist"); } else { data.RecordStatus = entity.RecordStatus.Substring(0, 1); data.IDKecamatan = entity.IDKecamatan; data.NamaDesa = entity.NamaDesa; context.SaveChanges(); } } }
// GET: public async Task <ActionResult> Profil(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Desa desa = await db.Desas.FindAsync(id); List <Indikator> indikators = await db.Indikators.Where(x => x.KodeDesa == id).ToListAsync(); if (desa == null) { return(HttpNotFound()); } ViewBag.desa = desa; ViewBag.indikators = indikators; return(View()); }
public void Delete(Desa entity) { throw new NotImplementedException(); }