public ActionResult DeleteConfirmed(int id) { T_CompanyMaster t_CompanyMaster = db.T_CompanyMaster.Find(id); db.T_CompanyMaster.Remove(t_CompanyMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "記号,社保記号,番号,事業所名,事業主,郵便番号,住所01,住所02,電話番号,被保険者数_男,被保険者数_女,被保険者数計,T_00_事業所登録台帳_付加情報_記号")] T_CompanyMaster t_CompanyMaster) { if (ModelState.IsValid) { db.Entry(t_CompanyMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(t_CompanyMaster)); }
// GET: Company/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } T_CompanyMaster t_CompanyMaster = db.T_CompanyMaster.Find(id); if (t_CompanyMaster == null) { return(HttpNotFound()); } return(View(t_CompanyMaster)); }
public ActionResult ShearchQuery([Bind(Include = "記号,事業所名")] T_CompanyMaster args) { try { if (ModelState.IsValid) { int outKigou = 0; IQueryable <T_CompanyMaster> q = null; if (!string.IsNullOrEmpty(args.記号) & !string.IsNullOrEmpty(args.事業所名)) { q = db.T_CompanyMaster.Where(x => x.記号 == args.記号).Where(x => x.事業所名.Contains(args.事業所名)); } else if (!string.IsNullOrEmpty(args.記号)) { q = db.T_CompanyMaster.Where(x => x.記号 == args.記号); } else if (!string.IsNullOrEmpty(args.事業所名)) { q = db.T_CompanyMaster.Where(x => x.事業所名.Contains(args.事業所名)); } return(View(q)); } else { var q = db.T_CompanyMaster; return(View(q)); } } catch (InvalidOperationException ex) { throw; } }