private void cmbMarkalar_SelectedIndexChanged(object sender, EventArgs e) { AracMarka _marka = new AracMarka(); _marka = ((AracMarka)cmbMarkalar.SelectedItem); if (_marka != null) { _extension.ComboDoldur(_listeleController.AracModelleriListele(_marka.MarkaID), cmbModeller); } }
public ActionResult Edit([Bind(Include = "AracMarka_ID,AracMarka_Adi,AracMarka_Status,AracMarka_CreateDate")] AracMarka aracMarka) { if (ModelState.IsValid) { db.Entry(aracMarka).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aracMarka)); }
public ActionResult Create([Bind(Include = "AracMarka_ID,AracMarka_Adi,AracMarka_Status,AracMarka_CreateDate")] AracMarka aracMarka) { if (ModelState.IsValid) { aracMarka.AracMarka_Status = (int)DBStatus.Active; aracMarka.AracMarka_CreateDate = DateTime.Now; db.AracMarka.Add(aracMarka); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aracMarka)); }
// GET: AracMarka/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AracMarka aracMarka = db.AracMarka.Find(id); if (aracMarka == null) { return(HttpNotFound()); } return(View(aracMarka)); }
// GET: AracMarka/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AracMarka aracMarka = db.AracMarka.Find(id); if (aracMarka == null) { return(HttpNotFound()); } aracMarka.AracMarka_Status = (int)DBStatus.Deleted; db.SaveChanges(); return(RedirectToAction("Index")); }
private void btnMarkaEkle_Click(object sender, EventArgs e) { AracMarka _marka = new AracMarka(); try { _marka.Marka = txtMarkaAdi.Text; _marka.AktifMi = true; _ekleController.EklemeyeGonder(_marka); } catch (Exception ex) { MessageBox.Show(ex.ToString()); return; } this.Close(); }