Пример #1
0
 /// <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));
     }
 }
Пример #2
0
        /// <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);
            }
        }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 bool IDailyRepository.Delete(daily obj)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public bool delete(daily obj)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public void Delete(daily obj)
 {
     throw new NotImplementedException();
 }