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