コード例 #1
0
        public String AddDefectiune(DTO.AddDefectiuneDTO addDefectiuneDTO)
        {
            DAL.defectiune defectiunedal = defectiuneConverter.ConvertDtoToDal(addDefectiuneDTO);

            DbContext.defectiune.Add(defectiunedal);

            DbContext.SaveChanges();

            return("SUCCES");
        }
コード例 #2
0
        public bool UpdateDefectiune(int id, DTO.AddDefectiuneDTO defectiuneDto)
        {
            DAL.defectiune defectiune = (from def in DbContext.defectiune where def.idDefectiune == id select def).FirstOrDefault();

            if (defectiune != null)
            {
                defectiune.nume = defectiuneDto.Nume;
                defectiune.cost = defectiuneDto.Cost;

                DbContext.SaveChanges();
            }
            return(true);
        }