コード例 #1
0
 private void CargarVencimientos()
 {
     SysConfigImplement oSysConfigImplement = new SysConfigImplement();
     sys_configuracion oSysDiaPrimerVencimiento = new sys_configuracion();
     sys_configuracion oSysUltimoPeriodo = new sys_configuracion();
     sys_configuracion oSysDíasEntreVenc2 = new sys_configuracion();
     oSysDiaPrimerVencimiento = oSysConfigImplement.GetByNombre("DiaPrimerVencimiento");
     oSysDíasEntreVenc2 = oSysConfigImplement.GetByNombre("DíasEntreVenc2");
     oSysUltimoPeriodo = oSysConfigImplement.GetByNombre("UltimoPeriodo");
     this.mtbDesde.Text = oSysUltimoPeriodo.valor;
     this.txtDiasEntre.Text = oSysDíasEntreVenc2.valor;
     this.txtPrimerVenc.Text = oSysDiaPrimerVencimiento.valor;
     this.mtbDesde.Enabled = false;
     this.txtDiasEntre.Enabled = false;
     this.txtPrimerVenc.Enabled = false;
 }
コード例 #2
0
        private void Generar()
        {
            string UltimoPeriodo="";
            pgbProgreso.Value = 0;
            pgbProgreso.Minimum = 0;
            pgbProgreso.Visible = true;
            DateTime StartDate = new DateTime(int.Parse(this.mtbDesde.Text.Substring(0, 4)),int.Parse( this.mtbDesde.Text.Substring(5, 2)), 1);
            DateTime EndDate = new DateTime(int.Parse(this.mtbHasta.Text.Substring(0, 4)), int.Parse(this.mtbHasta.Text.Substring(5, 2)), 1);
            //Calculo diferencia de meses para utilizar en la barra de progreso
            pgbProgreso.Maximum = Math.Abs((EndDate.Month - StartDate.Month) + 12 * (EndDate.Year - StartDate.Year));
            int MonthInterval = 1;
            PeriodosImplement oPeriodoImplement = new PeriodosImplement();
            SysConfigImplement oSysConfigImplement = new SysConfigImplement();
            sys_configuracion oSysUltimoPeriodo = new sys_configuracion();
            oSysUltimoPeriodo = oSysConfigImplement.GetByNombre("UltimoPeriodo");
            UltimoPeriodo = oSysUltimoPeriodo.valor;
            //voy sumando meses hasta llegar a iguales fechas
            while (StartDate.AddMonths(MonthInterval) <= EndDate)
            {
                StartDate = StartDate.AddMonths(MonthInterval);
                periodos oPeriodo = new periodos();
                oPeriodo.id_periodo = StartDate.Date.ToString("yyyyMMdd").Substring(0,6);
                DateTime PrimerVencimiento = DateTime.Parse(oPeriodo.id_periodo.Substring(0, 4) + "/" + oPeriodo.id_periodo.Substring(4, 2)+"/" + this.txtPrimerVenc.Text);
                // incremento el dia mientra no sea fin de semana(se puede agregar para feriados - primer vencimiento
                while (PrimerVencimiento.DayOfWeek == DayOfWeek.Saturday || PrimerVencimiento.DayOfWeek == DayOfWeek.Sunday)
                {
                    PrimerVencimiento=PrimerVencimiento.Date.AddDays(1);
                }
                DateTime segundoVencimiento = PrimerVencimiento.Date.AddDays(int.Parse(this.txtDiasEntre.Text));
                // incremento el dia mientra no sea fin de semana(se puede agregar para feriados - segundo vencimiento
                while (segundoVencimiento.DayOfWeek == DayOfWeek.Saturday || segundoVencimiento.DayOfWeek == DayOfWeek.Sunday)
                {
                    segundoVencimiento = segundoVencimiento.Date.AddDays(1);
                }
                oPeriodo.fecha_primer_venc = PrimerVencimiento;
                oPeriodo.fecha_segundo_venc = segundoVencimiento;
                oPeriodo.fecha_tercer_venc = null;
                oPeriodo.fecha_facturacion = null;
                oPeriodo.facturado = false;
                oPeriodoImplement.Save(oPeriodo);
                UltimoPeriodo=oPeriodo.id_periodo;
                pgbProgreso.Value += 1;
            }

            if (oSysUltimoPeriodo.valor != UltimoPeriodo)
            {
                oSysUltimoPeriodo.valor = UltimoPeriodo;
                oSysConfigImplement.Update(oSysUltimoPeriodo);
                MessageBox.Show("La Generación se realizo Exitosamente");
                Inicializar();
            }
            else {
                MessageBox.Show("La Generación fue nula");
            }
        }
コード例 #3
0
        private void GuardarLeyendas()
        {
            SysConfigImplement oSysConfigImplement = new SysConfigImplement();
                sys_configuracion oSysObsComun = new sys_configuracion();
                oSysObsComun = oSysConfigImplement.GetByNombre("ObsComun");
                oSysObsComun.valor=this.txtObsComun.Text;
                oSysConfigImplement.Save(oSysObsComun);

                sys_configuracion oSysObsDeuda = new sys_configuracion();
                oSysObsDeuda = oSysConfigImplement.GetByNombre("ObsDeuda");
                oSysObsDeuda.valor = this.txtObsDeuda.Text;
                oSysConfigImplement.Save(oSysObsDeuda);

                sys_configuracion oSysObsDeuda2 = new sys_configuracion();
                oSysObsDeuda2 = oSysConfigImplement.GetByNombre("ObsDeuda2");
                oSysObsDeuda2.valor = this.txtObsDeuda2.Text;
                oSysConfigImplement.Save(oSysObsDeuda2);
        }
コード例 #4
0
 private void InicializarLeyendas()
 {
     SysConfigImplement oSysConfigImplement=new SysConfigImplement();
         this.txtObsComun.Text = oSysConfigImplement.GetByNombre("ObsComun").valor;
         this.txtObsDeuda.Text = oSysConfigImplement.GetByNombre("ObsDeuda").valor;
         this.txtObsDeuda2.Text = oSysConfigImplement.GetByNombre("ObsDeuda2").valor;
 }
コード例 #5
0
        private void GenerarListado()
        {
            //verifica que el barrio este seleccionado
            if (this.rbtnSelecionaBarrio.Checked && this.cmbBarrio.SelectedValue.ToString() == "0")

                MessageBox.Show("Debe seleccionar un barrio", "Información Insuficiente");

            if (rbtnFiltro.Checked && SQLFiltro=="")
                MessageBox.Show("Filtro", "Información Insuficiente");

            //verifica que se haya ingresado la fecha valida

            if (this.rbtnAAdeudan.Checked && this.txtPeriodos.Text=="")
                MessageBox.Show("Debe indicar la cantidad de Periodos que se utilizara", "Información Insuficiente");

            if (this.rbtnADeudaPesos.AutoCheck && this.txtPesos.Text=="")
                MessageBox.Show("Debe indicar el importe que se utilizara", "Información Insuficiente");

            if( this.rbtnSeleccionaCategoria.Checked && this.cmbCategoria.SelectedValue=="0")
                MessageBox.Show("Debe Seleccionar Categoria", "Información Insuficiente");

            string SQLSocios="select * from socios s "+
                    " inner join socios_conexion sc on s.id_Socio=sc.id_Socio where 1=1 ";

                if (this.rbtnSelecionaBarrio.Checked)

                    SQLSocios= SQLSocios+ " and sc.barrio="+this.cmbBarrio.SelectedValue;

                if (this.rbtnFiltro.Checked)
                    SQLSocios = SQLSocios + SQLFiltro;

                if (this.chkAExcluirNoSocios.Checked){
                    SysConfigImplement oSysConfigImplement = new SysConfigImplement();
                    sys_configuracion oSysConfig = new sys_configuracion();
                    oSysConfig = oSysConfigImplement.GetByNombre("DiaPrimerVencimiento");
                    SQLSocios = SQLSocios + " and s.codigo_socio<" + oSysConfig.valor;
                    }

                if (rbtnSeleccionaCategoria.Checked)
                    SQLSocios = SQLSocios + "and s.categoria=" + cmbCategoria.SelectedValue;

            Consultas oConsultas=new Consultas();
            DataTable dtSocios = oConsultas.GetScript(SQLSocios);
            foreach (DataRow dtRow in dtSocios.Rows)
            {
                //foreach(DataColumn dc in dtRow)
            }
        }