public async Task <IActionResult> Edit(int id, [Bind("FTId,Feetype1,FeeYear,TotalFees")] FeeType feeType)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            if (id != feeType.FTId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(feeType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FeeTypeExists(feeType.FTId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(feeType));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("StdId,Stname")] Std std)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            if (id != std.StdId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(std);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StdExists(std.StdId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(std));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AdTId,Term,TermAmount,TermDate,AdYear,FTId")] AdTypeFee adTypeFee)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            if (id != adTypeFee.AdTId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(adTypeFee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdTypeFeeExists(adTypeFee.AdTId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(adTypeFee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AdId,StId,StdId,FTId,FeeYear,PaidAmount,Totalfees,Pendingamt")] Admission1 admission1)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            if (id != admission1.AdId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    var res = _context.Admissiopay.Where(k => k.AdId == admission1.AdId);
                    _context.Admissiopay.RemoveRange(res);

                    _context.Update(admission1);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Admission1Exists(admission1.AdId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FTId"]  = new SelectList(_context.FeeType, "FTId", "Feetype1", admission1.FTId);
            ViewData["StId"]  = new SelectList(_context.Student, "StId", "StName", admission1.StId);
            ViewData["StdId"] = new SelectList(_context.Std, "StdId", "Stname", admission1.StdId);
            return(View(admission1));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AdId,AdTId,PayDate,Paystatus")] Admissiopay admissiopay)
        {
            if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1")))
            {
                return(RedirectToAction("UserLogin", "Login"));
            }
            if (id != admissiopay.AdId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(admissiopay);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdmissiopayExists(admissiopay.AdId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                return(RedirectToAction("Index", "Admission1"));
            }
            ViewData["AdId"]  = new SelectList(_context.Admission1, "AdId", "AdId", admissiopay.AdId);
            ViewData["AdTId"] = new SelectList(_context.AdTypeFee, "AdTId", "AdTId", admissiopay.AdTId);
            return(View(admissiopay));
        }