Esempio n. 1
0
        public override void Siguiente()
        {
            eSERIE o = new eSERIE();

            o.SER_serie  = this.txtSerie.Text;
            o.TDO_codigo = this.cmbTipoDocumento.Text;
            cargarDatos(balSERIE.siguienteRegistro(o));
        }
Esempio n. 2
0
        public frmDM_Serie(eSERIE o)
        {
            InitializeComponent();
            tabla = "SERIE";

            this.cmbTipoDocumento.ValueMember   = "TDO_codigo";
            this.cmbTipoDocumento.DisplayMember = "TDO_nombre";
            this.cmbTipoDocumento.DataSource    = balTIPO_DOCUMENTO.poblar();

            this._o = o;
        }
Esempio n. 3
0
        private void btnGoSerie_Click(object sender, EventArgs e)
        {
            eSERIE o = new eSERIE();

            o.SER_serie = this.cmbSerie.SelectedValue != null?this.cmbSerie.SelectedValue.ToString() : "";

            o.TDO_codigo = this.cmbTipoDocumento.SelectedValue != null?this.cmbTipoDocumento.SelectedValue.ToString() : "";

            frmDM_Serie o2 = new frmDM_Serie(o);

            o2.MdiParent = this.MdiParent;
            o2.Show();
        }
Esempio n. 4
0
        public override bool Guardar()
        {
            int  u;
            bool rpta = false;

            try
            {
                eSERIE o = new eSERIE();
                o.SER_serie  = this.txtSerie.Text;
                o.TDO_codigo = this.cmbTipoDocumento.SelectedValue != null?this.cmbTipoDocumento.SelectedValue.ToString() : "";

                o.SER_correlativo_actual = Int32.TryParse(this.txtCorrelativoActual.Text, out u) ? Convert.ToInt32(this.txtCorrelativoActual.Text) : -1;
                o.SER_correlativo_desde  = Convert.ToInt32(this.nudCorrelativoDesde.Value);
                o.SER_correlativo_hasta  = Convert.ToInt32(this.nudCorrelativoHasta.Value);

                if (balSERIE.insertarRegistro(o))
                {
                    mensaje("guardar", "");
                    //MessageBox.Show("El registro fue guardado correctamente.", "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtSerie.ReadOnly        = true;
                    this.cmbTipoDocumento.Enabled = false;
                    rpta = true;
                }
            }
            catch (CustomException ex)
            {
                if (ex.tupla != null)
                {
                    foreach (Control c in this.gpbInformacion.Controls)
                    {
                        foreach (var item in ex.tupla)
                        {
                            if (c.Tag != null && c.Tag.ToString() == item.name)
                            {
                                errValidacion.SetError(c, item.message.ToString());
                            }
                        }
                    }
                    mensaje("subsanar", "");
                }
                else
                {
                    mensaje("corregir", ex.Message);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrió un error inesperado:\r\n" + ex.Message, "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(rpta);
        }
Esempio n. 5
0
        public bool eliminarRegistro(eSERIE oeSERIE)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_SERIE_eliminarRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@SER_SERIE", oeSERIE.SER_serie));
                cmd.Parameters.Add(new SqlParameter("@TDO_CODIGO", oeSERIE.TDO_codigo));

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
Esempio n. 6
0
        public override bool Eliminar()
        {
            bool rpta = false;

            try
            {
                eSERIE o = new eSERIE();
                o.SER_serie  = this.txtSerie.Text;
                o.TDO_codigo = this.cmbTipoDocumento.SelectedValue != null?this.cmbTipoDocumento.SelectedValue.ToString() : "";

                if (balSERIE.eliminarRegistro(o))
                {
                    mensaje("eliminar", "");
                    //MessageBox.Show("El registro fue eliminado correctamente.", "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtSerie.ReadOnly        = true;
                    this.cmbTipoDocumento.Enabled = false;
                    rpta = true;
                }
            }
            catch (CustomException ex)
            {
                if (ex.tupla != null)
                {
                    foreach (Control c in this.gpbInformacion.Controls)
                    {
                        foreach (var item in ex.tupla)
                        {
                            if (c.Tag != null && c.Tag.ToString() == item.name)
                            {
                                errValidacion.SetError(c, item.message.ToString());
                            }
                        }
                    }
                    mensaje("subsanar", "");
                }
                else
                {
                    mensaje("corregir", ex.Message);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrió un error inesperado:\r\n" + ex.Message, "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(rpta);
        }
Esempio n. 7
0
        public DataTable obtenerSeriesPorTipoDocumento(eSERIE oeSERIE, ePEDIDO oePEDIDO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "[pa_bf_SERIE_ObtenerSeriesPorTipoDocumento]";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter dad = new SqlDataAdapter(cmd);
                dad.SelectCommand.Parameters.Add(new SqlParameter("@TDO_CODIGO", oeSERIE.TDO_codigo));
                dad.SelectCommand.Parameters.Add(new SqlParameter("@PED_FECHA", oePEDIDO.PED_fecha));

                DataTable dt = new DataTable();
                dad.Fill(dt);

                return(dt);
            }
        }
Esempio n. 8
0
        public override void Buscar()
        {
            eSERIE       o         = new eSERIE();
            balSERIE     obalSERIE = new balSERIE();
            _frmBusqueda ventana   = new _frmBusqueda(true, "buscarRegistro", obalSERIE);
            DialogResult respuesta = ventana.ShowDialog();

            if (respuesta == DialogResult.OK)
            {
                o.SER_serie  = ventana.pk;
                o.TDO_codigo = ventana.pk_2;
                DataTable dt = balSERIE.obtenerRegistro(o);
                cargarDatos(dt);

                this.txtSerie.ReadOnly        = true;
                this.cmbTipoDocumento.Enabled = false;
            }
        }
Esempio n. 9
0
        private void cmbSerie_DropDown(object sender, EventArgs e)
        {
            eSERIE oeSERIE = new eSERIE();

            oeSERIE.TDO_codigo = this.cmbTipoDocumento.SelectedValue.ToString();
            ePEDIDO oePEDIDO = new ePEDIDO();

            oePEDIDO.PED_fecha = Convert.ToDateTime(this.dtpFecha.Value.ToShortDateString());

            string valorSeleccionado = "";

            if (this.cmbSerie.SelectedValue != null)
            {
                valorSeleccionado = this.cmbSerie.SelectedValue.ToString();
            }
            this.cmbSerie.DataSource    = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO);
            this.cmbSerie.SelectedValue = valorSeleccionado;
        }
Esempio n. 10
0
        public DataTable obtenerRegistro(eSERIE oeSERIE)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_SERIE_obtenerRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter dad = new SqlDataAdapter(cmd);
                dad.SelectCommand.Parameters.Add(new SqlParameter("@SER_SERIE", oeSERIE.SER_serie));
                dad.SelectCommand.Parameters.Add(new SqlParameter("@TDO_CODIGO", oeSERIE.TDO_codigo));

                DataTable dt = new DataTable();
                dad.Fill(dt);

                return(dt);
            }
        }
Esempio n. 11
0
        public frmOP_GeneracionDocumentos()
        {
            InitializeComponent();

            this.cmbTipoDocumento.ValueMember   = "TDO_codigo";
            this.cmbTipoDocumento.DisplayMember = "TDO_nombre";
            this.cmbTipoDocumento.DataSource    = balTIPO_DOCUMENTO.poblar();

            eSERIE oeSERIE = new eSERIE();

            oeSERIE.TDO_codigo = this.cmbTipoDocumento.SelectedValue.ToString();
            ePEDIDO oePEDIDO = new ePEDIDO();

            oePEDIDO.PED_fecha = Convert.ToDateTime(this.dtpFecha.Value.ToShortDateString());

            this.cmbSerie.ValueMember   = "SER_serie";
            this.cmbSerie.DisplayMember = "SER_serie";
            this.cmbSerie.DataSource    = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO);
        }
Esempio n. 12
0
        public bool actualizarRegistro(eSERIE oeSERIE)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_SERIE_actualizarRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@SER_SERIE", oeSERIE.SER_serie));                           //variable tipo:string
                cmd.Parameters.Add(new SqlParameter("@TDO_CODIGO", oeSERIE.TDO_codigo));                         //variable tipo:string
                cmd.Parameters.Add(new SqlParameter("@SER_CORRELATIVO_ACTUAL", oeSERIE.SER_correlativo_actual)); //variable tipo:int
                cmd.Parameters.Add(new SqlParameter("@SER_CORRELATIVO_DESDE", oeSERIE.SER_correlativo_desde));   //variable tipo:int
                cmd.Parameters.Add(new SqlParameter("@SER_CORRELATIVO_HASTA", oeSERIE.SER_correlativo_hasta));   //variable tipo:int

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
Esempio n. 13
0
        private void cargarDataDestino()
        {
            eSERIE oeSERIE = new eSERIE();

            oeSERIE.TDO_codigo = this.cmbTipoDocumento.SelectedValue.ToString();
            ePEDIDO oePEDIDO = new ePEDIDO();

            oePEDIDO.PED_fecha = Convert.ToDateTime(this.dtpFecha.Value.ToShortDateString());

            this.cmbSerie.ValueMember   = "SER_serie";
            this.cmbSerie.DisplayMember = "SER_serie";
            this.cmbSerie.DataSource    = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO);

            this.txtCantidadDocumentos.Text = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO).Rows[0]["CantidadDocumentos"].ToString();

            if (this.chkReasignacion.Checked)
            {
                this.txtCorrelativoInicial.Text = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO).Rows[0]["PrimerCorrPrev"].ToString();
            }
            else
            {
                this.txtCorrelativoInicial.Text = balSERIE.obtenerSeriesPorTipoDocumento(oeSERIE, oePEDIDO).Rows[0]["PrimerCorrDisp"].ToString();
            }
        }