public async Task <IActionResult> Edit(DateTime id, [Bind("Exdate,Payment_date,Record_date,Amount,type")] Divident divident)
        {
            if (id != divident.Exdate)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(divident);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DividentExists(divident.Exdate))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(divident));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Divident divident = db.Dividents.Find(id);

            db.Dividents.Remove(divident);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public async Task <IActionResult> Create([Bind("Exdate,Payment_date,Record_date,Amount,type")] Divident divident)
        {
            if (ModelState.IsValid)
            {
                _context.Add(divident);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(divident));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "ID,StockID,Amount,PayDate")] Divident divident)
 {
     if (ModelState.IsValid)
     {
         db.Entry(divident).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StockID = new SelectList(db.Stocks.OrderBy(o => o.Name).ToList(), "ID", "Name", divident.StockID);
     return(View(divident));
 }
Example #5
0
        // GET: Divident/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Divident divident = db.Dividents.Find(id);

            if (divident == null)
            {
                return(HttpNotFound());
            }
            return(View(divident));
        }
Example #6
0
        // GET: Divident/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Divident divident = db.Dividents.Find(id);

            if (divident == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StockID = new SelectList(db.Stocks.OrderBy(o => o.Name).ToList(), "ID", "Name", divident.StockID);
            return(View(divident));
        }