Exemplo n.º 1
0
        protected void gridDetalleDocLibre_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = gridDetalleDocLibre.SelectedRow;
            List <DocumentoPagoLibreDTO> listDocPagoLibre = Session["listDocPagoLibre"] as List <DocumentoPagoLibreDTO>;

            DocumentoPagoLibreDTO docLibre = (from doc in listDocPagoLibre
                                              where doc.Orden == row.Cells[2].Text &&
                                              doc.Lote == int.Parse(row.Cells[3].Text) &&
                                              doc.Prendas == int.Parse(row.Cells[4].Text) &&
                                              doc.Talla == row.Cells[5].Text &&
                                              doc.Tiempo == double.Parse(row.Cells[6].Text)
                                              select doc).FirstOrDefault();

            listDocPagoLibre.Remove(docLibre);
            Session["listDocPagoLibre"]    = listDocPagoLibre;
            gridDetalleDocLibre.DataSource = listDocPagoLibre;
            gridDetalleDocLibre.DataBind();
        }
Exemplo n.º 2
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            List <DocumentoPagoLibreDTO> listDocPagoLibre = Session["listDocPagoLibre"] as List <DocumentoPagoLibreDTO>;

            if (_docPagoLibreBll.ExisteOrdenLoteRecepcion(txtOrden.Text.ToUpper(), int.Parse(txtLote.Text)))
            {
                lblInexistenciaOrden.Visible = false;
                var documentoPagoLibre = new DocumentoPagoLibreDTO
                {
                    CodProveedor     = hidCodProveedor.Value,
                    Orden            = txtOrden.Text.ToUpper(),
                    Lote             = int.Parse(txtLote.Text),
                    CodOperacion     = ddlOperacionesLibres.SelectedValue,
                    DenominacionOper = ddlOperacionesLibres.SelectedItem.Text,
                    Talla            = txtTalla.Text.ToUpper(),
                    Prendas          = int.Parse(txtPrendas.Text),
                    Tiempo           = double.Parse(txtTiempo.Text),
                    Precio           = double.Parse(txtPrecio.Text),
                    Observaciones    = txtObservaciones.Text.ToUpper()
                };
                listDocPagoLibre.Add(documentoPagoLibre);
                Session["listDocPagoLibre"]    = listDocPagoLibre;
                gridDetalleDocLibre.DataSource = listDocPagoLibre;
                gridDetalleDocLibre.DataBind();
                //Limpiar Campos
                txtOrden.Text   = string.Empty;
                txtLote.Text    = string.Empty;
                txtTalla.Text   = string.Empty;
                txtPrendas.Text = string.Empty;
                txtTiempo.Text  = string.Empty;
                txtPrecio.Text  = string.Empty;
            }
            else
            {
                lblInexistenciaOrden.Visible = true;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Ejecuta una consulta de inserción a la tabla Doc_pago_taller_libre.
        /// </summary>
        /// <param name="_docLibre">Objeto de tipo DocumentoPagoLibreDTO</param>
        /// <returns>Variable de tipo int con la cantidad de registros ingresados.</returns>
        public int InsertDocumentoPagoLibre(DocumentoPagoLibreDTO _docLibre)
        {
            List <SqlParameter> _sqlParam = new List <SqlParameter>();

            string query = @"
                insert into Doc_pago_taller_libre(
	                cod_proveedor, 
	                tipo_movimiento, 
	                serie_documento, 
	                nro_documento, 
	                Cod_Cat_Oper, 
	                Nro_Ord_Asig, 
	                Orden, Lote, 
	                Categoria, 
	                Cod_Operacion_Libre, 
	                Talla, Prendas, 
	                Tiempo, Moneda, 
	                Precio, Total, 
	                Observaciones
                )
                values(
	                @codproveedor, @tipomov, 0, 
	                @nrodocumento, 0, 0, 
	                @orden, @lote, 0, 
	                @codoperacion, @talla, 
	                @prendas, @tiempo, @moneda, @precio, @total, 
	                @observaciones
                )";

            _sqlParam.Add(new SqlParameter("@codproveedor", SqlDbType.VarChar)
            {
                Value = _docLibre.CodProveedor
            });
            _sqlParam.Add(new SqlParameter("@tipomov", SqlDbType.VarChar)
            {
                Value = _docLibre.TipoMovimiento
            });
            _sqlParam.Add(new SqlParameter("@nrodocumento", SqlDbType.Int)
            {
                Value = _docLibre.NroDocumento
            });
            _sqlParam.Add(new SqlParameter("@orden", SqlDbType.VarChar)
            {
                Value = _docLibre.Orden
            });
            _sqlParam.Add(new SqlParameter("@lote", SqlDbType.Int)
            {
                Value = _docLibre.Lote
            });
            _sqlParam.Add(new SqlParameter("@codoperacion", SqlDbType.VarChar)
            {
                Value = _docLibre.CodOperacion
            });
            _sqlParam.Add(new SqlParameter("@talla", SqlDbType.VarChar)
            {
                Value = _docLibre.Talla
            });
            _sqlParam.Add(new SqlParameter("@prendas", SqlDbType.Int)
            {
                Value = _docLibre.Prendas
            });
            _sqlParam.Add(new SqlParameter("@tiempo", SqlDbType.Decimal)
            {
                Value = _docLibre.Tiempo
            });
            _sqlParam.Add(new SqlParameter("@moneda", SqlDbType.VarChar)
            {
                Value = _docLibre.Moneda
            });
            _sqlParam.Add(new SqlParameter("@precio", SqlDbType.Decimal)
            {
                Value = _docLibre.Precio
            });
            _sqlParam.Add(new SqlParameter("@total", SqlDbType.Decimal)
            {
                Value = _docLibre.Total
            });
            _sqlParam.Add(new SqlParameter("@observaciones", SqlDbType.VarChar)
            {
                Value = _docLibre.Observaciones
            });
            return(_trans.ExecuteQuery(query, _sqlParam));
        }