コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DeductionsMaster deductionsMaster = db.DeductionsMasters.Find(id);

            db.DeductionsMasters.Remove(deductionsMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "CustomerId,DeductionId,DeductionType,ValueMethod,DeductionHead,DeductionAmount,IsActive,IsCreated,CreatedDate")] DeductionsMaster deductionsMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deductionsMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(deductionsMaster));
 }
        public ActionResult Create([Bind(Include = "DeductionId,DeductionType,ValueMethod,DeductionHead,DeductionAmount,IsActive,IsCreated,CreatedDate")] DeductionsMaster deductionsMaster)
        {
            if (ModelState.IsValid)
            {
                db.DeductionsMasters.Add(deductionsMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(deductionsMaster));
        }
コード例 #4
0
        // GET: DeductionsMasters/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DeductionsMaster deductionsMaster = db.DeductionsMasters.Find(id);

            if (deductionsMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(deductionsMaster));
        }