public ActionResult Edit([Bind(Include = "PaintID,Paintname,CreateDate,Size,Price,Type,ArtistID")] Paint paint) { if (ModelState.IsValid) { db.Entry(paint).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistID = new SelectList(db.Artists, "ArtistID", "ArtistName", paint.ArtistID); return(View(paint)); }
public ActionResult preHandle(string id) { using (MyDB mydb = new MyDB()) { WFInstNode node = mydb.WFInstNodes.Find(id); mydb.Entry(node).Reference <WFInst>(n => n.WFInst).Load(); mydb.Entry(node).Reference <WFNode>(n => n.WFNode).Load(); mydb.Entry(node.WFInst).Reference <WFTemplate>(n => n.WFTemplate).Load(); mydb.Entry((WFNodeHandle)node.WFNode).Collection <WFNodeAction>(n => n.Actions).Load(); mydb.Entry(node.WFInst).Collection <WFInstNode>(inst => inst.WFInstNodes).Load(); return(View("tohandle", node)); } }
public TEntity Update(TEntity entity, int id) { var entityCorrente = context.Set <TEntity>().AsNoTracking().FirstOrDefault(o => o.Id == id); if (entityCorrente is null) { throw new ArgumentException(nameof(id)); } context.Entry <TEntity>(entity).State = EntityState.Modified; context.SaveChanges(); return(entity); }
public IHttpActionResult Putemployee_tbl(int id, employee_tbl employee_tbl) { //if (!ModelState.IsValid) //{ // return BadRequest(ModelState); //} if (id != employee_tbl.EmployeeId) { return(BadRequest()); } db.Entry(employee_tbl).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!employee_tblExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutContent(int id, Content content) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != content.Id) { return(BadRequest()); } db.Entry(content).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ContentExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void sss() { using (MyDB mydb = new MyDB()) { User user = mydb.Users.First(u => u.Code.Contains("lx")); mydb.Entry(user).Collection(u => u.CreateWFTemplates).Query().Load(); } }
public ActionResult Edit([Bind(Include = "LocationID,Long,Lat,Address")] Location location) { if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(location)); }
public ActionResult Edit([Bind(Include = "flightBoardID,boardName,flightID")] FlightBoard flightBoard) { if (ModelState.IsValid) { db.Entry(flightBoard).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(flightBoard)); }
public ActionResult Edit([Bind(Include = "DealID,PropertyID,CustomerID,BrokerID,Price,Commition,Categorty")] Deal deal) { if (ModelState.IsValid) { db.Entry(deal).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(deal)); }
public ActionResult Edit([Bind(Include = "id,name,seats,seats_left,gig_date,description,seat_price")] Gig gig) { if (ModelState.IsValid) { db.Entry(gig).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gig)); }
public ActionResult Edit([Bind(Include = "Id,Station,Text,Date,PreFunc,PostFunc")] Content content) { if (ModelState.IsValid) { db.Entry(content).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(content)); }
public ActionResult Edit([Bind(Include = "BrokerID,Name,Deals")] Broker broker) { if (ModelState.IsValid) { db.Entry(broker).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(broker)); }
public ActionResult Edit([Bind(Include = "QuestionRoomID,Title,Creator")] QuestionRoom questionRoom) { if (ModelState.IsValid) { db.Entry(questionRoom).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(questionRoom)); }
public ActionResult Edit([Bind(Include = "CustomerID,CustName,Email,Gender,PhoneNum")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "UserName,FirstName,Gender,BirthDay,Email,Password,Description,Score")] Professional professional) { if (ModelState.IsValid) { db.Entry(professional).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(professional)); }
public ActionResult Edit([Bind(Include = "Profession_Name")] Profession profession) { if (ModelState.IsValid) { db.Entry(profession).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(profession)); }
public ActionResult Edit([Bind(Include = "Id,Name")] Course course) { if (ModelState.IsValid) { db.Entry(course).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(course)); }
public ActionResult Edit([Bind(Include = "ID_NHOM,tennhomtin")] NHOMTIN nHOMTIN) { if (ModelState.IsValid) { db.Entry(nHOMTIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nHOMTIN)); }
public ActionResult Edit([Bind(Include = "ContactId,name,email,subject,messenge")] Contact contact) { if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contact)); }
public ActionResult Edit([Bind(Include = "ID,Title,Body,SentBy,Posted")] Comment comment) { if (ModelState.IsValid) { db.Entry(comment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(comment)); }
public ActionResult Edit([Bind(Include = "ID_TK,username,password,tentk,phone,mail,diachi")] TAIKHOAN tAIKHOAN) { if (ModelState.IsValid) { db.Entry(tAIKHOAN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tAIKHOAN)); }
public ActionResult Edit([Bind(Include = "Id,Location,Station")] Marquee marquee) { if (ModelState.IsValid) { db.Entry(marquee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(marquee)); }
public ActionResult Edit([Bind(Include = "PersonID,FirstName,LastName,UserName,Password,Permission,CreditCardID")] Person person) { if (ModelState.IsValid) { db.Entry(person).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(person)); }
public ActionResult Edit([Bind(Include = "PropertyID,Adress,NumOfRooms,Price,Type,Elevator,Balcony,Parking,Category,SQfeet,About")] Property property) { if (ModelState.IsValid) { db.Entry(property).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(property)); }
public ActionResult Edit([Bind(Include = "AdminID,FirstName,LastName,UserName,Password")] Admin admin) { if (ModelState.IsValid) { db.Entry(admin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin)); }
public ActionResult Edit([Bind(Include = "userID,type,name,password")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "ArtistID,ArtistName,Email,FavoriteStyle,Rate")] Artist artist) { if (ModelState.IsValid) { db.Entry(artist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(artist)); }
public ActionResult Edit([Bind(Include = "UserName,FirstName,Gender,BirthDay,Email,Password")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "Id,Station,Uid")] Owner owner) { if (ModelState.IsValid) { db.Entry(owner).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(owner)); }
public ActionResult Edit([Bind(Include = "flightAttendantID,name")] FlightAttendant flightAttendant) { if (ModelState.IsValid) { db.Entry(flightAttendant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(flightAttendant)); }