예제 #1
0
 /// <summary>
 /// 获取单条数据
 /// </summary>
 /// <returns></returns>
 public V_ctms_pm_task Get(Expression <Func <ctms_pm_task, bool> > predicate = null)
 {
     using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
         ctms_pm_task entity = dal.Get(predicate);
         return(EntityToModel(entity));
     }
 }
예제 #2
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public IEnumerable <V_ctms_pm_task> GetList(PageInfo page)
        {
            using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
                var list = dal.Get();

                return(list.Paging(ref page).Select(EntityToModel).ToList());
            }
        }
예제 #3
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool Delete(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return(false);
     }
     using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
         return(dal.Delete(id));
     }
 }
예제 #4
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Edit(V_ctms_pm_task model)
        {
            if (model == null)
            {
                return(false);
            }
            using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
                ctms_pm_task entitys = ModelToEntity(model);

                return(dal.Edit(entitys));
            }
        }
예제 #5
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable <V_ctms_pm_task> Get()
 {
     using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
         List <ctms_pm_task>   entitys = dal.Get().ToList();
         List <V_ctms_pm_task> list    = new List <V_ctms_pm_task>();
         foreach (ctms_pm_task item in entitys)
         {
             list.Add(EntityToModel(item));
         }
         return(list);
     }
 }
예제 #6
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Add(V_ctms_pm_task model)
        {
            if (model == null)
            {
                return(string.Empty);
            }

            using (ctms_pm_taskDAL dal = new ctms_pm_taskDAL()){
                ctms_pm_task entity = ModelToEntity(model);
                entity.TASKID = string.IsNullOrEmpty(model.TASKID) ? Guid.NewGuid().ToString("N") : model.TASKID;

                return(dal.Add(entity));
            }
        }