Ejemplo n.º 1
0
 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));
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }