示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Annexure3FormArecNo,AdministrativeDepartment,InstitutionDetails,Pendency2013To14,Pendency2014To15,Pendency2015To16,Pendency2016To17")] Annexure3FormA annexure3FormA)
        {
            if (id != annexure3FormA.Annexure3FormArecNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(annexure3FormA);
                    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 = "Annexure3A"
                        };
                    }
                    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 = "Annexure3A"
                        };
                    }
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Annexure3FormAExists(annexure3FormA.Annexure3FormArecNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(View(annexure3FormA));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Annexure3FormArecNo,AdministrativeDepartment,InstitutionDetails,Pendency2013To14,Pendency2014To15,Pendency2015To16,Pendency2016To17")] Annexure3FormA annexure3FormA)
        {
            if (ModelState.IsValid)
            {
                _context.Add(annexure3FormA);
                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 = "Annexure3A"
                    };
                }
                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 = "Annexure3A"
                    };
                }
            }
            return(View(annexure3FormA));
        }