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

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

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

            using (xy_sp_outfitDAL dal = new xy_sp_outfitDAL()){
                xy_sp_outfit entity = ModelToEntity(model);
                entity.OutfitID = string.IsNullOrEmpty(model.OutfitID) ? Guid.NewGuid().ToString("N") : model.OutfitID;

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