Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Newsserial,Title,Category,Description,Author,Datetime,Keyword,CaptionPicture,Editor,FeatureNews")] Newsinfo newsinfo)
        {
            if (id != newsinfo.Newsserial)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(newsinfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NewsinfoExists(newsinfo.Newsserial))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(newsinfo));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,CompanyAddress,Companyurl,Picture,Title,Description,StartDate,EndDate,DailyRate,TotalPrice")] AdsDetails adsDetails)
        {
            if (id != adsDetails.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(adsDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdsDetailsExists(adsDetails.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(adsDetails));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("VideoNewsId,Title,Category,Keyword,Datetime,Path")] Videonews videonews)
        {
            if (id != videonews.VideoNewsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(videonews);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VideonewsExists(videonews.VideoNewsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(videonews));
        }
        public async Task <IActionResult> Edit(string id, [Bind("Username,Password,Email,Role")] UserDetails userDetails)
        {
            if (id != userDetails.Username)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserDetailsExists(userDetails.Username))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(userDetails));
        }