Exemple #1
0
 public static DefectServiceModel mapDefectEntityToModel(Defect defect)
 {
     DefectServiceModel model = new DefectServiceModel();
     model.createdDate = defect.CreateDate;
     model.subject = defect.Subject;
     model.description = defect.Description;
     model.environment = defect.Environment;
     model.lastUpdatedDate = defect.LastUpdatedDate;
     model.serverity = mapDefectServerity(defect.Serverity);
     model.status = mapDefectServerity(defect.Status);
     model.id = defect.Id;
     return model;
 }
 public int updateDefect(DefectServiceModel defect)
 {
     DefectsRepository repo = new DefectsRepository(entities);
     throw new NotImplementedException();
 }
 public int insertDefect(DefectServiceModel defect)
 {
     DefectsRepository repo = new DefectsRepository(entities);
     Defect model = new Defect();
     model.CreateDate = DateTime.Now;
     model.Description = defect.description;
     model.Id = 0;
     model.LastUpdatedDate = DateTime.Now;
     model.Serverity = DefectUtil.unmapDefectToServerity(defect.serverity);
     model.Status = DefectUtil.unmapDefectToStatus(defect.status);
     model.Subject = defect.subject;
     return repo.Insert(model);
 }