Beispiel #1
0
        public async Task <Response <bool> > UpdateOwner(OwnerUpdVM o)
        {
            Response <bool> response = new Response <bool>();

            try
            {
                using (var dc = new RentAppEntities())
                {
                    var query = dc.spUpdOwner(o.IdOwner, o.Name, o.Address, o.Phone, o.User, o.Icon, o.IconString, o.Password, o.Status);
                    if (query == -1)
                    {
                        response.Count   = 1;
                        response.Message = null;
                        response.Result  = true;
                    }
                    else
                    {
                        response.Count   = 0;
                        response.Message = "No se pudo actualizar el propietario";
                        response.Result  = false;
                    }
                }
                return(response);
            }
            catch (Exception ex)
            {
                response.Count   = 0;
                response.Message = ex.Message;
                response.Result  = false;
                return(response);
            }
        }
Beispiel #2
0
        public async Task <IHttpActionResult> UpdateOwner(OwnerUpdVM ownervm)
        {
            //obtiene si tiene mensajes pendientes de leer en general retorna true o false
            var response = await owner.UpdateOwner(ownervm);

            return(Ok(response));
        }
Beispiel #3
0
        public async Task <IHttpActionResult> UpdateOwner(OwnerUpdVM ownervm)
        {
            //obtiene si tiene mensajes pendientes de leer en general retorna true o false
            var response = await owner.UpdateOwner(ownervm);

            Notifications.Instance.NotificationsMessage(ownervm.IdAdmin, 2, $"El propietario {ownervm.Name} ha actualizado sus datos");
            return(Ok(response));
        }