Exemple #1
0
 public void editSpecificationMobile(SpecificationMobile entity)
 {
     try
     {
         var mobile  = db.Specifications.Where(x => x.catalogid == entity.id).FirstOrDefault();
         var smobile = db.SpecificationsMobiles.Where(x => x.catalogid == entity.id).FirstOrDefault();
         SpecificationsMapper.mobileMapper(mobile, smobile, entity);
         db.SaveChanges();
     }
     catch (Exception)
     {
         throw new Exception("Cập nhật thông số kĩ thuật điện thoại lỗi");
     }
 }
Exemple #2
0
 public static void mobileMapper(Specification mobile, SpecificationsMobile smobile, SpecificationMobile entity)
 {
     mobile.os              = entity.Specification.os;
     mobile.ram             = entity.Specification.ram;
     mobile.screen          = entity.Specification.screen;
     mobile.cpu             = entity.Specification.cpu;
     smobile.internalmemory = entity.SpecificationsMobile.internalmemory;
     smobile.memorystick    = entity.SpecificationsMobile.memorystick;
     smobile.sim            = entity.SpecificationsMobile.sim;
     smobile.batery         = entity.SpecificationsMobile.batery;
     smobile.backcamera     = entity.SpecificationsMobile.backcamera;
     smobile.frontcamera    = entity.SpecificationsMobile.frontcamera;
 }