예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,AppointmentId,ServiceProviderId,TotalAmount,ServiceProviderRevenue,CompanyRevenue")] Transaction transaction)
 {
     if (ModelState.IsValid)
     {
         db.Entry(transaction).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ServiceProviderId = new SelectList(db.Accounts, "Id", "Username", transaction.ServiceProviderId);
     ViewBag.AppointmentId     = new SelectList(db.Appointments, "Id", "Location", transaction.AppointmentId);
     return(View(transaction));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Username,Password,Name,Email,Mobile,Gender,DateOfBirth,Address,ProfilePicture,UserType,CustomerId,ServiceProviderId")] Account account)
 {
     if (Session["user-type"] == null || Session["user-type"].ToString() != "1")
     {
         return(Redirect("/"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerId        = new SelectList(db.Customers, "Id", "Id", account.CustomerId);
     ViewBag.ServiceProviderId = new SelectList(db.ServiceProviders, "Id", "Coverage", account.ServiceProviderId);
     ViewBag.UserType          = new SelectList(db.UserTypes, "Id", "Title", account.UserType);
     return(View(account));
 }
예제 #3
0
파일: Repository.cs 프로젝트: deba1/AnyHire
 public void Update(TEntity entity)
 {
     context.Entry(entity).State = EntityState.Modified;
 }