Beispiel #1
0
 /// <summary>
 /// 创建一个tasktype
 /// </summary>
 /// <param name="db">实体数据</param>
 /// <param name="entity">将要创建的一个tasktype</param>
 public void Create(SysEntities db, tasktype entity)
 {
     if (entity != null)
     {
         db.tasktype.AddObject(entity);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 创建一个tasktype
 /// </summary>
 /// <param name="entity">一个对象</param>
 /// <returns></returns>
 public int Create(tasktype entity)
 {
     using (SysEntities db = new SysEntities())
     {
         Create(db, entity);
         return(this.Save(db));
     }
 }
Beispiel #3
0
        /// <summary>
        /// 删除一个tasktype
        /// </summary>
        /// <param name="db">实体数据</param>
        /// <param name="id">一条tasktype的主键</param>
        public void Delete(SysEntities db, string id)
        {
            tasktype deleteItem = GetById(db, id);

            if (deleteItem != null)
            {
                db.tasktype.DeleteObject(deleteItem);
            }
        }
Beispiel #4
0
 /// <summary>
 /// 编辑一个tasktype对象
 /// </summary>
 /// <param name="db">实体数据</param>
 /// <param name="entity">将要编辑的一个tasktype对象</param>
 public tasktype Edit(SysEntities db, tasktype entity)
 {
     db.tasktype.Attach(entity);
     db.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
     return(entity);
 }