示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StorePayment storePayment = db.StorePayments.Find(id);

            db.StorePayments.Remove(storePayment);
            db.SaveChanges();
            return(RedirectToAction("Index", new { id = storePayment.StoreDetailId }));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id);

            if (store.AdminMgr.RemoveStorePayment(storePayment))
            {
                return(RedirectToAction("Index"));
            }
            return(View(storePayment));
        }
示例#3
0
 public bool RemoveStorePayment(StorePayment storePayment)
 {
     try
     {
         return(adminDb.RemoveStorePayment(storePayment));
     }
     catch
     {
         return(false);
     }
 }
示例#4
0
 public bool EditStorePayment(StorePayment storePayment)
 {
     try
     {
         return(adminDb.EditStorePayment(storePayment));
     }
     catch
     {
         return(false);
     }
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(storePayment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = storePayment.StoreDetailId }));
     }
     ViewBag.StoreDetailId        = new SelectList(db.StoreDetails, "Id", "LoginId", storePayment.StoreDetailId);
     ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId);
     ViewBag.StorePaymentTypeId   = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId);
     return(View(storePayment));
 }
示例#6
0
 public bool RemoveStorePayment(StorePayment storePayment)
 {
     try
     {
         db.StorePayments.Remove(storePayment);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#7
0
 public bool EditStorePayment(StorePayment storePayment)
 {
     try
     {
         db.Entry(storePayment).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#8
0
 public bool AddStorePayment(StorePayment storePayment)
 {
     try
     {
         db.StorePayments.Add(storePayment);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public ActionResult Edit([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment)
 {
     if (ModelState.IsValid)
     {
         if (store.AdminMgr.EditStorePayment(storePayment))
         {
             return(RedirectToAction("Index"));
         }
     }
     ViewBag.StoreDetailId        = new SelectList(store.RefDbLayer.GetStoreDetails(), "Id", "Name", storePayment.StoreDetailId);
     ViewBag.StorePaymentStatusId = new SelectList(store.RefDbLayer.GetStorePaymentStatus(), "Id", "Name", storePayment.StorePaymentStatusId);
     ViewBag.StorePaymentTypeId   = new SelectList(store.RefDbLayer.GetStorePaymentTypes(), "Id", "Description", storePayment.StorePaymentTypeId);
     return(View(storePayment));
 }
        // GET: Admin/StorePayments/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id);

            if (storePayment == null)
            {
                return(HttpNotFound());
            }
            return(View(storePayment));
        }
示例#11
0
        // GET: Store/StorePayments/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StorePayment storePayment = db.StorePayments.Find(id);

            if (storePayment == null)
            {
                return(HttpNotFound());
            }
            return(View(storePayment));
        }
        public ActionResult Create([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment)
        {
            if (ModelState.IsValid)
            {
                db.StorePayments.Add(storePayment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.StoreDetailId        = new SelectList(db.StoreDetails, "Id", "Name", storePayment.StoreDetailId);
            ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId);
            ViewBag.StorePaymentTypeId   = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId);
            return(View(storePayment));
        }
        // GET: Admin/StorePayments/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id);

            if (storePayment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StoreDetailId        = new SelectList(store.RefDbLayer.GetStoreDetails(), "Id", "Name", storePayment.StoreDetailId);
            ViewBag.StorePaymentStatusId = new SelectList(store.RefDbLayer.GetStorePaymentStatus(), "Id", "Name", storePayment.StorePaymentStatusId);
            ViewBag.StorePaymentTypeId   = new SelectList(store.RefDbLayer.GetStorePaymentTypes(), "Id", "Description", storePayment.StorePaymentTypeId);
            return(View(storePayment));
        }
        // GET: Admin/StorePayments/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StorePayment storePayment = db.StorePayments.Find(id);

            if (storePayment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StoreDetailId        = new SelectList(db.StoreDetails, "Id", "Name", storePayment.StoreDetailId);
            ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId);
            ViewBag.StorePaymentTypeId   = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId);
            return(View(storePayment));
        }