Exemple #1
0
        public static List <ResponsableModel> ObtenerDatosUnidadesResp(int Id, ref string Verificador)
        {
            OracleCommand           cmd             = null;
            ExeProcedimiento        exeProc         = new ExeProcedimiento();
            List <ResponsableModel> list            = new List <ResponsableModel>();
            ResponsableModel        objUnidadesResp = new ResponsableModel();

            try
            {
                OracleDataReader dr            = null;
                string[]         Parametros    = { "P_ID" };
                object[]         Valores       = { Id };
                string[]         ParametrosOut = { "P_ID_ACTIVIDAD", "P_ID_UNIDAD", "P_CONTACTO", "P_TELEFONO", "P_CORREO", "P_BANDERA" };
                cmd = exeProc.GenerarOracleCommand("OBT_PLA_PLAN_RESPONSABLES", ref Verificador, ref dr, Parametros, Valores, ParametrosOut);
                string TempActv = Convert.ToString(cmd.Parameters["P_ID_ACTIVIDAD"].Value);
                string TempU    = Convert.ToString(cmd.Parameters["P_ID_UNIDAD"].Value);
                objUnidadesResp.Id             = Id;
                objUnidadesResp.Id_Actividades = Convert.ToInt32(TempActv);
                objUnidadesResp.Id_Unidad      = Convert.ToInt32(TempU);
                objUnidadesResp.Contacto       = Convert.ToString(cmd.Parameters["P_CONTACTO"].Value);
                objUnidadesResp.Telefono       = Convert.ToString(cmd.Parameters["P_TELEFONO"].Value);
                objUnidadesResp.Correo         = Convert.ToString(cmd.Parameters["P_CORREO"].Value);
                list.Add(objUnidadesResp);
            }
            catch (Exception ex)
            {
                Verificador = ex.Message;
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
            return(list);
            //return registroAgregado;
        }
Exemple #2
0
        public static void EditarUnidadesResp(ResponsableModel objUnidadesResp, ref string Verificador)
        {
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                OracleDataReader dr            = null;
                string[]         Parametros    = { "P_ID", "P_ID_ACTIVIDAD", "P_ID_UNIDAD", "P_CONTACTO", "P_TELEFONO", "P_CORREO" };
                object[]         Valores       = { objUnidadesResp.Id, objUnidadesResp.Id_Actividades, objUnidadesResp.Id_Unidad, objUnidadesResp.Contacto, objUnidadesResp.Telefono, objUnidadesResp.Correo };
                string[]         ParametrosOut = { "P_BANDERA" };
                cmd = exeProc.GenerarOracleCommand("UPD_PLA_PLAN_RESPONSABLES", ref Verificador, ref dr, Parametros, Valores, ParametrosOut);
            }
            catch (Exception ex)
            {
                Verificador = ex.Message;
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
        public static List <ResponsableModel> ObtenerGridUnidadesResp(int idActividad, string Usuario)
        {
            //s
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                string[] Parametros = { "P_Id_Actividad", "P_Usuario" };
                object[] Valores    = { idActividad, Usuario };

                OracleDataReader dr = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Grid_Unidades_Resp", ref dr, Parametros, Valores);
                List <ResponsableModel> list = new List <ResponsableModel>();
                while (dr.Read())
                {
                    ResponsableModel objUnidadResp = new ResponsableModel();
                    objUnidadResp.Id             = Convert.ToInt32(dr[0]);
                    objUnidadResp.Id_Actividades = Convert.ToInt32(dr[1]);
                    objUnidadResp.Descripcion    = Convert.ToString(dr[2]);
                    objUnidadResp.Contacto       = Convert.ToString(dr[3]);
                    objUnidadResp.Telefono       = Convert.ToString(dr[4]);
                    objUnidadResp.Correo         = Convert.ToString(dr[5]);



                    list.Add(objUnidadResp);
                }
                return(list);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }