public bool DeletePostion(CompanyPositionSetInfo positionSetInfo) { using (EntityContext context = new EntityContext()) { context.Delete <CompanyPositionSetInfo>("hr.company.deletePositions", positionSetInfo); } return(true); }
public ActionResult DeletePosition(CompanyPositionSetInfo positionSetInfo) { bool pass = new Manager.EmployeeManager().DeletePostion(positionSetInfo); Object result = new { success = pass, data = pass ? "成功" : "失败" }; JsonResult jsonResult = Json(result, JsonRequestBehavior.AllowGet); return(jsonResult); }
public bool SavePosition(CompanyPositionSetInfo positionSetInfo) { bool pass = true; using (EntityContext context = new EntityContext()) { try { context.BeginTransaction(); context.Delete <CompanyPositionSetInfo>("hr.company.deletePositions", positionSetInfo); context.Save <CompanyPositionSetInfo>("hr.company.insertPosition", positionSetInfo); context.Commit(); } catch { pass = false; context.Rollback(); } } return(pass); }