//public static WSProveedoresCuentas.ProveedoresCuentasSoapClient GetProveedoresCuentasWS()
        //{
        //    var ws = new WSProveedoresCuentas.ProveedoresCuentasSoapClient();
        //    ws.Endpoint.Behaviors.Add(new MyFaultLogger());
        //    return ws;
        //}

        public static WSNotificaciones.NotificacionesSoapClient GetNotificacionesWS()
        {
            var ws = new WSNotificaciones.NotificacionesSoapClient();

            ws.Endpoint.Behaviors.Add(new MyFaultLogger());
            return(ws);
        }
        public ActionResult GetMensaje(long pMsgId)
        {
            WSNotificaciones.NotificacionesSoapClient wsClient = new WSNotificaciones.NotificacionesSoapClient();
            wsClient.Open();
            string sReturn = wsClient.GetMensaje(pMsgId);

            wsClient.Close();
            return(Json(sReturn, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetUsuarios(string grupoId)
        {
            var result = new List <Usuario>();

            try
            {
                int grupo;
                if (int.TryParse(grupoId, out grupo))
                {
                    WSNotificaciones.NotificacionesSoapClient wsClient = ServiceHelper.GetNotificacionesWS();
                    wsClient.Open();
                    DataSet dsUsuarios;
                    if (Session["page"] != null && Session["page"].ToString() == "Liquidaciones")
                    {
                        dsUsuarios = wsClient.GetUsuariosPrestadores(grupo);
                    }
                    else if (Session["page"] != null && Session["page"].ToString() == "EmpleadosLiquidaciones")
                    {
                        dsUsuarios = wsClient.GetUsuariosGerencias(grupo);
                    }
                    else
                    {
                        dsUsuarios = wsClient.GetUsuarios(grupo, 0);
                    }
                    wsClient.Close();
                    DataTable dtUsuarios = dsUsuarios.Tables[0];
                    var       model      = new Notificacion();

                    foreach (DataRow dtRow in dtUsuarios.Rows)
                    {
                        result.Add(new Usuario(dtRow));
                    }
                }
            }
            catch (System.ServiceModel.CommunicationException ex)
            {
            }
            catch (Exception ex)
            {
                //throw;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }