public ActionResult Add(EmploymentCompany e) { ActionResult ar = null; try { this.BeforeAddData(e, ref ar); if (ar == null) { this.Service.Add(e); e = this.Service.FindById(e.Id); //ar = this.Json(new AjaxOperationResult { Data = e, Successful = true }); this.AfterAddData(e, ref ar); } } catch (Exception ex) { ar = this.Json(new AjaxOperationResult { Successful = false, Message = ex.Message }); } return ar; }
partial void BeforeShowEditView(EmploymentCompany e);
partial void BeforeUpdateData(EmploymentCompany e, ref ActionResult ar);
partial void AfterUpdateData(EmploymentCompany e, ref ActionResult ar);
partial void AddRowToGridModel(LigerGridModel m, EmploymentCompany e);
public void Delete(EmploymentCompany entity) { this.DbContext.EmploymentCompanies.DeleteObject(entity); }
public void Add(EmploymentCompany entity) { this.DbContext.EmploymentCompanies.AddObject(entity); }
public void Update(EmploymentCompany entity) { var e = this.FindById(entity.Id); if (e != null) { e.Name = entity.Name; e.Type = entity.Type; e.Important = entity.Important; e.Website = entity.Website; e.Telephone = entity.Telephone; e.Fax = entity.Fax; e.Address = entity.Address; e.CityId = entity.CityId; e.Introduction = entity.Introduction; e.SourceType = entity.SourceType; e.Referer = entity.Referer; e.UserId = entity.UserId; e.EmployedQty = entity.EmployedQty; e.OldOaId = entity.OldOaId; e.TempProvId = entity.TempProvId; e.TempProvName = entity.TempProvName; e.TempCityId = entity.TempCityId; e.TempCityName = entity.TempCityName; e.AddTime = entity.AddTime; } //if (this.FindById(entity.Id) != null) { // this.DbContext.EmploymentCompanies.Attach(entity); // this.DbContext.ObjectStateManager.ChangeObjectState(entity, System.Data.EntityState.Modified); //} }