Exemplo n.º 1
0
 public void Delete(int id)
 {
     using (var db = new RepTecUnitOfWork())
     {
         db.NomenclatureInRequestRepository.Delete(id);
         db.Commit();
     }
 }
 public void Delete(int id)
 {
     using (var db = new RepTecUnitOfWork())
     {
         db.RepairRequestsRepository.Delete(id);
         db.Commit();
     }
 }
Exemplo n.º 3
0
 public void Insert(Repairer repairer)
 {
     using (var db = new RepTecUnitOfWork())
     {
         db.RepairersRepository.Insert(repairer);
         db.Commit();
     }
 }
Exemplo n.º 4
0
 public void Update(Repairer repairer)
 {
     using (var db = new RepTecUnitOfWork())
     {
         db.RepairersRepository.Update(repairer);
         db.Commit();
     }
 }
Exemplo n.º 5
0
        public void Insert(NomenclatureInRequest nomenclatureInRequest)
        {
            using (var db = new RepTecUnitOfWork())
            {
                var nomenclature = db.NomenclatureRepository.GetByСondition(t => t.Id == nomenclatureInRequest.Nomenclature.Id);
                nomenclatureInRequest.Nomenclature = nomenclature;

                db.NomenclatureInRequestRepository.Insert(nomenclatureInRequest);
                db.Commit();
            }
        }
Exemplo n.º 6
0
 public void Insert(Nomenclature nomenclature)
 {
     nomenclature.Price = Math.Round(nomenclature.Price, 2);
     using (var db = new RepTecUnitOfWork())
     {
         var type = db.NomenclatureTypesRepository.GetByСondition(t => t.Id == nomenclature.Type.Id);
         nomenclature.Type = type;
         db.NomenclatureRepository.Insert(nomenclature);
         db.Commit();
     }
 }
        public void Update(RepairRequest repairRequest)
        {
            using (var db = new RepTecUnitOfWork())
            {
                var status = db.RepairStatusesRepository.GetByСondition(s => s.Id == repairRequest.Status.Id);
                repairRequest.Status = status;

                var equipmentToBeRepaired = db.NomenclatureRepository.GetByСondition(n => n.Id == repairRequest.EquipmentToBeRepaired.Id);
                repairRequest.EquipmentToBeRepaired = equipmentToBeRepaired;

                var repairer = db.RepairersRepository.GetByСondition(r => r.Id == repairRequest.Repairer.Id);
                repairRequest.Repairer = repairer;

                db.RepairRequestsRepository.Update(repairRequest);
                db.Commit();
            }
        }