public bool Save(Core.Models.Cinema obj, ref string message) { if (obj.Id == 0) { return(Add(obj, ref message)); } else { return(Update(obj.Id, obj)); } }
public bool Remove(Core.Models.Cinema obj) { bool state = false; uow.Cinemas.Remove(obj); int result = uow.Complete(); if (result > 0) { state = true; } return(state); }
private bool Update(long Id, Core.Models.Cinema obj) { bool state = false; var objEx = uow.Cinemas.Get(obj.Id); objEx = obj; objEx.Id = Id; uow.Cinemas.Update(Id, objEx); int result = uow.Complete(); if (result > 0) { state = true; } return(state); }
private bool Add(Core.Models.Cinema obj, ref string message) { bool state = false; // Check if there is an existing name if (!uow.Cinemas.IsExists(obj)) { uow.Cinemas.Add(obj); int result = uow.Complete(); if (result > 0) { state = true; } } else { message = "Data Exists!"; } return(state); }