public async Task <ActionResult> DeleteConfirmed(string id) { ViewBag.Title = ModelName; ViewBag.SubTitle = "删除"; HR_OPERATORS hR_OPERATORS = await db.HR_OPERATORS.FindAsync(id); db.HR_OPERATORS.Remove(hR_OPERATORS); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: Admin/Oprs public async Task <ActionResult> Index(HR_OPERATORS Query) { ViewBag.Title = ModelName; ViewBag.SubTitle = "查询"; ViewBag.Query = Query; var hR_OPERATORS = db.HR_OPERATORS.Include(h => h.BU); return(View(await hR_OPERATORS.Where(o => String.IsNullOrEmpty(Query.OPERNAME) || o.OPERID.IndexOf(Query.OPERNAME) > -1 || o.OPERNAME.IndexOf(Query.OPERNAME) > -1 ).ToListAsync())); }
// GET: Admin/Oprs/Details/5 public async Task <ActionResult> Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_OPERATORS hR_OPERATORS = await db.HR_OPERATORS.FindAsync(id); if (hR_OPERATORS == null) { return(HttpNotFound()); } return(View(hR_OPERATORS)); }
public async Task <ActionResult> Edit([Bind(Include = "OPERID,OPERNAME,PWD,BUNO,DEPTNO,ACTIVE,EMAIL,MOBILE,COMMENTS")] HR_OPERATORS hR_OPERATORS) { ViewBag.Title = ModelName; ViewBag.SubTitle = "编辑"; if (ModelState.IsValid) { db.Entry(hR_OPERATORS).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.BUNO = new SelectList(db.ENG_BU, "BUNO", "CodeName", hR_OPERATORS.BUNO); return(View(hR_OPERATORS)); }
// GET: Admin/Oprs/Delete/5 public async Task <ActionResult> Delete(string id) { ViewBag.Title = ModelName; ViewBag.SubTitle = "删除"; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_OPERATORS hR_OPERATORS = await db.HR_OPERATORS.FindAsync(id); if (hR_OPERATORS == null) { return(HttpNotFound()); } return(View(hR_OPERATORS)); }
// GET: Admin/Oprs/Edit/5 public async Task <ActionResult> Edit(string id) { ViewBag.Title = ModelName; ViewBag.SubTitle = "编辑"; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HR_OPERATORS hR_OPERATORS = await db.HR_OPERATORS.FindAsync(id); if (hR_OPERATORS == null) { return(HttpNotFound()); } ViewBag.BUNO = new SelectList(db.ENG_BU, "BUNO", "CodeName", hR_OPERATORS.BUNO); return(View(hR_OPERATORS)); }