public override OperationResult execute(CimetEntities entities) { AspNetRoles role = new AspNetRoles(); role.Name = this.Role.Name; role.Id = this.Role.Uuid; entities.AspNetRoles.Add(role); entities.SaveChanges(); return(base.execute(entities)); }
public override OperationResult execute(CimetEntities entities) { picture slika = new picture(); slika.src = this.Slika.Src; slika.picture_id = this.Slika.PictureId; slika.alt = this.Slika.Alt; entities.picture.Add(slika); entities.SaveChanges(); return(base.execute(entities)); }
public override OperationResult execute(CimetEntities entities) { AspNetRoles role = entities.AspNetRoles.Where(r => r.Id == Role.Uuid).FirstOrDefault(); if (role != null) { role.Name = Role.Name; entities.SaveChanges(); return(base.execute(entities)); } OperationResult result = new OperationResult(); result.Status = false; result.Message = "Uloga ne postoji."; return(result); }
public override OperationResult execute(CimetEntities entities) { picture slika = entities.picture.Where(r => r.picture_id == Slika.PictureId).FirstOrDefault(); if (slika != null) { slika.src = Slika.Src; slika.alt = Slika.Alt; entities.SaveChanges(); return(base.execute(entities)); } OperationResult result = new OperationResult(); result.Status = false; result.Message = "Slika ne postoji."; return(result); }
public override OperationResult execute(CimetEntities entities) { base.criteria.Id = Id; picture slika = entities.picture.Where(r => r.picture_id == Id).FirstOrDefault(); if (slika != null) { entities.picture.Remove(slika); entities.SaveChanges(); return(base.execute(entities)); } else { OperationResult result = new OperationResult(); result.Status = false; result.Message = "Slika ne postoji !"; return(result); } }
public override OperationResult execute(CimetEntities entities) { base.criteria.Uuid = Uuid; AspNetRoles role = entities.AspNetRoles.Where(r => r.Id == Uuid && r.AspNetUsers.Count() == 0).FirstOrDefault(); if (role != null) { entities.AspNetRoles.Remove(role); entities.SaveChanges(); return(base.execute(entities)); } else { OperationResult result = new OperationResult(); result.Status = false; result.Message = "Uloga ne postoji ili sadrzi korisnike!"; return(result); } }
public override OperationResult execute(CimetEntities entities) { blog blog = new blog(); blog.name = this.BlogDto.Name; blog.text = this.BlogDto.Text; blog.date_created = DateTime.Now; blog.user_id = this.BlogDto.User_id; blog.picture_id = this.BlogDto.Picture.PictureId; picture p = new picture { src = BlogDto.Picture.Src, alt = BlogDto.Picture.Alt }; entities.blog.Add(blog); entities.SaveChanges(); return(base.execute(entities)); }