Esempio n. 1
0
        public async Task <ActionResult <about_us> > Postabout_us(about_us about_us)
        {
            _context.get_about_us.Add(about_us);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getabout_us", new { id = about_us.id }, about_us));
        }
Esempio n. 2
0
        public async Task <IActionResult> Putabout_us(int id, about_us about_us)
        {
            if (id != about_us.id)
            {
                return(BadRequest());
            }

            _context.Entry(about_us).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!about_usExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        private void aboutUsToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            about_us ab = new about_us();

            ab.Show();
            this.Show();
        }
Esempio n. 4
0
        public ActionResult about(about_us data)
        {
            var login = Convert.ToInt16(Session["login"]);
            var conf  = db.about_us.FirstOrDefault();

            if (conf != null)
            {
                conf.UPDATED_DATE = DateTime.Now;
                conf.UPDATED_BY   = login;
                if (data.ABOUT_US1 != null)
                {
                    conf.ABOUT_US1 = data.ABOUT_US1;
                }
                if (data.DESCRIPTION != null)
                {
                    conf.DESCRIPTION = data.DESCRIPTION;
                }
                db.SaveChanges();
            }


            return(RedirectToAction("about"));
        }