Beispiel #1
0
        private void WritePrc(ParamStruct paramsStruct, object inputObj, PropertyInfo[] inputObjProperties)
        {
            foreach (var inputObjPropertyInfo in inputObjProperties)
            {
                var prcFilter = MapPrcFilterFromPropertyInfo(inputObjPropertyInfo);

                //Regular case
                if (prcFilter == null)
                {
                    if (!ShouldIgnore(inputObjPropertyInfo))
                    {
                        var hexKey = MapHexKeyFromPropertyInfo(inputObjPropertyInfo);
                        WritePrc(paramsStruct.Nodes, inputObj, hexKey, inputObjPropertyInfo);
                    }
                }
                //Prc filter
                else
                {
                    var prcFilterList = (IEnumerable)inputObjPropertyInfo.GetValue(inputObj, null);
                    if (prcFilterList != null)
                    {
                        var prcFilterInstanceType       = GetListObjectType(prcFilterList.GetType());
                        var prcFilterValuesPropertyType = prcFilterInstanceType.GetProperty("Values");
                        foreach (var prcFilterInstance in prcFilterList)
                        {
                            var hexKey = (PrcHash40)prcFilterInstanceType.GetProperty("Id").GetValue(prcFilterInstance);
                            WritePrc(paramsStruct.Nodes, prcFilterInstance, hexKey.HexValue, prcFilterValuesPropertyType);
                        }
                    }
                }
            }
        }
 public Boolean CrearRamaCientifica(RamasCientificasLog rama)
 {
     cnn = DAL.DAL.trae_conexion("ServiciosWeb", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Inserta_RamaCientifica";
         ParamStruct[] parametros = new ParamStruct[3];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Cod_Rama", SqlDbType.Int, rama.Cod_Rama);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Nombre", SqlDbType.VarChar, rama.Nombre);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@Password", SqlDbType.VarChar, "password");
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
Beispiel #3
0
 public bool agregarTipoPrecio(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         //insertar en la table de errores
         //    HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
         return(false);
     }
     else
     {
         if (accion.Equals("Insertar"))
         {
             sql = "crear_tipoPrecio";
         }
         ParamStruct[] parametros = new ParamStruct[2];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@descripcion", SqlDbType.VarChar, _descripcion);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@usuario", SqlDbType.VarChar, _usuario);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             //insertar en la table de errores
             //HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
Beispiel #4
0
 public PrivilegiosLog BuscaPrivilegiosLog(string cod_priv)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Carga_RolLaboratorio";
         ParamStruct[] parametros = new ParamStruct[2];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Cod_Privilegio", SqlDbType.Int, cod_priv);
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             PrivilegiosLog priv = new PrivilegiosLog();
             priv.Cod_Privilegio = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
             priv.Privilegio     = ds.Tables[0].Rows[0][1].ToString();
             return(priv);
         }
     }
 }
Beispiel #5
0
 public bool modificar_precio(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         if (accion.Equals("Actualizar"))
         {
             sql = "modificar_tipoPrecio";
         }
         ParamStruct[] parametros = new ParamStruct[3];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@codigo", SqlDbType.VarChar, _codigo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@descripcion", SqlDbType.VarChar, _descripcion);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@usuario", SqlDbType.VarChar, _usuario);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
 public DataTable CargarRamasCientifica()
 {
     cnn = DAL.DAL.trae_conexion("ServiciosWeb", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Lista_RamaCientifica";
         ParamStruct[] parametros = new ParamStruct[1];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             DataTable dt = new DataTable();
             dt = ds.Tables[0];
             dt.Columns[0].ColumnName = "Cod_Rama";
             dt.Columns[1].ColumnName = "Nombre";
             return(dt);
         }
     }
 }
 //INSERTAR
 public Boolean InsertarNivel(NivelAcademicoLogica nivel)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Inserta_NivelAcademico";
         ParamStruct[] parametros = new ParamStruct[5];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@NivelAcademico_id", SqlDbType.VarChar, nivel.NivelAcademico_id);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Nombre", SqlDbType.VarChar, nivel.Nombre);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@Detalle", SqlDbType.VarChar, nivel.Detalle);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@Completo", SqlDbType.VarChar, nivel.Completo);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 4, "@Password", SqlDbType.VarChar, "password");
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
 //CARGA
 public NivelAcademicoLogica BuscarNivelAcademico(string nivelID)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Carga_NivelAcademico";
         ParamStruct[] parametros = new ParamStruct[2];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@NivelAcademico_id", SqlDbType.VarChar, nivelID);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             NivelAcademicoLogica nivel = new NivelAcademicoLogica();
             nivel.NivelAcademico_id = ds.Tables[0].Rows[0][0].ToString();
             nivel.Nombre            = ds.Tables[0].Rows[0][1].ToString();
             nivel.Detalle           = ds.Tables[0].Rows[0][2].ToString();
             nivel.Completo          = ds.Tables[0].Rows[0][3].ToString();
             return(nivel);
         }
     }
 }
Beispiel #9
0
 //INSERTAR
 public Boolean InsertarPuesto(PuestoLogica puesto)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Inserta_Puesto";
         ParamStruct[] parametros = new ParamStruct[4];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Puesto_id", SqlDbType.VarChar, puesto.Puesto_Id);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Nombre", SqlDbType.VarChar, puesto.Nombre);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@RolLaboratorio_id", SqlDbType.VarChar, puesto.RolLaboratorio_ID);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@Password", SqlDbType.VarChar, "password");
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
Beispiel #10
0
 //CARGA
 public PuestoLogica BuscarPuesto(string puestoID)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Carga_Puesto";
         ParamStruct[] parametros = new ParamStruct[2];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Puesto_id", SqlDbType.VarChar, puestoID);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             PuestoLogica puesto = new PuestoLogica();
             puesto.Puesto_Id         = ds.Tables[0].Rows[0][0].ToString();
             puesto.Nombre            = ds.Tables[0].Rows[0][1].ToString();
             puesto.RolLaboratorio_ID = ds.Tables[0].Rows[0][2].ToString();
             return(puesto);
         }
     }
 }
 //ACTUALIZA
 public Boolean ActualizarTipoConsecutivo(TipoConsecutivoLogica tipoConsecutivo)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Actualiza_TipoConsecutivo";
         ParamStruct[] parametros = new ParamStruct[3];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@TipoConsecutivo_id", SqlDbType.Int, tipoConsecutivo.TipoConsecutivoID);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@nombre", SqlDbType.VarChar, tipoConsecutivo.Nombre);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@Password", SqlDbType.VarChar, "password");
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
Beispiel #12
0
 public bool agregar_Gastos(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         if (accion.Equals("Insertar"))
         {
             sql = "InsertarGastos";
         }
         ParamStruct[] parametros = new ParamStruct[5];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@prestamo_Gasto", SqlDbType.Decimal, _prestamo_Gasto);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@factuMensu_Gasto", SqlDbType.Decimal, _factuMensu_Gasto);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@Hipotecas_Gasto", SqlDbType.Decimal, _Hipotecas_Gasto);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@Otros_Gasto", SqlDbType.Decimal, _Otros_Gasto);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 4, "@id_Persona", SqlDbType.Int, _idPersona);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
 //CARGA
 public TipoConsecutivoLogica BuscarTipoConsecutivo(int consecutivoID)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Carga_TipoConsecutivo";
         ParamStruct[] parametros = new ParamStruct[2];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@TipoConsecutivo_id", SqlDbType.Int, consecutivoID);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             TipoConsecutivoLogica tipoConsecutivo = new TipoConsecutivoLogica();
             tipoConsecutivo.TipoConsecutivoID = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
             tipoConsecutivo.Nombre            = ds.Tables[0].Rows[0][1].ToString();
             return(tipoConsecutivo);
         }
     }
 }
Beispiel #14
0
 public bool eliminarProducto(string cod)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         //insertar en la table de errores
         //HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
         return(false);
     }
     else
     {
         sql = "eliminar_producto";
         ParamStruct[] parametros = new ParamStruct[2];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@codigo", SqlDbType.VarChar, _cod_prod);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@usuario", SqlDbType.VarChar, _usuario);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             //insertar en la table de errores
             //   HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
 //Elimina
 public Boolean InsertaRol(int rol, string usuarioID)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Inserta_RolUsuario_Usuarios";
         ParamStruct[] parametros = new ParamStruct[2];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@RolUsuario_id", SqlDbType.Int, rol);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Usuario_id", SqlDbType.VarChar, usuarioID);
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
 public DataTable CargaBitacora()
 {
     cnn = DAL.DAL.trae_conexion("ServiciosWeb", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Lista_BitacoraExperimental";
         ParamStruct[] parametros = new ParamStruct[1];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             DataTable dt = new DataTable();
             dt = ds.Tables[0];
             dt.Columns[0].ColumnName = "Código";
             dt.Columns[1].ColumnName = "Ojetivos";
             dt.Columns[2].ColumnName = "Descripcion";
             dt.Columns[3].ColumnName = "Equipo";
             dt.Columns[4].ColumnName = "Procedimientos";
             dt.Columns[5].ColumnName = "Cod_Experimentos";
             dt.Columns[6].ColumnName = "Fecha";
             dt.Columns[7].ColumnName = "Firma";
             return(dt);
         }
     }
 }
Beispiel #17
0
        private static OrderedDictionary <string, object> ParseStruct(ParamStruct paramStruct, int index)
        {
            var csvDictEntry = new OrderedDictionary <string, object>();

            csvDictEntry.Add("ID", index);

            foreach (var prm in paramStruct.Nodes)
            {
                var key = _hashHelper.GetHexaLabel(prm.Key);
                switch (prm.Value.TypeKey)
                {
                case ParamType.@struct:
                    csvDictEntry.Add(key, "<Struct>");
                    break;

                case ParamType.list:
                    csvDictEntry.Add(key, "<List>");
                    break;

                case ParamType.hash40:
                    var valueHex = (ulong)(prm.Value as ParamValue).Value;
                    csvDictEntry.Add(key, _hashHelper.GetHexaLabel(valueHex));
                    break;

                default:
                    csvDictEntry.Add(key, ((ParamValue)prm.Value).Value.ToString());
                    break;
                }
            }
            return(csvDictEntry);
        }
 public Boolean EliminarRamaCientifica(string codigo)
 {
     cnn = DAL.DAL.trae_conexion("ServiciosWeb", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Elimina_RamaCientifica";
         ParamStruct[] parametros = new ParamStruct[1];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Cod_Rama", SqlDbType.VarChar, codigo);
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
Beispiel #19
0
 public Boolean InsertarPrivilegiosLog(PrivilegiosLog priv)
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(false);
     }
     else
     {
         sql = "sp_Inserta_RolLaboratorio";
         ParamStruct[] parametros = new ParamStruct[3];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Cod_Privilegio", SqlDbType.Int, priv.Cod_Privilegio);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Privilegio", SqlDbType.VarChar, priv.Privilegio);
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@Password", SqlDbType.VarChar, "password");
         DAL.DAL.conectar(cnn, ref error, ref numeroError);
         DAL.DAL.ejecuta_sqlcommand(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(false);
         }
         else
         {
             DAL.DAL.desconectar(cnn, ref error, ref numeroError);
             return(true);
         }
     }
 }
Beispiel #20
0
 public DataSet CargaPrivilegiosLog()
 {
     cnn = DAL.DAL.trae_conexion("BDConnectionString", ref error, ref numeroError);
     if (cnn == null)
     {
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp_Lista_RolLaboratorio";
         ParamStruct[] parametros = new ParamStruct[1];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Password", SqlDbType.VarChar, "password");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             ds.Tables[0].Columns[0].ColumnName = "Codigo";
             ds.Tables[0].Columns[1].ColumnName = "Nombre Privilegio";
             return(ds);
         }
     }
 }
Beispiel #21
0
 public bool modificarTrabajoPersona(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         if (accion.Equals("Actualizar"))
         {
             sql = "Modificar_Trabajo_Persona";
         }
         ParamStruct[] parametros = new ParamStruct[5];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Cod_Trabajo", SqlDbType.Int, _Cod_Trabajo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@Id_Persona", SqlDbType.Int, _Id_Persona);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@SueldoMen_Trabajo", SqlDbType.Decimal, _SueldoMen_Trabajo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@FechaIngrso_Trabajo", SqlDbType.Date, _FechaIngrso_Trabajo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 4, "@Puesto_Trabajo", SqlDbType.VarChar, _Puesto_Trabajo);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
Beispiel #22
0
 public bool agregar_trabajo_persona(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         if (accion.Equals("Insertar"))
         {
             sql = "Insertar_Trabajo_Persona";
         }
         ParamStruct[] parametros = new ParamStruct[4];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Id_Persona", SqlDbType.Int, _Id_Persona);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@SueldoMen_Trabajo", SqlDbType.Int, _SueldoMen_Trabajo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@FechaIngrso_Trabajo", SqlDbType.Date, _FechaIngrso_Trabajo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 3, "@Puesto_Trabajo", SqlDbType.VarChar, _Puesto_Trabajo);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             //insertar en la table de errores
             //HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
Beispiel #23
0
 public bool eliminarProcesadorPago(string cod_)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         sql = "eliminar_procesadorPago";
         ParamStruct[] parametros = new ParamStruct[2];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@codigo", SqlDbType.VarChar, _codigo);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@usuario", SqlDbType.VarChar, _usuario);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
Beispiel #24
0
 public string carga_lista_Productos(string linea, string producto)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(null);
     }
     else
     {
         if (producto == null)
         {
             sql = "EF_ver_Producto";
             ParamStruct[] parametros = new ParamStruct[2];
             cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@lineaComida", SqlDbType.VarChar, linea);
             cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@producto", SqlDbType.VarChar, "");
             ds = cls_DAL.ejecuta_dataset(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         }
         else
         {
             sql = "EF_ver_Producto";
             ParamStruct[] parametros = new ParamStruct[2];
             cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@lineaComida", SqlDbType.VarChar, linea);
             cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@producto", SqlDbType.VarChar, producto);
             ds = cls_DAL.ejecuta_dataset(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         }
         if (numero_error != 0)
         {
             return(null);
         }
         else
         {
             return(JsonConvert.SerializeObject(ds.Tables[0]));
         }
     }
 }
Beispiel #25
0
 public bool agregarProcesadorTarjeta(string accion)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         return(false);
     }
     else
     {
         if (accion.Equals("Insertar"))
         {
             sql = "crear_procesaTarje";
         }
         ParamStruct[] parametros = new ParamStruct[3];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@codigoProce", SqlDbType.VarChar, _codigoProce);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@codigoTarje", SqlDbType.VarChar, _codigoTarje);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 2, "@usuario", SqlDbType.VarChar, _usuario);
         cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
         cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(false);
         }
         else
         {
             cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
             return(true);
         }
     }
 }
Beispiel #26
0
 public DataSet CargaConsecutivos()
 {
     cnn = DAL.DAL.trae_conexion("ServiciosWeb", ref error, ref numeroError);
     if (cnn == null)
     {
         //insertar en la table de errores
         HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
         return(null);
     }
     else
     {
         sql = "sp*************";
         ParamStruct[] parametros = new ParamStruct[1];
         DAL.DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@Pass", SqlDbType.VarChar, "pass");
         ds = DAL.DAL.ejecuta_dataset(cnn, sql, true, parametros, ref error, ref numeroError);
         if (numeroError != 0)
         {
             //insertar en la table de errores
             HttpContext.Current.Response.Redirect("Error.aspx?error=" + numeroError.ToString() + "&men=" + error);
             return(null);
         }
         else
         {
             ds.Tables[0].Columns[0].ColumnName = "Codigo";
             ds.Tables[0].Columns[2].ColumnName = "Descripcion";
             ds.Tables[0].Columns[5].ColumnName = "Prefijo";
             return(ds);
         }
     }
 }
Beispiel #27
0
        /*Region de codigo que contiene los metodos instanciados a Procediemientos almacenados que son utilizados
         * dentro de la clase Login*/
        #region Metodos

        /*Metodo que permite realizar el ingreso al sistema, segun el usuario registrado*/
        public void LOGIN()
        {
            /*Verificacion de la conexion al servidor*/
            conexion = cls_DAL.trae_conexion("PuntoAmericano", ref mensaje_error, ref numero_error);
            if (conexion == null)
            {
                /*Instancia a un Procedimiento Almacenado*/
                sql = " USP_ERROR_INSERT";
                ParamStruct[] parametros = new ParamStruct[2];
                cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@msgerror", SqlDbType.VarChar, mensaje_error);
                cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@numerror", SqlDbType.Int, numero_error);
                cls_DAL.conectar(conexion, ref mensaje_error, ref numero_error);
                cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
                cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
            }
            else
            {
                /*Instancia a un Procedimiento Almacenado*/
                sql = "USP_USUARIOS_LOGIN";
                ParamStruct[] parametros = new ParamStruct[2];
                cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@login", SqlDbType.VarChar, _LoginU);
                cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@contra", SqlDbType.VarChar, _Contra);
                ds = cls_DAL.ejecuta_dataset(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
                if (numero_error != 0)
                {
                    if (numero_error == 40615)
                    {
                        MessageBox.Show("Permisos en la Base Denegados ", "Sin Permisos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        /*Instancia a un Procedimiento Almacenado*/
                        sql = "USP_ERROR_INSERT";
                        ParamStruct[] parametross = new ParamStruct[2];
                        cls_DAL.agregar_datos_estructura_parametros(ref parametross, 0, "@msgerror", SqlDbType.VarChar, mensaje_error);
                        cls_DAL.agregar_datos_estructura_parametros(ref parametross, 1, "@numerror", SqlDbType.Int, numero_error);
                        cls_DAL.ejecuta_sqlcommand(conexion, sql, true, parametross, ref mensaje_error, ref numero_error);
                        cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
                    }
                }


                else
                {
                    /*Se valida la informacion solicitada*/
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        _LoginSalida = ds.Tables[0].Rows[0]["Login"].ToString();
                        _Ubicacion   = ds.Tables[0].Rows[0]["Ubicacion"].ToString();
                        _Rol         = ds.Tables[0].Rows[0]["Rol"].ToString();
                        cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
                    }
                    else
                    {
                        MessageBox.Show("Usuario o Contraseña Invalidos", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        cls_DAL.desconectar(conexion, ref mensaje_error, ref numero_error);
                    }
                }
            }
        }
Beispiel #28
0
 public string carga_lista_erroresRango(string fecha1, string fecha2)
 {
     conexion = cls_DAL.trae_conexion("Progra5", ref mensaje_error, ref numero_error);
     if (conexion == null)
     {
         //insertar en la table de errores
         //  HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
         return(null);
     }
     else
     {
         sql = "ver_errorIntraFecha";
         ParamStruct[] parametros = new ParamStruct[2];
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 0, "@fecha1", SqlDbType.VarChar, fecha1);
         cls_DAL.agregar_datos_estructura_parametros(ref parametros, 1, "@fecha2", SqlDbType.VarChar, fecha2);
         ds = cls_DAL.ejecuta_dataset(conexion, sql, true, parametros, ref mensaje_error, ref numero_error);
         if (numero_error != 0)
         {
             //insertar en la table de errores
             //HttpContext.Current.Response.Redirect("Error.aspx?error=" + numero_error.ToString() + "&men=" + mensaje_error);
             return(null);
         }
         else
         {
             return(JsonConvert.SerializeObject(ds.Tables[0]));
         }
     }
 }
Beispiel #29
0
        /// <summary>
        /// gets the reports on the customer
        /// </summary>
        /// <param name="customer">the customerId</param>
        /// <param name="start">the date to start looking from</param>
        /// <param name="end">the date to stop looking</param>
        /// <returns></returns>
        public static DataTable getCustomerReport(int customer, DateTime start, DateTime end)
        {
            DataTable          report    = new DataTable();
            List <ParamStruct> paramList = new List <ParamStruct>();

            ParamStruct param0 = new ParamStruct("@totalRevenue", 0, DbType.Currency, 8, ParameterDirection.InputOutput);

            paramList.Add(param0);

            ParamStruct param1 = new ParamStruct("@customerId", customer, DbType.Int32, 4, ParameterDirection.Input);

            paramList.Add(param1);

            ParamStruct param2 = new ParamStruct("@startDate", start, DbType.Date, 4, ParameterDirection.Input);

            paramList.Add(param2);

            ParamStruct param3 = new ParamStruct("@endDate", end, DbType.Date, 4, ParameterDirection.Input);

            paramList.Add(param3);

            string sproc = "getCustomerReport";

            report = DAL.DAL.ReadTable(sproc, paramList);

            decimal revenue = Convert.ToDecimal(paramList[0].paramValue);

            return(report);
        }
Beispiel #30
0
        /// <summary>
        /// gets the information on overdue equipment
        /// </summary>
        /// <param name="customer">the customerId</param>
        /// <param name="equipment">the EquipmentId</param>
        /// <param name="start">the date to start looking from</param>
        /// <param name="end">the date to stop looking</param>
        /// <param name="days">narrows the search to how many days overdue</param>
        /// <returns></returns>
        public static DataTable getOverdueReport(int customer, int equipment, DateTime start, DateTime end, int days)
        {
            DataTable          report    = new DataTable();
            List <ParamStruct> paramList = new List <ParamStruct>();

            ParamStruct param0 = new ParamStruct("@customerId", customer, DbType.Int32, 4, ParameterDirection.Input);

            paramList.Add(param0);

            ParamStruct param1 = new ParamStruct("@equipmentId", equipment, DbType.Int32, 4, ParameterDirection.Input);

            paramList.Add(param1);

            ParamStruct param2 = new ParamStruct("@startDate", start, DbType.Date, 4, ParameterDirection.Input);

            paramList.Add(param2);

            ParamStruct param3 = new ParamStruct("@endDate", end, DbType.Date, 4, ParameterDirection.Input);

            paramList.Add(param3);

            ParamStruct param4 = new ParamStruct("@daysover", days, DbType.Int32, 4, ParameterDirection.Input);

            paramList.Add(param4);

            string sproc = "getRentalsDueRpt";

            report = DAL.DAL.ReadTable(sproc, paramList);

            return(report);
        }
Beispiel #31
0
 public Basic(string shellTypeName, string serviceExample, ParamStruct mainCodeParam)
 {
     this.ShellTypeName = shellTypeName;
     this.ServiceExample = serviceExample;
     this.MainCodeParam = mainCodeParam;
 }
Beispiel #32
0
 public MainCode(string item, ParamStruct funcCodeParam)
 {
     this.Item = item;
     this.FuncCodeParam = funcCodeParam;
 }