/// <summary> /// 创建一个daily /// </summary> /// <param name="entity">一个对象</param> /// <returns></returns> public int Create(daily entity) { using (SysEntities db = new SysEntities()) { Create(db, entity); return(this.Save(db)); } }
/// <summary> /// 删除一个daily /// </summary> /// <param name="db">实体数据</param> /// <param name="id">一条daily的主键</param> public void Delete(SysEntities db, string id) { daily deleteItem = GetById(db, id); if (deleteItem != null) { db.daily.DeleteObject(deleteItem); } }
public bool Update(daily obj) { using (CTyPHSachEntities db = new CTyPHSachEntities()) { try { var d = db.Agencies.Find(obj.id); d.agencyName = obj.name; d.agencyAddress = obj.address; d.maxdebt = obj.mucno; db.SaveChanges(); return(true); } catch (Exception ex) { return(false); } } }
/// <summary> /// 编辑一个daily对象 /// </summary> /// <param name="db">实体数据</param> /// <param name="entity">将要编辑的一个daily对象</param> public daily Edit(SysEntities db, daily entity) { db.daily.Attach(entity); db.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); return(entity); }
bool IDailyRepository.Delete(daily obj) { throw new NotImplementedException(); }
public bool delete(daily obj) { throw new NotImplementedException(); }
public void Delete(daily obj) { throw new NotImplementedException(); }