Exemple #1
0
        public 预定DTO GetDTO(int?Id)
        {
            var dTO = new 预定DTO();

            if (Id != null)
            {
                dTO = Mapper.Map <预定DTO>(_iRoomOrderRep.GetById(Id.Value));
            }
            return(dTO);
        }
Exemple #2
0
        public List <预定DTO> List(预定DTO dto)
        {
            var libiao = _iRoomOrderRep.Entities;

            if (dto.CompanyId > 0)
            {
                libiao = libiao.Where(m => m.CompanyId == dto.CompanyId);
            }
            libiao = libiao.OrderByDescending(m => m.Id);
            //var libiao = _iRoomOrderRep.Entities.Where(m => m.CompanyId == 1).OrderByDescending(m => m.Id);
            return(Mapper.Map <List <预定>, List <预定DTO> >(libiao.ToList()));
        }
Exemple #3
0
 public 预定DTO Save(预定DTO dto)
 {
     try
     {
         var model = Mapper.Map <预定> (dto);
         if (dto.Id > 0)
         {
             _iRoomOrderRep.Update(model);
         }
         else
         {
             dto.Id = _iRoomOrderRep.Insert(model);
         }
         //result.code = "0";
         //result.msg = "保存成功";
         return(dto);
     }
     catch (Exception er)
     {
         throw er;
     }
 }
Exemple #4
0
 public 预定DTO Del(预定DTO dto)
 {
     dto.Id = _iRoomOrderRep.Delete(Mapper.Map <预定>(dto));
     return(dto);
 }