public static void SaveWorker(Worker worker) { using (var db = new WorkersBenefitsDB2()) { db.Entry(worker).State = EntityState.Modified; db.SaveChanges(); } }
public static void SetWorkerRegistered(string idNumber) { using (var db = new WorkersBenefitsDB2()) { var workerToUpdate = db.workers.Single(item => item.id_number == idNumber); db.Entry(workerToUpdate).State = EntityState.Modified; db.SaveChanges(); } }
public async Task <ActionResult> Edit([Bind(Include = "company_id,name,address,phone_number,contact_person_name,contact_person_phone,registration_date,logo")] company company) { if (ModelState.IsValid) { db.Entry(company).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(company)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName")] user user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(user)); }
public async Task <ActionResult> Edit([Bind(Include = "category_id,name,visual_name,title,image,precedence")] category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(category)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] role role) { if (ModelState.IsValid) { db.Entry(role).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(role)); }
public async Task <ActionResult> Edit([Bind(Include = "voucher_id,image,valid_start_date,valid_end_date,description,active,last_updated")] voucher voucher) { if (ModelState.IsValid) { db.Entry(voucher).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(voucher)); }
public async Task <ActionResult> Edit([Bind(Include = "admin_person_id,identity_user_id,first_name,last_name,email,phone_number,active,last_update")] admin_persons admin_persons) { if (ModelState.IsValid) { db.Entry(admin_persons).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", admin_persons.identity_user_id); return(View(admin_persons)); }
public async Task <ActionResult> Edit([Bind(Include = "product_id,product_uid,category_id,image,title,precedence,description,popup,initial_price,discount,price,shipping,final_price")] product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.category_id = new SelectList(db.categories, "category_id", "name", product.category_id); ViewBag.product_id = new SelectList(db.products_in_orders, "id", "id", product.product_id); return(View(product)); }
public async Task <ActionResult> Edit([Bind(Include = "worker_id,identity_user_id,company_id,worker_number,id_number,first_name,last_name,email,phone_number,active,last_update")] worker worker) { if (ModelState.IsValid) { db.Entry(worker).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.company_id = new SelectList(db.companies, "company_id", "name", worker.company_id); ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", worker.identity_user_id); return(View(worker)); }
public async Task <ActionResult> Edit([Bind(Include = "order_id,order_uid,worker_id,order_item_type_id,credit_card_auth_id,charge_amount,order_date,comments")] order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } //ViewBag.order_item_type_id = new SelectList(db.order_item_types, "id", "name", order.order_item_type_id); ViewBag.worker_id = new SelectList(db.workers, "worker_id", "identity_user_id", order.worker_id); return(View(order)); }