コード例 #1
0
        public int ActualizarConfigHandHeld(DA.eTipoConexion tc, int iCodSupervisor, int iCodOperador, int iCodConfigBanco, long lCodConfigHandHeld)
        {
            int  iRes = -1;
            bool bRes = false;

            try
            {
                if (tc == DA.eTipoConexion.Local)
                {
                    // Parameters
                    SqlCeParameter[] pars = new SqlCeParameter[4];
                    pars[0]       = new SqlCeParameter("@CodSupervisor", SqlDbType.Int);
                    pars[0].Value = iCodSupervisor;
                    pars[1]       = new SqlCeParameter("@CodOperador", SqlDbType.Int);
                    pars[1].Value = iCodOperador;
                    pars[2]       = new SqlCeParameter("@CodConfigBanco", SqlDbType.Int);
                    pars[2].Value = iCodConfigBanco;
                    pars[3]       = new SqlCeParameter("@CodConfigHandHeld", SqlDbType.BigInt);
                    pars[3].Value = lCodConfigHandHeld;

                    // Query Execution
                    DA.ConfigDataAccess.ObtenerConexion().EjecutarConsulta(c04_CapturaInicial.query_ActualizarConfigHandHeld(), pars);

                    iRes = 0;
                }
                else if (tc == DA.eTipoConexion.Servicio)
                {
                    if (this.oDA0.EstaServicioDisponible())
                    {
                        HHsvc.SCPP_HH proxy = DA.ConfigDataAccess.ObtenerServiceProxy();
                        proxy.ActualizarConfigHandHeld(lCodConfigHandHeld, true, iCodSupervisor, true,
                                                       iCodOperador, true, iCodConfigBanco, true,
                                                       out iRes, out bRes);

                        if (!bRes)
                        {
                            iRes = -1;
                        }
                    }
                    else
                    {
                        iRes = -1;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(this.sClassName + ", ActualizarConfigHandHeld: " + ex.Message);
            }
            return(iRes);
        }