コード例 #1
0
ファイル: AracEkle.cs プロジェクト: engindnmz/IKOtomasyon
        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);
            }
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        // 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));
        }
コード例 #5
0
        // 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"));
        }
コード例 #6
0
        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();
        }