public static PhieuPhatDTO MappingDTO(this PhieuPhat pp)
 {
     if (!(pp.ChiTietPhieuPhats == null))
     {
         return(new PhieuPhatDTO
         {
             MaPP = pp.MaPP,
             MaDG = pp.MaDG,
             TongPhiPhat = pp.TongPhiPhat,
             UserId = pp.UserId,
             trangthai = pp.trangthai,
             ChiTietPhieuPhats = pp.ChiTietPhieuPhats.MappingDtos().ToList()
         });
     }
     else
     {
         return(new PhieuPhatDTO
         {
             MaPP = pp.MaPP,
             MaDG = pp.MaDG,
             TongPhiPhat = pp.TongPhiPhat,
             UserId = pp.UserId,
             trangthai = pp.trangthai,
         });
     }
 }
 public static void MappingPhieuPhat(this PhieuPhatDTO ppDTO, PhieuPhat pp)
 {
     pp.MaPP        = ppDTO.MaPP;
     pp.MaDG        = ppDTO.MaDG;
     pp.TongPhiPhat = ppDTO.TongPhiPhat;
     pp.UserId      = ppDTO.UserId;
     pp.trangthai   = ppDTO.trangthai;
     if (ppDTO.ChiTietPhieuPhats != null)
     {
         pp.ChiTietPhieuPhats = ppDTO.ChiTietPhieuPhats.MappingCTPPs().ToList();
     }
 }
Exemple #3
0
 public static int sua_PP(PhieuPhat a)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@sopp", a.SoPP),
         new SqlParameter("@ngaylap", a.NgayLap),
         new SqlParameter("@loivp", a.LoiVP),
         new SqlParameter("@tienphat", a.TienPhat),
         new SqlParameter("@tensach", a.TenSach),
         new SqlParameter("@sopmt", a.SoPMT),
     };
     return(DataProvider.ExecuteNonQuery("sua_PP", para));
 }
Exemple #4
0
 public static int sua_PP(PhieuPhat a)
 {
     return(DAO.sua_PP(a));
 }
Exemple #5
0
 public static int them_PP(PhieuPhat a)
 {
     return(DAO.them_PP(a));
 }