public IActionResult Edit(KeepFormatDtlModel keepformat_dtl)
 {
     if (ModelState.IsValid)
     {
         _context.Entry(keepformat_dtl).State = EntityState.Modified;
         _context.SaveChanges();
         return(RedirectToAction("Edit", "KeepFormat", new { id = keepformat_dtl.FormatId }));
     }
     return(View(keepformat_dtl));
 }
        // GET: KeepFormatDtl/Edit/5
        public IActionResult Edit(string id = null, int sno = 0)
        {
            KeepFormatDtlModel keepformat_dtl = _context.KeepFormatDtls.Find(id, sno);

            if (keepformat_dtl == null)
            {
                return(StatusCode(404));
            }
            return(View(keepformat_dtl));
        }
 public IActionResult Create(KeepFormatDtlModel keepformat_dtl)
 {
     if (ModelState.IsValid)
     {
         _context.KeepFormatDtls.Add(keepformat_dtl);
         _context.SaveChanges();
         return(RedirectToAction("Edit", "KeepFormat", new { id = keepformat_dtl.FormatId }));
     }
     return(View(keepformat_dtl));
 }
예제 #4
0
        // GET: BMED/KeepFormatDtl/Delete/5
        public IActionResult Delete(string id = null, int sno = 0)
        {
            KeepFormatDtlModel keepformat_dtl = _context.BMEDKeepFormatDtls.Find(id, sno);

            if (keepformat_dtl == null)
            {
                return(StatusCode(404));
            }
            keepformat_dtl.KeepFormat = _context.BMEDKeepFormats.Find(id);
            return(View(keepformat_dtl));
        }
        public IActionResult DeleteConfirmed(KeepFormatDtlModel keepformat_dtl)
        {
            KeepFormatDtlModel kdtl = _context.KeepFormatDtls.Find(keepformat_dtl.FormatId, keepformat_dtl.Sno);

            if (kdtl != null)
            {
                _context.KeepFormatDtls.Remove(kdtl);
                _context.SaveChanges();
                return(RedirectToAction("Edit", "KeepFormat", new { id = keepformat_dtl.FormatId }));
            }
            return(View(keepformat_dtl));
        }
 // GET: KeepFormatDtl/Create
 public IActionResult Create(string id = null)
 {
     if (id != null)
     {
         KeepFormatDtlModel keepformat_dtl = _context.KeepFormatDtls.Where(d => d.FormatId == id)
                                             .OrderByDescending(d => d.Sno)
                                             .FirstOrDefault();
         if (keepformat_dtl != null)
         {
             keepformat_dtl.Sno     += 1;
             keepformat_dtl.Descript = "";
             return(View(keepformat_dtl));
         }
         else
         {
             keepformat_dtl          = new KeepFormatDtlModel();
             keepformat_dtl.FormatId = id;
             keepformat_dtl.Sno      = 1;
             return(View(keepformat_dtl));
         }
     }
     return(View());
 }