コード例 #1
0
        public Organization Update(Organization item)
        {
            _context.Entry(item).State = EntityState.Modified;
            _context.SaveChanges();

            return(_context.Entry(item).Entity);
        }
コード例 #2
0
        public Family Update(Family item)
        {
            _context.Entry(item).State = EntityState.Modified;

            _context.SaveChanges();
            return(_context.Entry(item).Entity);
        }
コード例 #3
0
        public User Update(User item)
        {
            _context.Entry(item).State = EntityState.Modified;

            _context.SaveChanges();
            return(_context.Entry(item).Entity);
        }
コード例 #4
0
        public Department Update(Department item)
        {
            _context.Entry(item).State = EntityState.Modified;
            _context.SaveChanges();

            return(_context.Entry(item).Entity);
        }
コード例 #5
0
        public Offering Update(Offering item)
        {
            _context.Entry(item).State = EntityState.Modified;

            _context.SaveChanges();
            return(_context.Entry(item).Entity);
        }
コード例 #6
0
        public Business Update(Business item)
        {
            _context.Entry(item).State = EntityState.Modified;

            _context.SaveChanges();
            return(_context.Entry(item).Entity);
        }
コード例 #7
0
        public Enterprise Update(Enterprise item)
        {
            _context.Entry(item).State = EntityState.Modified;

            _context.SaveChanges();
            return(_context.Entry(item).Entity);
        }
コード例 #8
0
 public ActionResult Edit(Enterprise enterprise, int id)
 {
     if (ModelState.IsValid)
     {
         db.Entry(enterprise).State = EntityState.Modified;
         db.Entry(enterprise).Property(e => e.DateCreated).IsModified = false;
         db.SaveChanges();
         return(RedirectToAction("Edit"));
     }
     return(View(enterprise));
 }
コード例 #9
0
        public async Task <Student> UpdateAsync(Student student)
        {
            _context.Entry(student).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(student);
        }
コード例 #10
0
 public ActionResult Edit(Enterprises enterprise)
 {
     if (Request.IsAjaxRequest())
     {
         db.Entry(enterprise).State = EntityState.Modified;
         db.SaveChanges();
         return(Content("<b>Дані збережені о <b>" + DateTime.Now.ToLongTimeString()));
     }
     return(RedirectToAction("List"));
 }
コード例 #11
0
 public ActionResult Edit([Bind(Include = "ID,Name,DateModified,DateCreated")] Parent parent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(parent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(parent));
 }
コード例 #12
0
 public ActionResult Edit([Bind(Include = "ID,Name,Description,EnterpriseID")] Competence competence)
 {
     if (ModelState.IsValid)
     {
         db.Entry(competence).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EnterpriseID = new SelectList(db.Enterprises, "ID", "Name", competence.EnterpriseID);
     return(View(competence));
 }
コード例 #13
0
        public ActionResult Edit([Bind(Include = "ID,Name,Surname,Email,PhoneNr,RegistrationDate,EnterpriseID")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                int?result = ToNullableInt32(Request.Form["CompetenceID"]);
                if (result != db.CompetencesRatings.Where(c => c.EmployeeID == employee.ID).First().CompetenceID)
                {
                    var competenceRating = new CompetenceRating
                    {
                        CompetenceID = result,
                        EmployeeID   = employee.ID
                    };
                    db.CompetencesRatings.Add(competenceRating);
                }

                db.Entry(employee).State = EntityState.Modified;
                db.Entry(employee).Property(e => e.RegistrationDate).IsModified = false;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.EnterpriseID = new SelectList(db.Enterprises, "ID", "Name", employee.EnterpriseID);
            return(View(employee));
        }
コード例 #14
0
        public ActionResult Edit([Bind(Include = "ID,Name,DateModified,DateCreated")] Client client)
        {
            if (ModelState.IsValid)
            {
                client.DateModified = DateTime.Now;
                client.DateCreated  = DateTime.Now;


                db.Entry(client).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(client));
        }
コード例 #15
0
        public ActionResult Edit([Bind(Include = "ID,ClientID,ParentID,AccessCode,IsAndroid,ApkName,Route,Enabled,DateModified,DateCreated,DownloadCount")] Enterprise enterprise)
        {
            if (ModelState.IsValid)
            {
                db.Entry(enterprise).State = EntityState.Modified;
                enterprise.DateModified    = DateTime.Now;
                enterprise.DateCreated     = DateTime.Now;

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.ClientID = new SelectList(db.Clients, "ID", "Name", enterprise.ClientID);
            ViewBag.ParentID = new SelectList(db.Parents, "ID", "Name", enterprise.ParentID);
            return(View(enterprise));
        }
コード例 #16
0
 public void Update(Employee item)
 {
     db.Entry(item).State = EntityState.Modified;
 }
コード例 #17
0
 public void Update(T entity)
 {
     _context.Entry(entity).State = EntityState.Modified;
     _context.SaveChanges();
 }
コード例 #18
0
 public void Update(OrderProduct item)
 {
     db.Entry(item).State = EntityState.Modified;
 }