public ActionResult DeleteConfirmed(int id) { Sekolah sekolah = db.Sekolahh.Find(id); db.Sekolahh.Remove(sekolah); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Sekolah/Delete/5 public ActionResult Delete(int id = 0) { Sekolah sekolah = db.Sekolahh.Find(id); if (sekolah == null) { return(HttpNotFound()); } return(View(sekolah)); }
public ActionResult Edit(Sekolah sekolah) { if (ModelState.IsValid) { db.Entry(sekolah).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sekolah)); }
public ActionResult Create(Sekolah sekolah) { if (ModelState.IsValid) { db.Sekolahh.Add(sekolah); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sekolah)); }
private void btn_login_Click(object sender, EventArgs e) { if (Sekolah.login_sekolah(text_npsn.Text, text_kodeakses.Text)) { this.Hide(); Dashboard d = new Dashboard(text_npsn.Text); d.Show(); } else { List <TextBox> lt = new List <TextBox>(); lt.Add(text_npsn); lt.Add(text_kodeakses); Formatter.SetTextError(lt); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { if (Sekolah.cek_data_ada()) { Application.Run(new IsianSekolah()); } else { Application.Run(new LoginSekolah()); } } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btn_simpan_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.Enabled)) { String kodeakses = Formatter.GetMd5Hash(txt_namasekolah.Text).Substring(0, 6); SQLiteDatabase db = new SQLiteDatabase(); Dictionary <String, String> data = new Dictionary <String, String>(); data.Add("NPSN", txt_npsn.Text); data.Add("KODE_AKSES", kodeakses); data.Add("KODE_ROLE", Sekolah.ROLE); data.Add("KODE_KOTA", cmb_kota.SelectedValue.ToString()); data.Add("NAMA_SEKOLAH", txt_namasekolah.Text); data.Add("ALAMAT", txt_alamatsekolah.Text); data.Add("NOMOR_TELEPON", txt_telpsekolah.Text); data.Add("EMAIL", txt_email.Text); data.Add("KEPALA_SEKOLAH", txt_namakepsek.Text); data.Add("NOTELP_KEPSEK", txt_telpkepsek.Text); data.Add("EMAIL_KEPSEK", txt_emailkepsek.Text); data.Add("JENIS", Sekolah._jenissekolah(pnl_jenis.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked).Text)); data.Add("AKREDITASI", Sekolah._akreditasi(pnl_akreditasi.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked).Text)); data.Add("NILAI_AKREDITASI", txt_nilaiakreditasi.Text); data.Add("STATUS", pnl_status.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked).Text.ToLower()); try { db.Insert("slta", data); MessageBox.Show("Data sekolah berhasil disimpan", "Sukses", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); Pralogin pl = new Pralogin(kodeakses); pl.Show(); } catch (Exception crap) { MessageBox.Show(crap.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }