Beispiel #1
0
        public static async Task <int> UpdateAsync(ossContext context, Models.Penznem entity)
        {
            Register.Modification(context, entity);
            await context.SaveChangesAsync();

            return(entity.Penznemkod);
        }
Beispiel #2
0
 public static async Task ExistsAsync(ossContext context, Models.Penznem entity)
 {
     if (await context.Penznem.AnyAsync(s => s.Particiokod == entity.Particiokod &&
                                        s.Penznem1 == entity.Penznem1))
     {
         throw new Exception(string.Format(Messages.MarLetezoTetel, entity.Penznem1));
     }
 }
Beispiel #3
0
 public static async Task ExistsAnotherAsync(ossContext context, Models.Penznem entity)
 {
     if (await context.Penznem.AnyAsync(s => s.Particiokod == entity.Particiokod &&
                                        s.Penznem1 == entity.Penznem1 && s.Penznemkod != entity.Penznemkod))
     {
         throw new Exception(string.Format(Messages.NemMenthetoMarLetezik, entity.Penznem1));
     }
 }
Beispiel #4
0
        public static async Task <int> AddAsync(ossContext context, Models.Penznem entity)
        {
            Register.Creation(context, entity);
            await context.Penznem.AddAsync(entity);

            await context.SaveChangesAsync();

            return(entity.Penznemkod);
        }
Beispiel #5
0
 public static async Task DeleteAsync(ossContext context, Models.Penznem entity)
 {
     context.Penznem.Remove(entity);
     await context.SaveChangesAsync();
 }