public ActionResult DeleteConfirmed(int id)
        {
            ChequesLog chequesLog = db.Cheques.Find(id);

            db.Cheques.Remove(chequesLog);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ChequesLogId,BankName,AccountNumber,ChequesDate,DepositDate,ClearedDate,IssuedBy,IssuedTo,Amount,IsPDC,IsIssuedByAprajitaRetails,IsDepositedOnAprajitaRetails,Remarks")] ChequesLog chequesLog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chequesLog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(chequesLog));
 }
        public ActionResult Create([Bind(Include = "ChequesLogId,BankName,AccountNumber,ChequesDate,DepositDate,ClearedDate,IssuedBy,IssuedTo,Amount,IsPDC,IsIssuedByAprajitaRetails,IsDepositedOnAprajitaRetails,Remarks")] ChequesLog chequesLog)
        {
            if (ModelState.IsValid)
            {
                db.Cheques.Add(chequesLog);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(PartialView(chequesLog));
        }
        public async Task <IActionResult> Create([Bind("ChequesLogId,BankName,AccountNumber,ChequesDate,DepositDate,ClearedDate,IssuedBy,IssuedTo,Amount,IsPDC,IsIssuedByAprajitaRetails,IsDepositedOnAprajitaRetails,Remarks")] ChequesLog chequesLog)
        {
            if (ModelState.IsValid)
            {
                _context.Add(chequesLog);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(chequesLog));
        }
        // GET: ChequesLogs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ChequesLog chequesLog = db.Cheques.Find(id);

            if (chequesLog == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(chequesLog));
        }
        [Authorize(Roles = "Admin,PowerUser")]     public async Task <IActionResult> Edit(int id, [Bind("ChequesLogId,BankName,AccountNumber,ChequesDate,DepositDate,ClearedDate,IssuedBy,IssuedTo,Amount,IsPDC,IsIssuedByAprajitaRetails,IsDepositedOnAprajitaRetails,Remarks")] ChequesLog chequesLog)
        {
            if (id != chequesLog.ChequesLogId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chequesLog);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChequesLogExists(chequesLog.ChequesLogId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(chequesLog));
        }