public bool L_InsertarDiaInhabil(CatDiasInhabiles DiaInhabil)
        {
            bool Resultado = false;

            Resultado = DatosAuxiliar.D_InsertarDiaInhabil(DiaInhabil);
            return(Resultado);
        }
Пример #2
0
        public bool D_InsertarDiaInhabil(CatDiasInhabiles DiaInhabil)
        {
            bool          Respuesta = false;
            SqlConnection Conexion  = MetodoGeneral.EstablecerConexionBD();

            SQLComandoAuxiliar = MetodoGeneral.CrearLlamadaStoredProcedure("SpInsertarDiaInhabil", Conexion);
            SQLComandoAuxiliar.Parameters.AddWithValue("@Dia", DiaInhabil.Dia);
            SQLComandoAuxiliar.Parameters.AddWithValue("@Mes", DiaInhabil.Mes);
            SQLComandoAuxiliar.Parameters.AddWithValue("@Año", DiaInhabil.Año);
            SQLComandoAuxiliar.Parameters.AddWithValue("@Activo", 1);
            SQLComandoAuxiliar.ExecuteNonQuery();

            SQLComandoAuxiliar.Connection.Dispose();
            Respuesta = true;
            return(Respuesta);
        }
        public List <CatDiasInhabiles> L_SeleccionarDiasInhabiles(int Mes, int Año)
        {
            DataTable dtDdiasInhabiles = new DataTable();
            List <CatDiasInhabiles> ListaDiasInhabiles = new List <CatDiasInhabiles>();

            dtDdiasInhabiles = DatosAuxiliar.D_SeleccionarDiasInhabiles(Mes, Año);

            if (dtDdiasInhabiles.Rows.Count > 0)
            {
                foreach (DataRow row in dtDdiasInhabiles.Rows)
                {
                    CatDiasInhabiles DiaInhabil = new CatDiasInhabiles();
                    DiaInhabil.IdDiaInhabil  = (Int32)row["IdDiaInhabil"];
                    DiaInhabil.Dia           = (Int32)row["Dia"];
                    DiaInhabil.Mes           = (Int32)row["Mes"];
                    DiaInhabil.Año           = (Int32)row["Año"];
                    DiaInhabil.FechaCompleta = String.Format("{0:dd/MMMM/yyyy}", (DateTime)row["FechaCompleta"]);
                    DiaInhabil.Activo        = (bool)row["Activo"];

                    ListaDiasInhabiles.Add(DiaInhabil);
                }
            }
            return(ListaDiasInhabiles);
        }