Esempio n. 1
0
 public static unsafe ErrorCode XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke pKeystroke)
 {
     pKeystroke = new Keystroke();
     try { return(GetMethod <XInputGetKeystrokeDelegate>("XInputGetKeystroke")(dwUserIndex, dwReserved, out pKeystroke)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 2
0
 public void RemoveHooks()
 {
     if (IsInitialized)
     {
         GetMethod <RENDERDOC_RemoveHooks>(RenderDocAPIFunction.RemoveHooks)();
     }
 }
Esempio n. 3
0
 public void Shutdown()
 {
     if (IsInitialized)
     {
         GetMethod <RENDERDOC_Shutdown>(RenderDocAPIFunction.Shutdown)();
     }
 }
Esempio n. 4
0
    IEnumerator StartEvent()
    {
        if (delay > 0)
        {
            yield return(new WaitForSeconds(delay));
        }

        if (stopped)
        {
            yield return(null);
        }

        var optionsHash = tweenHash.ToHashtable();

        /*
         * var optionsHash = new Hashtable();
         * //foreach(var pair in Values) {
         * foreach(var pair in tweenHash.Values) {
         *      if("path" == pair.Key && pair.Value.GetType() == typeof(string)) optionsHash.Add(pair.Key, iTweenPath.GetPath((string)pair.Value));
         *      else optionsHash.Add(pair.Key, pair.Value);
         * }
         */

        // We use the internalName to have a unique identifier to stop the tween
        internalName = string.IsNullOrEmpty(tweenName) ? string.Empty : tweenName;
        internalName = string.Format("{0}-{1}", internalName, System.Guid.NewGuid().ToString());
        optionsHash.Add("name", internalName);

        GetMethod(tweenHash.type)(gameObject, optionsHash);
    }
Esempio n. 5
0
 public static unsafe ErrorCode XInputGetCapabilities(int dwUserIndex, DeviceQueryType dwFlags, out Capabilities pCapabilities)
 {
     pCapabilities = new Capabilities();
     try { return(GetMethod <XInputGetCapabilitiesDelegate>("XInputGetCapabilities")(dwUserIndex, (int)dwFlags, out pCapabilities)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 6
0
 public static unsafe ErrorCode XInputGetBatteryInformation(int userIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     batteryInformation = new BatteryInformation();
     try { return(GetMethod <XInputGetBatteryInformationDelegate>("XInputGetBatteryInformation")(userIndex, (int)devType, out batteryInformation)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 7
0
 public static unsafe ErrorCode XInputGetDSoundAudioDeviceGuids(int dwUserIndex, out Guid dSoundRenderGuid, out Guid dSoundCaptureGuid)
 {
     dSoundRenderGuid  = new Guid();
     dSoundCaptureGuid = new Guid();
     try { return(GetMethod <XInputGetDSoundAudioDeviceGuidsDelegate>("XInputGetDSoundAudioDeviceGuids")(dwUserIndex, out dSoundRenderGuid, out dSoundCaptureGuid)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 8
0
 public static unsafe ErrorCode XInputGetAudioDeviceIds(int dwUserIndex, IntPtr renderDeviceIdRef, IntPtr renderCountRef, IntPtr captureDeviceIdRef, IntPtr captureCountRef)
 {
     if (!IsGetAudioDeviceIdsSupported)
     {
         return(ErrorCode.NotSupported);
     }
     try { return(GetMethod <XInputGetAudioDeviceIdsDelegate>("XInputGetAudioDeviceIds")(dwUserIndex, renderDeviceIdRef, renderCountRef, captureDeviceIdRef, captureCountRef)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 9
0
        public static unsafe ErrorCode XInputGetState(int dwUserIndex, out State pState)
        {
            var functionName = "XInputGetState";

            //if (IsGetStateExSupported) functionName = "XInputGetStateEx";
            pState = new State();
            try { return(GetMethod <XInputGetStateDelegate>(functionName)(dwUserIndex, out pState)); }
            catch (AccessViolationException ex) { throw new Exception(ex.Message); }
            catch (Exception) { throw; }
        }
Esempio n. 10
0
        public void EndFrameCapture(GraphicsDevice graphicsDevice, IntPtr hwndPtr)
        {
            if (!isCaptureStarted)
            {
                return;
            }

            GetMethod <RENDERDOC_EndFrameCapture>(RenderDocAPIFunction.EndFrameCapture)(GetDevicePointer(graphicsDevice), hwndPtr);
            isCaptureStarted = false;
        }
Esempio n. 11
0
 public static ErrorCode Reset()
 {
     if (!IsResetSupported)
     {
         return(ErrorCode.NotSupported);
     }
     try { return(GetMethod <ResetDelegate>("Reset")()); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 12
0
                public override async Task Invoke(IMessage msg, ServerDomainMessage rawMessage, CancellationToken token)
                {
                    var    obj   = _target();
                    var    spec  = (obj as ISpecificationProviderBase)?.GetSpecification();
                    string error = null;

                    if (spec != null && !spec.IsSatisfiedBy(msg))
                    {
                        error = spec.Message;
                    }

                    await(Task) GetMethod()(obj, msg, error);
                }
Esempio n. 13
0
        public unsafe void Initialize(string captureFilePath = null)
        {
            var finalLogFilePath = captureFilePath ?? FindAvailablePath("RenderDoc" + Assembly.GetEntryAssembly().Location);

            GetMethod <RENDERDOC_SetCaptureFilePathTemplate>(RenderDocAPIFunction.SetCaptureFilePathTemplate)(finalLogFilePath);

            var focusToggleKey = KeyButton.eRENDERDOC_Key_F11;

            GetMethod <RENDERDOC_SetFocusToggleKeys>(RenderDocAPIFunction.SetFocusToggleKeys)(ref focusToggleKey, 1);
            var captureKey = KeyButton.eRENDERDOC_Key_F12;

            GetMethod <RENDERDOC_SetCaptureKeys>(RenderDocAPIFunction.SetCaptureKeys)(ref captureKey, 1);
        }
Esempio n. 14
0
        // Matching https://github.com/baldurk/renderdoc/blob/master/renderdoc/api/app/renderdoc_app.h

        public unsafe RenderDocManager(string logFilePath = null)
        {
            var finalLogFilePath = FindAvailablePath((logFilePath ?? "RenderDoc" + Assembly.GetEntryAssembly().Location));

            var reg = Registry.ClassesRoot.OpenSubKey("CLSID\\" + RenderdocClsid + "\\InprocServer32");

            if (reg == null)
            {
                return;
            }
            var path = reg.GetValue(null) != null?reg.GetValue(null).ToString() : null;

            if (string.IsNullOrEmpty(path) || !File.Exists(path))
            {
                return;
            }

            // Preload the library before using the UnmanagedFunctionPointerAttribute
            var ptr = LoadLibrary(path);

            if (ptr == IntPtr.Zero)
            {
                return;
            }

            var getAPIAddress = GetProcAddress(ptr, nameof(RENDERDOC_GetAPI));

            if (getAPIAddress == IntPtr.Zero)
            {
                return;
            }

            // Get main entry point to get other function pointers
            var getAPI = Marshal.GetDelegateForFunctionPointer <RENDERDOC_GetAPI>(getAPIAddress);

            // API version 10101 has 23 function pointers
            if (!getAPI(RENDERDOC_API_VERSION, ref apiPointers))
            {
                return;
            }

            GetMethod <RENDERDOC_SetLogFilePathTemplate>(RenderDocAPIFunction.SetLogFilePathTemplate)(finalLogFilePath);

            var focusToggleKey = KeyButton.eRENDERDOC_Key_F11;

            GetMethod <RENDERDOC_SetFocusToggleKeys>(RenderDocAPIFunction.SetFocusToggleKeys)(ref focusToggleKey, 1);
            var captureKey = KeyButton.eRENDERDOC_Key_F12;

            GetMethod <RENDERDOC_SetCaptureKeys>(RenderDocAPIFunction.SetCaptureKeys)(ref captureKey, 1);
        }
Esempio n. 15
0
        public AuthListOutputList GetAuthList(AuthList model)
        {
            var query = "";
            var list  = new AuthListOutputList();

            try
            {
                var os   = new OSRepository();
                var osId = os.GetOSbyId(model.OsId);


                query += "SELECT Distinct";
                query += "                a.nid_autorizacion, ";
                query += "                CNRO_AUTORIZACION, ";
                query += "                DFEC_AUTORIZACION, ";
                query += "                NNRO_PRE, ";
                query += "                CNOM_AFILIADO, ";
                query += "                NNRO_AFILIADO, ";
                query += "               (select LISTAGG(ccodprest, ',') WITHIN GROUP(ORDER BY ccodprest ) from autorizaciones_detalle AD1 where AD1.nid_autorizacion = ad.nid_autorizacion) AS Prestacion,";
                query += "               (select count(*) from autorizaciones_detalle AD1 where AD1.nid_autorizacion = ad.nid_autorizacion) as NCantidad, ";
                query += "               A.ESTADO_AUTORIZACION, ";
                query += "               NVL(A.CCOD_ANULACION, '') as CCOD_ANULACION, ";
                query += "               NVL(PRESENTACIONID, '') as PRESENTACIONID, ";
                query += "               NVL(A.MODOTIPO,'M') as MODOTIPO ";
                query += " FROM AUTORIZACIONES A ";
                query += " inner join autorizaciones_detalle AD on a.nid_autorizacion = ad.nid_autorizacion ";
                query += " inner join prestador P on A.IDPRE = P.IDPRE ";
                query += " WHERE A.IDPRE = " + model.PrestadorId + " AND A.NCODOSOC = " + osId + " AND DFEC_AUTORIZACION >= TO_DATE('" + model.Desde + "', 'DD/MM/YYYY') AND DFEC_AUTORIZACION <= TO_DATE('" + model.Hasta + "', 'DD/MM/YYYY HH24:MI') ";
                query += " Order by DFEC_AUTORIZACION DESC, a.nid_autorizacion Desc ";

                var c  = new Connection();
                var dt = c.Query(query);

                foreach (DataRow dr in dt.Rows)
                {
                    var strFech = dr.ItemArray[2].ToString();
                    var index   = strFech.IndexOf(' ');
                    var banda   = dr.ItemArray[11].ToString().Trim() == "B" ? " (B)" : "";
                    var auth    = new AuthListOutput
                    {
                        Id         = Convert.ToInt32(dr.ItemArray[0]),
                        AuthNr     = (dr.ItemArray[9].ToString().Trim() != "" ? dr.ItemArray[9].ToString() : dr.ItemArray[1].ToString()) + banda, // dr.ItemArray[9]. = Cod Anulacion;  dr.ItemArray[1]= Cod Autorizacion
                        Fecha      = (index > 0 ? strFech.Substring(0, index).Trim() : strFech.Trim()),
                        Matricula  = dr.ItemArray[3].ToString(),
                        Afiliado   = dr.ItemArray[4].ToString(),
                        AfiNr      = dr.ItemArray[5].ToString(),
                        Prestacion = dr.ItemArray[6].ToString(),
                        Cant       = dr.ItemArray[7].ToString(),
                        Estado     = dr.ItemArray[8].ToString(),
                        Presentado = dr.ItemArray[8].ToString().Trim() != ""
                    };
                    list.List.Add(auth);
                }
            }
            catch (Exception ex)
            {
                list.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", model, query);
            }
            return(list);
        }
Esempio n. 16
0
        public void Show()
        {
            do
            {
                //друк меню
                for (int i = 0; i < MenuItem.Count; i++)
                {
                    if (i == ActiveItem)
                    {
                        SetColorText(PosXmenu, PosYmenu + i, MenuItem[i].Item1, ActiveMenuColor);
                    }
                    else
                    {
                        SetColorText(PosXmenu, PosYmenu + i, MenuItem[i].Item1, PassiveMenuColor);
                    }
                }
                SetColorText(PosXmenu, PosYmenu - 1, "  МЕНЮ", ConsoleColor.Green);

                //перевірка нажаття клавіш
                key = Console.ReadKey();
                if (key.Key == ConsoleKey.DownArrow && ActiveItem < MenuItem.Count - 1)
                {
                    ActiveItem++;
                }
                if (key.Key == ConsoleKey.UpArrow && ActiveItem > 0)
                {
                    ActiveItem--;
                }
            }//вихі якщо нажади Ентер
            while (key.Key != ConsoleKey.Enter);
            // Console.Clear();
            Method = MenuItem[ActiveItem].Item2;
            Method.Invoke();
        }
Esempio n. 17
0
        public Efector DatosPrestadorByNnroPre(int nnroPre)
        {
            var efector = new Efector();
            var query   = "";

            try
            {
                var c = new Connection();
                query = "SELECT rtrim(CAPE_NOM), TRIM(CNRO_DGI), NNRO_PRE, EMAIL FROM PRESTADOR WHERE NNRO_PRE  = " + nnroPre;
                var dt = c.Query(query);

                foreach (DataRow dr in dt.Rows)
                {
                    efector.Name      = dr.ItemArray[0].ToString().Trim();
                    efector.Cuit      = dr.ItemArray[1].ToString().Trim();
                    efector.Matricula = Convert.ToInt32(dr.ItemArray[2]);
                    efector.Email     = dr.ItemArray[3].ToString().Trim();
                }
            }
            catch (Exception ex)
            {
                efector.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", nnroPre, query);
            }
            return(efector);
        }
Esempio n. 18
0
        public Anular GetAuthDataById(int authId)
        {
            var anular = new Anular();
            var query  = "";

            try
            {
                query  = "SELECT  A.NCODOSOC, A.NID_AUTORIZACION, P.NNro_Pre, A.NNRO_AFILIADO, P.CNRO_DGI";
                query += " FROM AUTORIZACIONES A";
                query += " INNER JOIN Prestador P ON P.Idpre = A.Idpre";
                query += " WHERE NID_AUTORIZACION =" + authId;

                var c  = new Connection();
                var dt = c.Query(query);

                foreach (DataRow dr in dt.Rows)
                {
                    anular = new Anular
                    {
                        OSId       = Convert.ToInt32(dr.ItemArray[0]),
                        AuthId     = Convert.ToInt32(dr.ItemArray[1].ToString().Trim()),
                        Matricula  = dr.ItemArray[2].ToString(),
                        Credencial = dr.ItemArray[3].ToString(),
                        Cuit       = dr.ItemArray[4].ToString()
                    };
                }

                return(anular);
            }
            catch (Exception ex)
            {
                anular.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, authId, query);
            }
            return(anular);
        }
Esempio n. 19
0
        public List <Prestador> Prestadores(string id)
        {
            var query = "";

            try
            {
                if (id != string.Empty)
                {
                    query = "SELECT UP.IDPRE, CAPE_NOM, UP.CLASIF_USUARIO FROM USUARIOS_PRESTADORES UP, PRESTADOR P WHERE P.NESTADO=0 AND UP.IDPRE=P.IDPRE AND UP.NID_USUARIO=" + id;
                    var c  = new Connection();
                    var dt = c.Query(query);

                    var list = (from DataRow dr in dt.Rows
                                select new Prestador
                    {
                        Id = Convert.ToInt32(dr.ItemArray[0]),
                        Name = dr.ItemArray[1].ToString().Trim(),
                        Type = Convert.ToInt32(dr.ItemArray[2])
                    }).ToList();

                    return(list);
                }
            }
            catch (Exception ex)
            {
                var errors = new Errores();
                errors.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, id, query);
            }
            return(null);
        }
Esempio n. 20
0
        public int GetAuthCount(PresentacionNew model)
        {
            var query = "";

            try
            {
                query  = "SELECT COUNT(*) FROM Autorizaciones WHERE estado_autorizacion = 'Autorizada'";
                query += " AND ncodosoc = " + model.CmsOsId;
                query += " AND IDPre = " + model.Matricula;
                query += " AND dfec_autorizacion > TO_DATE('" + model.Desde + "', 'DD/MM/YYYY')";
                query += " AND dfec_autorizacion <= TO_DATE('" + model.Hasta + " 23:58', 'DD/MM/YYYY HH24:MI')";
                query += " AND presentacionId IS NULL";

                var c   = new Connection();
                var obj = c.QueryObject(query);

                return(Convert.IsDBNull(obj) ? 0 : Convert.ToInt32(obj));
            }
            catch (Exception ex)
            {
                var errores = new Errores();
                errores.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", model, query);
                return(0);
            }
        }
Esempio n. 21
0
        public PresentacionSaved SetPresentacion(PresentacionNew model, PresentacionSaved modelSaved)
        {
            var query = "";

            try
            {
                var c = new Connection();

                query  = "UPDATE Autorizaciones ";
                query += " SET PresentacionId = " + modelSaved.Id;
                query += " WHERE estado_autorizacion = 'Autorizada'";
                query += " AND ncodosoc = " + model.CmsOsId;
                query += " AND IDPre = " + model.Matricula;
                query += " AND dfec_autorizacion > TO_DATE('" + model.Desde + "', 'DD / MM / YYYY')";
                query += " AND dfec_autorizacion <= TO_DATE('" + model.Hasta + "', 'DD / MM / YYYY HH24: MI')";
                query += " AND presentacionId IS NULL";

                c.QueryNoResult(query);
            }
            catch (Exception ex)
            {
                modelSaved.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", model, query);
            }
            return(modelSaved);
        }
Esempio n. 22
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((GetMethod != null ? GetMethod.GetHashCode() : 0) * 397) ^ (SetMethod != null ? SetMethod.GetHashCode() : 0));
     }
 }
Esempio n. 23
0
        public Afiliado Eligibilidad(string credencial)
        {
            var afiliado = new Afiliado();

            try
            {
                var output = "MSH|^~\\&|TRIA0100M|TRIA00007160|MEDIFE|MEDIFE^222222^IIN|";
                output += DateTime.Now.ToString("yyyyMMddHHmmss") + "||ZQI^Z01^ZQI_Z01|05091908480623465897|P|2.4|||NE|AL|ARG";
                output += Environment.NewLine;
                output += "PRD|PS^CIRCULO MEDICO DE SALTA||^^^C||||30543364610^CU|";

                output += Environment.NewLine;
                output += "PID|||" + credencial + "^^^MEDIFE^HC^MEDIFE||UNKNOWN";
                output += Environment.NewLine;

                var resultado = _traditum.Send(output);
                logResult(output.ToString(), resultado.ToString(), "E");

                if (resultado == "")
                {
                    return new Afiliado {
                               Name = Mensajes.Get("AfiIne")
                    }
                }
                ;

                if (resultado.Contains("Error ejecutando") || resultado.Contains("no se pueden procesar") || resultado.Contains("Unable to read data"))
                {
                    return(new Afiliado {
                        Name = Mensajes.Get("ServidorNoResponde"), HasError = true
                    });
                }

                // convertimos respuesta en vector
                var msHL7 = HL7.DecifraHL7(resultado);
                var index = msHL7[1].IndexOf("En estos momentos, no se pueden procesar transacciones");
                if (index > 0)
                {
                    afiliado.Name = Mensajes.Get("ServidorNoResponde");
                    afiliado.SetError(GetType().Name, 37, Mensajes.Get("ServidorNoResponde"), string.Empty, credencial, string.Empty);
                }
                else
                {
                    if (HL7.CampoHL7(msHL7[2], 3, 1) == "B000")
                    {
                        afiliado.Name = HL7.CampoHL7(msHL7[4], 5, 1) + ", " + HL7.CampoHL7(msHL7[4], 5, 2);
                        afiliado.Plan = HL7.CampoHL7(msHL7[5], 2, 0);
                    }
                    else
                    {
                        afiliado.Name = Mensajes.Get("AfiIne");
                    }
                }
            }
            catch (Exception ex)
            {
                afiliado.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", credencial, string.Empty);
            }
            return(afiliado);
        }
Esempio n. 24
0
        public AnulacionOS Anular(Anular model)
        {
            var anulacionOs = new AnulacionOS();

            try
            {
                var authRepo      = new AutorizacionRepository();
                var sIdInternoAut = authRepo.GetIdAuth(model.AuthId);

                var output = "MSH|^~\\&|TRIA0100M|TRIA00007160|MEDIFE|MEDIFE^222222^IIN|";
                output += DateTime.Now.ToString("yyyyMMddHHmmss") + "||ZQA^Z04^ZQA_Z02|10121509341187324160|P|2.4|||NE|AL|ARG";
                output += Environment.NewLine;
                output += "ZAU||" + sIdInternoAut;
                output += Environment.NewLine;
                output += "PRD|PS^CIRCULO MEDICO DE SALTA||^^^C||||30543364610^CU|";
                output += Environment.NewLine;
                output += "PID|||" + model.Credencial + "^^^MEDIFE^HC^MEDIFE||UNKNOWN";

                var resultado = _traditum.Send(output);
                logResult(output.ToString(), resultado.ToString(), "D");

                if (resultado.Substring(0, 4) == "MSH|")
                {
                    return(SetAnulacionOs(resultado, model));
                }
                anulacionOs.SetError(GetType().Name, 0, resultado, string.Empty, model, string.Empty);
            }
            catch (Exception ex)
            {
                anulacionOs.SetError(GetType().Name, GetMethod.ErrorLine(ex), Mensajes.Get("AnulFail"), ex.InnerException?.ToString() ?? "", model, string.Empty);
            }
            return(anulacionOs);
        }
Esempio n. 25
0
        public object QueryObject(string query)
        {
            try
            {
                var c    = new Connection();
                var conn = c.Connect();

                var cmd = new OracleCommand(query, conn)
                {
                    CommandType = CommandType.Text
                };
                conn.Open();

                object lResultado = cmd.ExecuteScalar();

                cmd.Dispose();
                conn.Close();

                return(lResultado);
            }
            catch (Exception ex)
            {
                var errors = new Errores();
                errors.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", query, query);
            }
            return(null);
        }
Esempio n. 26
0
        private AnulacionOS SetAnulacionOs(string data, Anular model)
        {
            var anulacionOs = new AnulacionOS();

            try
            {
                anulacionOs = new AnulacionOS
                {
                    IdAuth  = model.AuthId.ToString(),
                    Nestado = "1",
                    Fecha   = DateTime.Now.ToString(),
                };

                // convertimos respuesta en vector
                var msHL7 = HL7.DecifraHL7(data);

                // número de la transacción tercera línea - ZAU
                anulacionOs.CodAnulacion = HL7.CampoHL7(msHL7[2], 2, 0);

                // resultado autorización tercera línea - ZAU
                var sEstado = HL7.CampoHL7(msHL7[2], 3, 1);

                anulacionOs.Estado = sEstado == "B000" ? "OK" : "NO";
            }
            catch (Exception ex)
            {
                anulacionOs.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", model, string.Empty);
            }
            return(anulacionOs);
        }
Esempio n. 27
0
        public PrestadorData GetInfoFromIdPre(string idPre)
        {
            var prestadorData = new PrestadorData();
            var query         = "";

            try
            {
                query = "SELECT IDPRE, NNRO_PRE, CAPE_NOM FROM Prestador WHERE idpre = " + idPre;
                var c  = new Connection();
                var dt = c.Query(query);

                List <PrestadorData> list = (from DataRow dr in dt.Rows
                                             select new PrestadorData
                {
                    Id = Convert.ToInt32(dr.ItemArray[0]),
                    Matricula = dr.ItemArray[1].ToString().Trim(),
                    Name = dr.ItemArray[2].ToString().Trim()
                }).ToList();
                prestadorData = list[0];
                return(prestadorData);
            }
            catch (Exception ex)
            {
                var errors = new Errores();
                errors.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", idPre, query);
                return(prestadorData);
            }
        }
Esempio n. 28
0
 public override void SetMasterDefinition(Member master)
 {
     base.SetMasterDefinition(master);
     ImplicitField?.SetMasterDefinition(((Property) master)?.ImplicitField);
     GetMethod?.SetMasterDefinition(((Property) master)?.GetMethod);
     SetMethod?.SetMasterDefinition(((Property) master)?.SetMethod);
 }
Esempio n. 29
0
        public int Login(string userName, string passWord)
        {
            var iNidUsuario = -1;
            var iNivel      = 0;
            var query       = "";

            try
            {
                query = "select NID_USUARIO, NID_NIVEL from USUARIOS where CLOGIN_USUARIO='" + userName + "' and CCLAVE_USUARIO='" + passWord + "'";
                var c  = new Connection();
                var dt = c.Query(query);

                foreach (DataRow dr in dt.Rows)
                {
                    iNidUsuario = Convert.ToInt32(dr.ItemArray[0]);
                    iNivel      = Convert.ToInt32(dr.ItemArray[1]);
                }

                OsStatus.TimeOut = null;
            }
            catch (Exception ex)
            {
                OsStatus.TimeOut = DateTime.Now;
                var errors = new Errores();
                errors.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? "", userName + ", " + passWord, query);
            }
            return(iNidUsuario);
        }
Esempio n. 30
0
        private bool Anular(AnulacionOS anulacionOs)
        {
            var query = "";

            try
            {
                query  = "UPDATE Autorizaciones SET Estado_Autorizacion='Anulada', NESTADO=1, DFEC_ESTADO=SYSDATE, CCOD_ANULACION='" + anulacionOs.CodAnulacion + "', dfec_anulacion=SYSDATE";
                query += " WHERE NID_AUTORIZACION=" + anulacionOs.IdAuth;

                var c = new Connection();
                c.QueryNoResult(query);

                query = "UPDATE Autorizaciones_Detalle SET Estado_Autorizacion='Anulada' WHERE Estado_Autorizacion='Autorizada' AND NID_AUTORIZACION=" + anulacionOs.IdAuth;
                c.QueryNoResult(query);

                return(true);
            }
            catch (Exception ex)
            {
                var errores = new Errores {
                    HasError = true
                };
                errores.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, anulacionOs, query);
                return(false);
            }
        }
Esempio n. 31
0
        public static Response GetResponse(Uri url, NetworkCredential credential, GetMethod getMethod, WebHeaderCollection headers)
        {
            var data = new Response() { Success = false, ResponseData = "Unknown", HttpResponse = HttpStatusCode.NoContent, ResponseDescription = "Unknown" };
            try
            {
                WebRequest request = WebRequest.Create(url);
                request.Proxy = null;
                request.Method = getMethod.ToString();

                if (headers != null)
                    request.Headers = headers;

                if (credential != null)
                {
                    request.PreAuthenticate = true;
                    request.Credentials = credential;
                }
                else
                    request.Credentials = CredentialCache.DefaultCredentials;

                WebResponse response = request.GetResponse();
                data.ResponseDescription = ((HttpWebResponse)response).StatusDescription;
                data.HttpResponse = ((HttpWebResponse)response).StatusCode;
                data.ResponseHeaders = ((HttpWebResponse)response).Headers;

                Stream dataStream = response.GetResponseStream();
                StreamReader reader = new StreamReader(dataStream);

                data.ResponseData = reader.ReadToEnd();

                reader.Close();
                response.Close();

                data.Success = true;
            }
            catch (Exception ee)
            {
                data.Success = false;
                data.ResponseData = ee.ToString();
                data.ResponseDescription = ee.Message;
            }

            return data;
        }
        public DefaultPropertyDefinition(TypeDefinition typeDef,
            string name,
            GetMethod getter,
            SetMethod setter,
            string declaringTypeName,
            MemberAccessibility memberAccessibility,
            MemberType memberType)
        {
            if (typeDef == null) throw new ArgumentNullException("typeDef");
            if (name == null) throw new ArgumentNullException("name");
            if (declaringTypeName == null) throw new ArgumentNullException("declaringTypeName");

            Name = name;
            FullName = declaringTypeName + "." + name;
            this.getter = getter;
            this.setter = setter;
            this.memberAccessibility = memberAccessibility;
            this.memberType = memberType;
            TypeDef = typeDef;

            SerializedName = name.IsAutoPropertyBackingField()
                ? name.AutoPropertyName()
                : name;
        }
Esempio n. 33
0
		public override bool Define ()
		{
			if (!base.Define ())
				return false;

			flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;

			if (!IsInterface && (ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 &&
				AccessorSecond != null && Get.Block == null && Set.Block == null) {
				if (Compiler.Settings.Version <= LanguageVersion.ISO_2)
					Report.FeatureIsNotAvailable (Compiler, Location, "automatically implemented properties");

				Get.ModFlags |= Modifiers.COMPILER_GENERATED;
				Set.ModFlags |= Modifiers.COMPILER_GENERATED;
				CreateAutomaticProperty ();
			}

			if (!DefineAccessors ())
				return false;

			if (AccessorSecond == null) {
				PropertyMethod pm;
				if (AccessorFirst is GetMethod)
					pm = new SetMethod (this, 0, ParametersCompiled.EmptyReadOnlyParameters, null, Location);
				else
					pm = new GetMethod (this, 0, null, Location);

				Parent.AddNameToContainer (pm, pm.MemberName.Basename);
			}

			if (!CheckBase ())
				return false;

			DefineBuilders (MemberKind.Property, ParametersCompiled.EmptyReadOnlyParameters);
			return true;
		}
Esempio n. 34
0
 static WmiNetUtilsHelper()
 {
     myDllPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + "\\wminet_utils.dll";
     IntPtr procAddr = IntPtr.Zero;
     IntPtr loadLibrary = IntPtr.Zero;
     loadLibrary =  LoadLibrary(myDllPath);
     if( loadLibrary != IntPtr.Zero)
     {
         procAddr = GetProcAddress(loadLibrary, "ResetSecurity");
         if( procAddr != IntPtr.Zero)
         {
             ResetSecurity_f  =(ResetSecurity) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ResetSecurity));
         }
         procAddr = GetProcAddress(loadLibrary, "SetSecurity");
         if( procAddr != IntPtr.Zero)
         {
             SetSecurity_f  =(SetSecurity) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SetSecurity));
         }
         procAddr = GetProcAddress(loadLibrary, "BlessIWbemServices");
         if( procAddr != IntPtr.Zero)
         {
             BlessIWbemServices_f  =(BlessIWbemServices) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BlessIWbemServices));
         }
         procAddr = GetProcAddress(loadLibrary, "BlessIWbemServicesObject");
         if( procAddr != IntPtr.Zero)
         {
             BlessIWbemServicesObject_f  =(BlessIWbemServicesObject) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BlessIWbemServicesObject));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyHandle");
         if( procAddr != IntPtr.Zero)
         {
              GetPropertyHandle_f27=(GetPropertyHandle) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyHandle));
         }
         procAddr = GetProcAddress(loadLibrary, "WritePropertyValue");
         if( procAddr != IntPtr.Zero)
         {
              WritePropertyValue_f28=(WritePropertyValue) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(WritePropertyValue));
         }
         procAddr = GetProcAddress(loadLibrary, "Clone");
         if( procAddr != IntPtr.Zero)
         {
              Clone_f12=(Clone) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Clone));
         }   
         procAddr = GetProcAddress(loadLibrary, "VerifyClientKey");
         if( procAddr != IntPtr.Zero)
         {
              VerifyClientKey_f  =(VerifyClientKey) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(VerifyClientKey));
         }
         procAddr = GetProcAddress(loadLibrary, "GetQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetQualifierSet_f  =(GetQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "Get");
         if( procAddr != IntPtr.Zero)
         {
             Get_f  =(Get) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Get));
         }
         procAddr = GetProcAddress(loadLibrary, "Put");
         if( procAddr != IntPtr.Zero)
         {
             Put_f  =(Put) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Put));
         }
         procAddr = GetProcAddress(loadLibrary, "Delete");
         if( procAddr != IntPtr.Zero)
         {
             Delete_f  =(Delete) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Delete));
         }
         procAddr = GetProcAddress(loadLibrary, "GetNames");
         if( procAddr != IntPtr.Zero)
         {
             GetNames_f  =(GetNames) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetNames));
         }
         procAddr = GetProcAddress(loadLibrary, "BeginEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             BeginEnumeration_f  =(BeginEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BeginEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "Next");
         if( procAddr != IntPtr.Zero)
         {
             Next_f  =(Next) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Next));
         }
         procAddr = GetProcAddress(loadLibrary, "EndEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             EndEnumeration_f  =(EndEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(EndEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetPropertyQualifierSet_f  =(GetPropertyQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "Clone");
         if( procAddr != IntPtr.Zero)
         {
             Clone_f  =(Clone) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(Clone));
         }
         procAddr = GetProcAddress(loadLibrary, "GetObjectText");
         if( procAddr != IntPtr.Zero)
         {
             GetObjectText_f  =(GetObjectText) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetObjectText));
         }
         procAddr = GetProcAddress(loadLibrary, "SpawnDerivedClass");
         if( procAddr != IntPtr.Zero)
         {
             SpawnDerivedClass_f  =(SpawnDerivedClass) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SpawnDerivedClass));
         }
         procAddr = GetProcAddress(loadLibrary, "SpawnInstance");
         if( procAddr != IntPtr.Zero)
         {
             SpawnInstance_f  =(SpawnInstance) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(SpawnInstance));
         }
         procAddr = GetProcAddress(loadLibrary, "CompareTo");
         if( procAddr != IntPtr.Zero)
         {
             CompareTo_f  =(CompareTo) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CompareTo));
         }
         procAddr = GetProcAddress(loadLibrary, "GetPropertyOrigin");
         if( procAddr != IntPtr.Zero)
         {
             GetPropertyOrigin_f  =(GetPropertyOrigin) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetPropertyOrigin));
         }
         procAddr = GetProcAddress(loadLibrary, "InheritsFrom");
         if( procAddr != IntPtr.Zero)
         {
             InheritsFrom_f  =(InheritsFrom) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(InheritsFrom));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethod");
         if( procAddr != IntPtr.Zero)
         {
             GetMethod_f  =(GetMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "PutMethod");
         if( procAddr != IntPtr.Zero)
         {
             PutMethod_f  =(PutMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "DeleteMethod");
         if( procAddr != IntPtr.Zero)
         {
             DeleteMethod_f  =(DeleteMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(DeleteMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "BeginMethodEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             BeginMethodEnumeration_f  =(BeginMethodEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(BeginMethodEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "NextMethod");
         if( procAddr != IntPtr.Zero)
         {
             NextMethod_f  =(NextMethod) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(NextMethod));
         }
         procAddr = GetProcAddress(loadLibrary, "EndMethodEnumeration");
         if( procAddr != IntPtr.Zero)
         {
             EndMethodEnumeration_f  =(EndMethodEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(EndMethodEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethodQualifierSet");
         if( procAddr != IntPtr.Zero)
         {
             GetMethodQualifierSet_f  =(GetMethodQualifierSet) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethodQualifierSet));
         }
         procAddr = GetProcAddress(loadLibrary, "GetMethodOrigin");
         if( procAddr != IntPtr.Zero)
         {
             GetMethodOrigin_f  =(GetMethodOrigin) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetMethodOrigin));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Get");
         if( procAddr != IntPtr.Zero)
         {
              QualifierGet_f=(QualifierSet_Get) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Get));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Put");
         if( procAddr != IntPtr.Zero)
         {
              QualifierPut_f=(QualifierSet_Put) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Put));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Delete");
         if( procAddr != IntPtr.Zero)
         {
              QualifierDelete_f=(QualifierSet_Delete) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Delete));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_GetNames");
         if( procAddr != IntPtr.Zero)
         {
              QualifierGetNames_f=(QualifierSet_GetNames) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_GetNames));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_BeginEnumeration");
         if( procAddr != IntPtr.Zero)
         {
              QualifierBeginEnumeration_f=(QualifierSet_BeginEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_BeginEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_Next");
         if( procAddr != IntPtr.Zero)
         {
              QualifierNext_f=(QualifierSet_Next) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_Next));
         }
         procAddr = GetProcAddress(loadLibrary, "QualifierSet_EndEnumeration");
         if( procAddr != IntPtr.Zero)
         {
              QualifierEndEnumeration_f=(QualifierSet_EndEnumeration) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(QualifierSet_EndEnumeration));
         }
         procAddr = GetProcAddress(loadLibrary, "GetCurrentApartmentType");
         if( procAddr != IntPtr.Zero)
         {
             GetCurrentApartmentType_f  =(GetCurrentApartmentType) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetCurrentApartmentType));
         }
         procAddr = GetProcAddress(loadLibrary, "GetDemultiplexedStub");
         if( procAddr != IntPtr.Zero)
         {
              GetDemultiplexedStub_f =(GetDemultiplexedStub) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(GetDemultiplexedStub));
         }         
         procAddr = GetProcAddress(loadLibrary, "CreateInstanceEnumWmi");
         if( procAddr != IntPtr.Zero)
         {
             CreateInstanceEnumWmi_f  =(CreateInstanceEnumWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CreateInstanceEnumWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "CreateClassEnumWmi");
         if( procAddr != IntPtr.Zero)
         {
             CreateClassEnumWmi_f  =(CreateClassEnumWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CreateClassEnumWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "ExecQueryWmi");
         if( procAddr != IntPtr.Zero)
         {
             ExecQueryWmi_f  =(ExecQueryWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ExecQueryWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "ExecNotificationQueryWmi");
         if( procAddr != IntPtr.Zero)
         {
             ExecNotificationQueryWmi_f  =(ExecNotificationQueryWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ExecNotificationQueryWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "PutInstanceWmi");
         if( procAddr != IntPtr.Zero)
         {
             PutInstanceWmi_f  =(PutInstanceWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutInstanceWmi));
         } 
         procAddr = GetProcAddress(loadLibrary, "PutClassWmi");
         if( procAddr != IntPtr.Zero)
         {
             PutClassWmi_f  =(PutClassWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(PutClassWmi));
         }
         procAddr = GetProcAddress(loadLibrary, "CloneEnumWbemClassObject");
         if( procAddr != IntPtr.Zero)
         {
             CloneEnumWbemClassObject_f  =(CloneEnumWbemClassObject) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(CloneEnumWbemClassObject));
         }
         procAddr = GetProcAddress(loadLibrary, "ConnectServerWmi");
         if( procAddr != IntPtr.Zero)
         {
             ConnectServerWmi_f  =(ConnectServerWmi) Marshal.GetDelegateForFunctionPointer(procAddr, typeof(ConnectServerWmi));
         }
         
     }
 }
Esempio n. 35
0
        public Property(DeclSpace parent, FullNamedExpression type, Modifiers mod,
            MemberName name, Attributes attrs, Accessor get_block,
            Accessor set_block, bool define_set_first, Block current_block)
            : base(parent, type, mod,
				parent.PartialContainer.Kind == MemberKind.Interface ? AllowedInterfaceModifiers : AllowedModifiers,
				name, attrs, define_set_first)
        {
            if (get_block == null)
                Get = new GetMethod (this);
            else
                Get = new GetMethod (this, get_block);

            if (set_block == null)
                Set = new SetMethod (this);
            else
                Set = new SetMethod (this, set_block);

            if (!IsInterface && (mod & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 &&
                get_block != null && get_block.Block == null &&
                set_block != null && set_block.Block == null) {
                if (RootContext.Version <= LanguageVersion.ISO_2)
                    Report.FeatureIsNotAvailable (Location, "automatically implemented properties");

                Get.ModFlags |= Modifiers.COMPILER_GENERATED;
                Set.ModFlags |= Modifiers.COMPILER_GENERATED;
            }
        }
Esempio n. 36
0
		public override bool Define ()
		{
			if (!base.Define ())
				return false;

			flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;

			bool auto = AccessorFirst.Block == null && (AccessorSecond == null || AccessorSecond.Block == null) &&
				(ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0;

			if (Initializer != null) {
				if (!auto)
					Report.Error (8050, Location, "`{0}': Only auto-implemented properties can have initializers",
						GetSignatureForError ());

				if (IsInterface)
					Report.Error (8053, Location, "`{0}': Properties inside interfaces cannot have initializers",
						GetSignatureForError ());

				if (Compiler.Settings.Version < LanguageVersion.V_6)
					Report.FeatureIsNotAvailable (Compiler, Location, "auto-implemented property initializer");
			}

			if (auto) {
				if (Get == null) {
					Report.Error (8052, Location, "Auto-implemented property `{0}' must have get accessor",
						GetSignatureForError ());
					return false;
				}

				if (Initializer == null && AccessorSecond == null) {
					Report.Error (8051, Location, "Auto-implemented property `{0}' must have set accessor or initializer",
						GetSignatureForError ());
				}

				if (Compiler.Settings.Version < LanguageVersion.V_3 && Initializer == null)
					Report.FeatureIsNotAvailable (Compiler, Location, "auto-implemented properties");

				CreateAutomaticProperty ();
			}

			if (!DefineAccessors ())
				return false;

			if (AccessorSecond == null) {
				PropertyMethod pm;
				if (AccessorFirst is GetMethod)
					pm = new SetMethod (this, 0, ParametersCompiled.EmptyReadOnlyParameters, null, Location);
				else
					pm = new GetMethod (this, 0, null, Location);

				Parent.AddNameToContainer (pm, pm.MemberName.Basename);
			}

			if (!CheckBase ())
				return false;

			DefineBuilders (MemberKind.Property, ParametersCompiled.EmptyReadOnlyParameters);
			return true;
		}