Exemplo n.º 1
0
        public ActionResult Post(bool IsNew, Detalle_de_Invitado_de_NotificacionModel varDetalle_de_Invitado_de_Notificacion)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (!_tokenManager.GenerateToken())
                    {
                        return(Json(null, JsonRequestBehavior.AllowGet));
                    }
                    _IDetalle_de_Invitado_de_NotificacionApiConsumer.SetAuthHeader(_tokenManager.Token);



                    var result = "";
                    var Detalle_de_Invitado_de_NotificacionInfo = new Detalle_de_Invitado_de_Notificacion
                    {
                        Folio                = varDetalle_de_Invitado_de_Notificacion.Folio
                        , Nombre_Completo    = varDetalle_de_Invitado_de_Notificacion.Nombre_Completo
                        , Telefono           = varDetalle_de_Invitado_de_Notificacion.Telefono
                        , Correo_Electronico = varDetalle_de_Invitado_de_Notificacion.Correo_Electronico
                        , Estado             = varDetalle_de_Invitado_de_Notificacion.Estado
                        , Municipio          = varDetalle_de_Invitado_de_Notificacion.Municipio
                        , Poblacion          = varDetalle_de_Invitado_de_Notificacion.Poblacion
                        , Colonia            = varDetalle_de_Invitado_de_Notificacion.Colonia
                        , Codigo_Postal      = varDetalle_de_Invitado_de_Notificacion.Codigo_Postal
                        , Calle              = varDetalle_de_Invitado_de_Notificacion.Calle
                        , Numero_Exterior    = varDetalle_de_Invitado_de_Notificacion.Numero_Exterior
                        , Numero_Interior    = varDetalle_de_Invitado_de_Notificacion.Numero_Interior
                    };

                    result = !IsNew?
                             _IDetalle_de_Invitado_de_NotificacionApiConsumer.Update(Detalle_de_Invitado_de_NotificacionInfo, null, null).Resource.ToString() :
                                 _IDetalle_de_Invitado_de_NotificacionApiConsumer.Insert(Detalle_de_Invitado_de_NotificacionInfo, null, null).Resource.ToString();

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_Invitado_de_NotificacionApiConsumer.SetAuthHeader(_tokenManager.Token);

                Detalle_de_Invitado_de_Notificacion varDetalle_de_Invitado_de_Notificacion = null;
                if (id.ToString() != "0")
                {
                    string where = "";
                }
                var result = _IDetalle_de_Invitado_de_NotificacionApiConsumer.Delete(id, null, null).Resource;
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }