예제 #1
0
        public void Save(cod_documentos oDocumento)
        {
            cooperativaEntities bd = new cooperativaEntities();

            bd.cod_documentos.AddObject(oDocumento);
            bd.SaveChanges();
        }
예제 #2
0
        public void CargarCheckList(ref CheckedListBox combo, string InsertaFila)
        {
            IList          ListaDocumentos = GetAll();
            cod_documentos oDocumento      = new cod_documentos();

            //oDocumento.id_documento = 0;
            //oDocumento.documento = InsertaFila;
            //ListaDocumentos.Insert(0, oDocumento);
            combo.DataSource    = ListaDocumentos;
            combo.DisplayMember = "documento";
            combo.ValueMember   = "id_documento";
        }
예제 #3
0
        public void Update(cod_documentos oDocumento)
        {
            using (cooperativaEntities bd = new cooperativaEntities())
            {
                var editar = (from p in bd.cod_documentos
                              where p.id_documento == oDocumento.id_documento
                              select p).Single();

                editar.documento = oDocumento.documento;
                bd.SaveChanges();
            }
        }
예제 #4
0
        public cod_documentos Get(int id)
        {
            cod_documentos oDocumento = new cod_documentos();

            using (cooperativaEntities bd = new cooperativaEntities())
            {
                var regis = (from p in bd.cod_documentos
                             where p.id_documento == id
                             select p).Single();
                oDocumento.id_documento = regis.id_documento;
                oDocumento.documento    = regis.documento;
                return(oDocumento);
            }
        }
예제 #5
0
        private void CargarSeleccion()
        {
            cod_documentos     oDocumento          = new cod_documentos();
            DocumentoImplement oDocumentoImplement = new DocumentoImplement();

            DataGridViewRow row = this.dgvDocumento.CurrentRow;
            int             id  = Convert.ToInt32(row.Cells[0].Value);

            oDocumento             = oDocumentoImplement.Get(id);
            this.lblCodigo.Text    = oDocumento.id_documento.ToString();
            this.txtNombre.Text    = oDocumento.documento;
            this.txtNombre.Enabled = false;
            Deshabilitar();
        }
예제 #6
0
        private void ModificarDocumento()
        {
            HabilitarBotones();
            this.txtNombre.Enabled = true;

            cod_documentos     oDocumento          = new cod_documentos();
            DocumentoImplement oDocumentoImplement = new DocumentoImplement();
            DataGridViewRow    row = this.dgvDocumento.CurrentRow;
            int id = Convert.ToInt32(row.Cells[0].Value);

            oDocumento                = oDocumentoImplement.Get(id);
            this.lblCodigo.Text       = oDocumento.id_documento.ToString();
            this.txtNombre.Text       = oDocumento.documento;
            this.dgvDocumento.Enabled = false;
        }
예제 #7
0
        private void Guardar()
        {
            DocumentoImplement oDocumentoImplement = new DocumentoImplement();
            cod_documentos     oDocumento          = new cod_documentos();

            if (this.lblCodigo.Text == "")
            {
                oDocumento.documento = this.txtNombre.Text;
                oDocumentoImplement.Save(oDocumento);
            }
            else
            {
                DataGridViewRow row = this.dgvDocumento.CurrentRow;
                int             id  = Convert.ToInt32(row.Cells[0].Value);
                oDocumento           = oDocumentoImplement.Get(id);
                oDocumento.documento = this.txtNombre.Text;
                oDocumentoImplement.Update(oDocumento);
            }
            Deshabilitar();
            this.txtNombre.Text = "";
            CargarGrid();
        }
예제 #8
0
        private void Inicializar()
        {
            socios         oSocios          = new socios();
            SocioImplement oSociosImplement = new SocioImplement();

            socios_lote        oSocioLote          = new socios_lote();
            SocioLoteImplement oSocioLoteImplement = new SocioLoteImplement();

            oSocioLote = oSocioLoteImplement.Get(_idSocio);

            socios_conexion        oSocioConexion          = new socios_conexion();
            SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();

            oSocioConexion = oSocioConexionImplement.Get(_idSocio);

            socios_varios        oSocioVarios          = new socios_varios();
            SocioVariosImplement oSocioVariosImplement = new SocioVariosImplement();

            oSocioVarios = oSocioVariosImplement.Get(_idSocio);


            oSocios               = oSociosImplement.Get(_idSocio);
            txtCodigo.Text        = oSocios.codigo_socio;
            txtFechaConvenio.Text = _FechaConvenio.ToShortDateString();
            txtNombre.Text        = oSocios.nombre;
            cod_documentos     oCodDocumentos       = new cod_documentos();
            DocumentoImplement oDocumentosImplement = new DocumentoImplement();

            if (oSocios.tipo_documento != null)
            {
                txtTipoDocumento.Text = oDocumentosImplement.Get((int)oSocios.tipo_documento).documento;
            }
            txtDocumento.Text = oSocios.documento.ToString();

            CalleImplement oCalleImplement = new CalleImplement();

            BarrioImplement    oBarrioImplement    = new BarrioImplement();
            LocalidadImplement oLocalidadImplement = new LocalidadImplement();

            if (oSocioConexion.calle != null & (int)oSocioConexion.calle != 0)
            {
                txtDomicilioReal.Text = oCalleImplement.Get((int)oSocioConexion.calle).calle + " " + oSocioConexion.calle_altura;
            }
            if (oSocioLote.localidad != null & (int)oSocioLote.localidad != 0)
            {
                txtCiudadReal.Text = oLocalidadImplement.Get((int)oSocioLote.localidad).localidad;
            }
            if (oSocioLote.calle != null & (int)oSocioLote.calle != 0)
            {
                txtDomicilioLegal.Text = oCalleImplement.Get((int)oSocioLote.calle).calle + " " + oSocioLote.calle_altura;
            }
            if (oSocioLote.localidad != null & (int)oSocioLote.localidad != 0)
            {
                txtCiudadLegal.Text = oLocalidadImplement.Get((int)oSocioLote.localidad).localidad;
            }
            txtLote.Text    = oSocioLote.lote;
            txtManzana.Text = oSocioLote.manzana;
            if (oSocioLote.barrio != null & (int)oSocioLote.barrio != 0)
            {
                txtBarrio.Text = oBarrioImplement.Get((int)oSocioLote.barrio).barrio;
            }

            txtImporteDeuda.Text          = _ImporteDeuda.ToString();
            txtValorCuotas.Text           = _ImporteCuota.ToString();
            txtCantidadCuotas.Text        = _CantidadCuotas.ToString();
            txtImporteCanonMunicipal.Text = _CanonMunicipal.ToString();


            FacturasImplement oFacturasImplement = new FacturasImplement();
            string            sPeriodo           = oFacturasImplement.GetUltimoPeriodoFacturadoBySocio(_idSocio);
            int      anio         = int.Parse(sPeriodo.Substring(0, 3));
            int      mes          = int.Parse(sPeriodo.Substring(4, 5));
            DateTime fechaPeriodo = new DateTime(anio, mes, 1);
            DateTime fechaDesde   = fechaPeriodo.AddMonths(1);
            DateTime fechaHasta   = fechaPeriodo.AddMonths(_CantidadCuotas);
            Meses    mesDesde     = (Meses)fechaDesde.Month;
            Meses    mesHasta     = (Meses)fechaHasta.Month;

            txtDesdeMes.Text  = mesDesde.ToString();
            txtMesHasta.Text  = mesHasta.ToString();
            txtDesdeAnio.Text = fechaDesde.Year.ToString();
            txtAnioHasta.Text = fechaHasta.Year.ToString();
        }