Ejemplo n.º 1
0
 /// <summary>
 /// 获取单条数据
 /// </summary>
 /// <returns></returns>
 public V_ctms_hr_userpost Get(Expression <Func <ctms_hr_userpost, bool> > predicate = null)
 {
     using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
         ctms_hr_userpost entity = dal.Get(predicate);
         return(EntityToModel(entity));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public IEnumerable <V_ctms_hr_userpost> GetList(PageInfo page)
        {
            using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
                var list = dal.Get();

                return(list.Paging(ref page).Select(EntityToModel).ToList());
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool Delete(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return(false);
     }
     using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
         return(dal.Delete(id));
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Edit(V_ctms_hr_userpost model)
        {
            if (model == null)
            {
                return(false);
            }
            using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
                ctms_hr_userpost entitys = ModelToEntity(model);

                return(dal.Edit(entitys));
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable <V_ctms_hr_userpost> Get()
 {
     using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
         List <ctms_hr_userpost>   entitys = dal.Get().ToList();
         List <V_ctms_hr_userpost> list    = new List <V_ctms_hr_userpost>();
         foreach (ctms_hr_userpost item in entitys)
         {
             list.Add(EntityToModel(item));
         }
         return(list);
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Add(V_ctms_hr_userpost model)
        {
            if (model == null)
            {
                return(string.Empty);
            }

            using (ctms_hr_userpostDAL dal = new ctms_hr_userpostDAL()){
                ctms_hr_userpost entity = ModelToEntity(model);
                entity.EMPLOYEEPOSTID = string.IsNullOrEmpty(model.EMPLOYEEPOSTID) ? Guid.NewGuid().ToString("N") : model.EMPLOYEEPOSTID;

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