Exemple #1
0
        public async Task <IActionResult> Create([Bind("RtiPdlRecNo,Details,OriginalPetitions,Appealpetitions,OriginalAppealPetitions,Total")] RtiPdl rtiPdl)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rtiPdl);
                var result = await _context.SaveChangesAsync();

                if (result == 1)
                {
                    Result          = "Saved";
                    ViewData["Msg"] = new MessageDTO {
                        Message = "Dear User,<br/>Details Successfully Saved!!.", Status = "S", BackPageAction = "Index", BackPageController = "RtiPdls"
                    };
                }
                else
                {
                    ViewData["Msg"] = new MessageDTO {
                        Message = "Dear User,<br/><b>Some Error Ocurred Please try Later. if the problem persists contact your system administrator..", Status = "E", BackPageAction = "Index", BackPageController = "RtiPdls"
                    };
                }
            }
            return(View(rtiPdl));



            //if (ModelState.IsValid)
            //{
            //    _context.Add(rtiPdl);
            //    await _context.SaveChangesAsync();
            //    return RedirectToAction(nameof(Index));
            //}
            //return View(rtiPdl);
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("RtiPdlRecNo,Details,OriginalPetitions,Appealpetitions,OriginalAppealPetitions,Total")] RtiPdl rtiPdl)
        {
            if (id != rtiPdl.RtiPdlRecNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rtiPdl);
                    var result = await _context.SaveChangesAsync();

                    if (result == 1)
                    {
                        Result          = "Updated";
                        ViewData["Msg"] = new MessageDTO {
                            Message = "Dear User,<br/>Details Successfully Updated!!.", Status = "S", BackPageAction = "Index", BackPageController = "RtiPdls"
                        };
                    }
                    else
                    {
                        ViewData["Msg"] = new MessageDTO {
                            Message = "Dear User,<br/><b>Some Error Ocurred Please try Later. if the problem persists contact your system administrator..", Status = "E", BackPageAction = "Index", BackPageController = "RtiPdls"
                        };
                    }
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RtiPdlExists(rtiPdl.RtiPdlRecNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(View(rtiPdl));
        }