// public ScDUAInicial insertarDua(Int16 numerDua, Int16 idM, Int16 idRegimen, Int16 idtransp, Int16 idAduan, string tipoIdentif, string sumaCantidadBultos) public void insertarDua(DateTime fecha, int ango, int modalidad, int numDua, int regimen, int aduana, int aduanaIngresoDestino, int tipoIdent, string numIdent, char tipoIdentificador, int numeroIdentificante, int IdTransporte, string cantBultos, string validacion, int pesBru, int pesoNeto, decimal cambioDolar, int monedasColones, int impuesto) { // string valor = "hola"; char estado = 'd'; SqlCommand command = ClsConexion.GET_CONEXION().CreateCommand(); try { ScDUAInicial dua = new ScDUAInicial(); command.CommandText = "insertarDuaI"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.Clear(); command.Parameters.Add(new SqlParameter("@fecha", fecha)); // command.Parameters.Add(new SqlParameter("@ango", ango)); command.Parameters.Add(new SqlParameter("@modalidad", modalidad)); command.Parameters.Add(new SqlParameter("@numDua", numDua)); command.Parameters.Add(new SqlParameter("@regimen", regimen)); command.Parameters.Add(new SqlParameter("@aduana", aduana)); command.Parameters.Add(new SqlParameter("@aduanaIngresoDestino", aduanaIngresoDestino)); command.Parameters.Add(new SqlParameter("@tipoIdentif", tipoIdent)); command.Parameters.Add(new SqlParameter("@numIdent", numIdent)); command.Parameters.Add(new SqlParameter("@tipoIdentificador", tipoIdentificador)); command.Parameters.Add(new SqlParameter("@numeroIdentificante", numeroIdentificante)); command.Parameters.Add(new SqlParameter("@IdTransporte", IdTransporte)); command.Parameters.Add(new SqlParameter("@cantBultos", cantBultos)); command.Parameters.Add(new SqlParameter("@validacion", validacion)); command.Parameters.Add(new SqlParameter("@pesoBru", pesBru)); command.Parameters.Add(new SqlParameter("@pesoNeto", pesoNeto)); command.Parameters.Add(new SqlParameter("@cambDolar", cambioDolar)); command.Parameters.Add(new SqlParameter("@monedasColones", monedasColones)); command.Parameters.Add(new SqlParameter("@impuesto", impuesto)); command.Parameters.Add(new SqlParameter("@estado", estado)); command.Connection.Open(); SqlDataReader RESULTADO = ((SqlDataReader)command.ExecuteReader()); /* if (RESULTADO.Read()) * { * empleado.Clave = clave; * empleado.NombreEmpleado = nombre; * empleado.IdEmpleado = Convert.ToInt16(RESULTADO["IdEmpleado"]); * empleado.CorreoEmpleado = RESULTADO["NombreEmpleado"].ToString(); * }*/ // return dua; } catch (Exception ex) { throw ex; } finally { if (command.Connection.State == System.Data.ConnectionState.Open) { command.Connection.Close(); } command.Dispose(); } }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { ScDUAInicial duaInicial = (ScDUAInicial)Session["s_DuaInicial"]; lNumDetalleDua.Text = GridView1.SelectedRow.Cells[2].Text; lNumDetalleDua.Text = GridView1.SelectedRow.Cells[3].Text; Session["s_DuaInicial"] = duaInicial; }
protected void Button1_Click(object sender, EventArgs e) { ScDUAInicial duaInicial = (ScDUAInicial)Session["s_duaInicial"]; //agregar nuevo detalle detalleDua detalleNuevo = new detalleDua(); detalleNuevo.ScFechaDua = Convert.ToDateTime(tbFechaD.Text); detalleNuevo.ScAngoDua = Convert.ToInt32(duaInicial.ScAngoDua.ToString()); detalleNuevo.ScNumeroDua = Convert.ToInt32(lNumDetalleDua.Text.ToString()); detalleNuevo.ScModalidad = Convert.ToInt32(duaInicial.ScModalidad.ToString()); detalleNuevo.ScIdAduana = Convert.ToInt32(duaInicial.ScIdAduana.ToString()); detalleNuevo.ScNombreConsignatorio = tbNombreConsig.Text; detalleNuevo.ScIdPaisOrigen = Convert.ToInt32(ddlPaisOrigen.SelectedValue.ToString()); detalleNuevo.ScPaisDestino = Convert.ToInt32(DropDownList1.SelectedValue.ToString());// deberia ser un int detalleNuevo.ScPaisPuertoEmbarque = Convert.ToInt32(DropDownList2.SelectedValue.ToString()); detalleNuevo.ScPuertoArribo = Convert.ToInt32(DropDownList3.SelectedValue.ToString()); detalleNuevo.ScPuertoSalida = Convert.ToInt32(DropDownList4.SelectedValue.ToString()); //detalleNuevo.ScNumLinea = Convert.ToInt16(duaInicial; detalleNuevo.ScCantidadBultos = Convert.ToInt32(tbcantBultos.Text.ToString()); detalleNuevo.ScCantidadUnidades = Convert.ToInt32(DropDownList7.Text.ToString()); detalleNuevo.ScDescriProductoResumido = tbDescripcionProducto.Text; detalleNuevo.ScDescriProductoDetallado = tbPartidaArancel.Text; //tbPartidaArancel detalleNuevo.ScIdPartidaArancel = Convert.ToInt32(DropDownList6.SelectedValue.ToString()); detalleNuevo.ScValorSeguro = Convert.ToInt32(tbValorseguro.Text.ToString()); // en la base esta como money detalleNuevo.ScValorFlete = Convert.ToInt32(tbFlete.Text.ToString()); detalleNuevo.ScValorOtros = Convert.ToInt32(tbValorOtros.Text.ToString()); detalleNuevo.ScValorFactura = Convert.ToInt32(tbFactura.Text.ToString()); detalleNuevo.ScValorAduaneroCIF_FOB = tbValorAduanero.Text; detalleNuevo.ScValorSeguroPesoBruto = Convert.ToInt32(tbValorseguro.Text.ToString()); detalleNuevo.ScPesoNeto = Convert.ToInt32(tbPesoNeto.Text.ToString()); detalleNuevo.ScIdMoneda = Convert.ToInt32(DropDownList5.SelectedValue.ToString()); detalleNuevo.ScTratadoConvenioInternacional = Convert.ToInt32(DropDownList8.SelectedValue.ToString()); detalleNuevo.ScImpuestoDAI = Convert.ToInt32(tbimpDAI.Text.ToString()); detalleNuevo.ScImpuestoSelectivoConsumo = Convert.ToInt32(tbimpDAI.Text.ToString()); detalleNuevo.ScImpuestoLey6946 = Convert.ToInt32(tbimpDAI.Text.ToString()); detalleNuevo.ScImpuestoIDA = Convert.ToInt32(tbimpDAI.Text.ToString()); detalleNuevo.ScImpuestoIFAM = Convert.ToInt32(tbImpIFAM.Text.ToString()); detalleNuevo.ScImpuestoLey7922 = Convert.ToInt32(tbImp7922.Text.ToString()); detalleNuevo.ScImpuestoLey8114 = Convert.ToInt32(tbImp8114.Text.ToString()); detalleNuevo.ScImpuestoForestal = Convert.ToInt32(tbImpForestal.Text.ToString()); detalleNuevo.ScImpuestoCaldera = Convert.ToInt32(tbImpCaldera.Text.ToString()); detalleNuevo.ScImpuestoVentas = Convert.ToInt32(tbImpVentas.Text.ToString()); detalleNuevo.ScImpuestoSalvaguarda = Convert.ToInt32(tbImpSalvaguarda.Text.ToString()); detalleNuevo.ScImpuestoGofito = Convert.ToInt32(tbImpGolfito.Text.ToString()); detalleNuevo.ScCodigoExoneracion = Convert.ToInt32(tbCodExoneracion.Text.ToString()); detalleNuevo.ScExoneracionDAI = tbCodExoneracion.Text; detalleNuevo.ScExoneracionSelectivoConsumo = tbExonSelectCons.Text; detalleNuevo.ScExoneracionVentas = tbExonVent.Text; detalleNuevo.ScIdCondicionEntrega = ddlCondEntrega.SelectedValue.ToString(); detalleNuevo.ScIdPaisAdquisicion = ddlPaisAdq.SelectedValue.ToString(); duaInicial.listaDetalleDua.Add(detalleNuevo); RefrescarGrid(duaInicial.listaDetalleDua); Session["s_DuaInicial"] = duaInicial; }
public Boolean GuardarBoletaLN(ScDUAInicial duaInicial) { try { return(dataDetalleDua.guardarDetalle(duaInicial)); } catch (Exception) { throw; } }
protected void Button3_Click(object sender, EventArgs e) { ScDUAInicial duaInicial = (ScDUAInicial)Session["s_DuaInicial"]; // detalleDua detalleNuevo = new detalleDua(); Boolean insertar = new logicaDetalle().GuardarBoletaLN(duaInicial); if (insertar == true) { Mensage(); } Session["s_DuaInicial"] = duaInicial; }
/// #region insertarDuaInicial /* public ScDUAInicial insertarDua() * { * SqlCommand command = ClsConexion.GET_CONEXION().CreateCommand(); * try * { * ScDUAInicial duaInicial = new ScDUAInicial(); * command.CommandText = "paValidarEmpleado"; * command.CommandType = System.Data.CommandType.StoredProcedure; * command.Parameters.Clear(); * command.Parameters.Add(new SqlParameter("@nombreEmpleado", ScAngoDua)); * command.Parameters.Add(new SqlParameter("@Clave", clave)); * command.Connection.Open(); * SqlDataReader RESULTADO = ((SqlDataReader)command.ExecuteReader()); * if (RESULTADO.Read()) * { * duaInicial.Clave = clave; * duaInicial.NombreEmpleado = nombre; * duaInicial.IdEmpleado = Convert.ToInt16(RESULTADO["IdEmpleado"]); * duaInicial.CorreoEmpleado = RESULTADO["NombreEmpleado"].ToString(); * } * return empleado; * } * catch (Exception ex) * { * throw ex; * } * finally * { * if (command.Connection.State == System.Data.ConnectionState.Open) * { * command.Connection.Close(); * } * command.Dispose(); * } * } #endregion * * */ public void insertarClientes(ScDUAInicial dua) { SqlTransaction trans1 = null; // SqlCommand comandoSQL = null; // SqlConnection conectar = null; SqlCommand comandoSQL = ClsConexion.GET_CONEXION().CreateCommand(); try { // conectar = Conexion.GetConexion(); // conectar.Open(); // comandoSQL = conectar.CreateCommand(); //trans1 = conectar.BeginTransaction(); comandoSQL.CommandText = "pa_insertarClientes"; comandoSQL.CommandType = System.Data.CommandType.StoredProcedure; //asociar comando a la transacción comandoSQL.Transaction = trans1; // comandoSQL.Connection = conectar; //limpiar parámetros comandoSQL.Parameters.Clear(); comandoSQL.Parameters.Add(new SqlParameter("@nombre", dua.ScAngoDua)); comandoSQL.Parameters.Add(new SqlParameter("@apellido", dua.ScModalidad)); comandoSQL.Parameters.Add(new SqlParameter("@genero", dua.ScIdAduana)); comandoSQL.ExecuteNonQuery(); trans1.Commit(); //MessageBox.Show("Se ha insertado correctamente el cliente " + dua.nombre + dua.apellido); // return true; } catch (Exception ex) { //confirmar negativamente transaccion trans1.Rollback(); throw ex; } finally { } }
protected void gaurdarDInicial_Click(object sender, EventArgs e) { duaInicial = new ScDUAInicial(); try { DateTime fech = DateTime.Parse(tbFecha.Text); int f = fech.Year; duaInicial.ScFechaDua = DateTime.Parse(tbFecha.Text); duaInicial.ScAngoDua = Convert.ToInt32(f.ToString()); duaInicial.ScModalidad = Convert.ToInt32(TextBox10.Text.ToString()); duaInicial.ScNumeroDua = Convert.ToInt32(TextBox10.Text.ToString()); duaInicial.ScIdRegimen = Convert.ToInt32(ddLRegimen.SelectedValue.ToString()); duaInicial.ScIdAduana = Convert.ToInt32(ddlIdAduana.SelectedValue.ToString()); duaInicial.ScIdAduanaIngresoDestino = Convert.ToInt32(ddlIdIngresoDestino.SelectedValue.ToString()); duaInicial.ScTipoIdentificacion = Convert.ToChar(ddlTipoIdentificacion.SelectedValue.ToString()); duaInicial.ScNumeroIdentificacion = tbNumIdentif.Text; duaInicial.ScTipoIdentificadorDeclarante = ddlTipoDeclarante.SelectedValue.ToString(); duaInicial.ScNumeroIdentificacionDeclarante = Convert.ToInt32(TextBox2.Text.ToString()); duaInicial.ScIdTransporte = Convert.ToInt32(ddlIDTransporte.SelectedValue.ToString()); duaInicial.ScSumatoriaCantidadBultos = TextBox3.Text.ToString(); duaInicial.ScValidacionValorAduanero = TextBox4.Text.ToString(); duaInicial.ScTotalPesoBruto = Convert.ToInt32(TextBox5.Text.ToString()); duaInicial.ScTotalPesoNeto = Convert.ToInt32(TextBox6.Text.ToString()); duaInicial.ScTipoCambioDolar = Convert.ToDecimal(tbCambioDolar.Text.ToString()); duaInicial.ScTotalMonedasColones = Convert.ToInt32(TextBox8.Text.ToString()); duaInicial.ScImpuestoTotal = Convert.ToInt32(TextBox9.Text.ToString()); duaInicial.ScEstado = "A"; List <detalleDua> listaDetalle = new List <detalleDua>(); duaInicial.listaDetalleDua = listaDetalle; Session["s_DuaInicial"] = duaInicial; Response.Redirect("~/guiDetalleDua.aspx", true); } catch (Exception ex) { Label1.Text = "Error..." + ex.Message.ToString(); } }
public static Boolean guardarDetalle(ScDUAInicial duaInicial) { // SqlConnection conectar = new data().SQL(); //comando SqlCommand comandoSQL = ClsConexion.GET_CONEXION().CreateCommand(); // SqlCommand comandoSQL = new SqlCommand(); // conectar.Open(); //comandoSQL.CommandText = "paInsertarDetalle"; comandoSQL.CommandText = "paInsertarActualizarDUAInicialyDetalle"; comandoSQL.CommandType = System.Data.CommandType.StoredProcedure; // comandoSQL.Connection = conectar; try { comandoSQL.Parameters.Clear(); DataTable dtTipoDetalle = new DataTable(); dtTipoDetalle.Columns.Add("ScFechaDua", typeof(DateTime)); dtTipoDetalle.Columns.Add("ScAngoDua", typeof(Int32)); dtTipoDetalle.Columns.Add("ScNumeroDua", typeof(Int32)); dtTipoDetalle.Columns.Add("ScModalidad", typeof(Int32)); // dtTipoDetalle.Columns.Add("ScIdRegimen", typeof(Int32)); dtTipoDetalle.Columns.Add("ScIdAduana", typeof(Int32)); /* dtTipoDetalle.Columns.Add("ScIdAduanaIngresoDestino", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScTipoIdentificacion", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScNumeroIdentificacion", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScTipoIdentificadorDeclarante", typeof(char)); * dtTipoDetalle.Columns.Add("ScNumeroIdentificacionDeclarante", typeof(string)); * dtTipoDetalle.Columns.Add("ScIdTransporte", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScSumatoriaCantidadBultos", typeof(string)); * dtTipoDetalle.Columns.Add("ScValidacionValorAduanero", typeof(string)); * dtTipoDetalle.Columns.Add("ScTotalPesoBruto", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScTotalPesoNeto", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScTipoCambioDolar", typeof(decimal)); * dtTipoDetalle.Columns.Add("ScTotalMonedasColones", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScImpuestoTotal", typeof(Int32)); * dtTipoDetalle.Columns.Add("ScEstado", typeof(string));*/ ///------------------------------------ dtTipoDetalle.Columns.Add("ScNombreConsignatorio", typeof(string)); dtTipoDetalle.Columns.Add("ScIdPaisOrigen", typeof(string)); dtTipoDetalle.Columns.Add("ScPaisDestino", typeof(Int32)); dtTipoDetalle.Columns.Add("ScPaisPuertoEmbarque", typeof(Int32)); dtTipoDetalle.Columns.Add("ScPuertoArribo", typeof(Int32)); dtTipoDetalle.Columns.Add("ScPuertoSalida", typeof(Int32)); dtTipoDetalle.Columns.Add("ScNumLinea", typeof(Int32)); dtTipoDetalle.Columns.Add("ScCantidadBultos", typeof(Int32)); dtTipoDetalle.Columns.Add("ScCantidadUnidades", typeof(Int32)); dtTipoDetalle.Columns.Add("ScDescriProductoResumido", typeof(string)); dtTipoDetalle.Columns.Add("ScDescriProductoDetallado", typeof(string)); dtTipoDetalle.Columns.Add("ScIdPartidaArancel", typeof(Int32)); dtTipoDetalle.Columns.Add("ScValorSeguro", typeof(decimal)); dtTipoDetalle.Columns.Add("ScValorFlete", typeof(decimal)); dtTipoDetalle.Columns.Add("ScValorOtros", typeof(decimal)); dtTipoDetalle.Columns.Add("ScValorFactura", typeof(decimal)); dtTipoDetalle.Columns.Add("ScValorAduaneroCIF_FOB", typeof(string)); dtTipoDetalle.Columns.Add("ScValorSeguroPesoBruto", typeof(int)); dtTipoDetalle.Columns.Add("ScPesoNeto", typeof(int)); dtTipoDetalle.Columns.Add("ScIdMoneda", typeof(Int32)); dtTipoDetalle.Columns.Add("ScTratadoConvenioInternacional", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoDAI", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoSelectivoConsumo", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoLey6946", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoIDA", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoIFAM", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoLey7922", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoLey8114", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoForestal", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoCaldera", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoVentas", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoSalvaguarda", typeof(Int32)); dtTipoDetalle.Columns.Add("ScImpuestoGofito", typeof(Int32)); dtTipoDetalle.Columns.Add("ScCodigoExoneracion", typeof(Int32)); dtTipoDetalle.Columns.Add("ScExoneracionDAI", typeof(string)); dtTipoDetalle.Columns.Add("ScExoneracionSelectivoConsumo", typeof(string)); dtTipoDetalle.Columns.Add("ScExoneracionVentas", typeof(string)); dtTipoDetalle.Columns.Add("ScIdCondicionEntrega", typeof(string)); dtTipoDetalle.Columns.Add("ScIdPaisAdquisicion", typeof(string)); foreach (detalleDua objDetalle in duaInicial.listaDetalleDua) { DataRow dr = dtTipoDetalle.NewRow(); dr["ScFechaDua"] = objDetalle.ScFechaDua; dr["ScAngoDua"] = objDetalle.ScAngoDua; dr["ScNumeroDua"] = objDetalle.ScNumeroDua; dr["ScModalidad"] = objDetalle.ScModalidad; dr["ScIdAduana"] = objDetalle.ScIdAduana; dr["ScNombreConsignatorio"] = objDetalle.ScNombreConsignatorio; dr["ScIdPaisOrigen"] = objDetalle.ScIdPaisOrigen; dr["ScPaisDestino"] = objDetalle.ScPaisDestino; dr["ScPaisPuertoEmbarque"] = objDetalle.ScPaisPuertoEmbarque; dr["ScPuertoArribo"] = objDetalle.ScPuertoArribo; dr["ScPuertoSalida"] = objDetalle.ScPuertoSalida; dr["ScNumLinea"] = objDetalle.ScNumLinea; dr["ScCantidadBultos"] = objDetalle.ScCantidadBultos; dr["ScCantidadUnidades"] = objDetalle.ScCantidadUnidades; dr["ScDescriProductoResumido"] = objDetalle.ScDescriProductoResumido; dr["ScDescriProductoDetallado"] = objDetalle.ScDescriProductoDetallado; dr["ScIdPartidaArancel"] = objDetalle.ScIdPartidaArancel; dr["ScValorSeguro"] = objDetalle.ScValorSeguro; dr["ScValorFlete"] = objDetalle.ScValorFlete; dr["ScValorOtros"] = objDetalle.ScValorOtros; dr["ScValorFactura"] = objDetalle.ScValorFactura; dr["ScValorAduaneroCIF_FOB"] = objDetalle.ScValorAduaneroCIF_FOB; dr["ScValorSeguroPesoBruto"] = objDetalle.ScValorSeguroPesoBruto; dr["ScPesoNeto"] = objDetalle.ScPesoNeto; dr["ScIdMoneda"] = objDetalle.ScIdMoneda; dr["ScTratadoConvenioInternacional"] = objDetalle.ScTratadoConvenioInternacional; dr["ScImpuestoDAI"] = objDetalle.ScImpuestoDAI; dr["ScImpuestoSelectivoConsumo"] = objDetalle.ScImpuestoSelectivoConsumo; dr["ScImpuestoLey6946"] = objDetalle.ScImpuestoLey6946; dr["ScImpuestoIDA"] = objDetalle.ScImpuestoIDA; dr["ScImpuestoIFAM"] = objDetalle.ScImpuestoIFAM; dr["ScImpuestoLey7922"] = objDetalle.ScImpuestoLey7922; dr["ScImpuestoLey8114"] = objDetalle.ScImpuestoLey8114; dr["ScImpuestoForestal"] = objDetalle.ScImpuestoForestal; dr["ScImpuestoCaldera"] = objDetalle.ScImpuestoCaldera; dr["ScImpuestoVentas"] = objDetalle.ScImpuestoVentas; dr["ScImpuestoSalvaguarda"] = objDetalle.ScImpuestoSalvaguarda; dr["ScImpuestoGofito"] = objDetalle.ScImpuestoGofito; dr["ScCodigoExoneracion"] = objDetalle.ScCodigoExoneracion; dr["ScExoneracionDAI"] = objDetalle.ScExoneracionDAI; dr["ScExoneracionSelectivoConsumo"] = objDetalle.ScExoneracionSelectivoConsumo; dr["ScExoneracionVentas"] = objDetalle.ScExoneracionVentas; dr["ScIdCondicionEntrega"] = objDetalle.ScIdCondicionEntrega; dr["ScIdPaisAdquisicion"] = objDetalle.ScIdPaisAdquisicion; dtTipoDetalle.Rows.Add(dr); } comandoSQL.Parameters.Add(new SqlParameter("@listadetalleD", dtTipoDetalle)); comandoSQL.Parameters.Add(new SqlParameter("@fecha", duaInicial.ScFechaDua)); comandoSQL.Parameters.Add(new SqlParameter("@ango", duaInicial.ScAngoDua)); comandoSQL.Parameters.Add(new SqlParameter("@modalidad", duaInicial.ScModalidad)); comandoSQL.Parameters.Add(new SqlParameter("@numDua", duaInicial.ScNumeroDua)); comandoSQL.Parameters.Add(new SqlParameter("@regimen", duaInicial.ScIdRegimen)); comandoSQL.Parameters.Add(new SqlParameter("@aduana", duaInicial.ScIdAduana)); comandoSQL.Parameters.Add(new SqlParameter("@aduanaIngresoDestino", duaInicial.ScIdAduanaIngresoDestino)); comandoSQL.Parameters.Add(new SqlParameter("@tipoIdentif", duaInicial.ScTipoIdentificacion)); comandoSQL.Parameters.Add(new SqlParameter("@numIdent", duaInicial.ScNumeroIdentificacion)); comandoSQL.Parameters.Add(new SqlParameter("@tipoIdentificador", duaInicial.ScTipoIdentificacion)); comandoSQL.Parameters.Add(new SqlParameter("@numeroIdentificante", duaInicial.ScNumeroIdentificacionDeclarante)); comandoSQL.Parameters.Add(new SqlParameter("@IdTransporte", duaInicial.ScIdTransporte)); comandoSQL.Parameters.Add(new SqlParameter("@cantBultos", duaInicial.ScSumatoriaCantidadBultos)); comandoSQL.Parameters.Add(new SqlParameter("@validacion", duaInicial.ScValidacionValorAduanero)); comandoSQL.Parameters.Add(new SqlParameter("@pesoBru", duaInicial.ScTotalPesoBruto)); comandoSQL.Parameters.Add(new SqlParameter("@pesoNeto", duaInicial.ScTotalPesoNeto)); comandoSQL.Parameters.Add(new SqlParameter("@cambDolar", duaInicial.ScTipoCambioDolar)); comandoSQL.Parameters.Add(new SqlParameter("@monedasColones", duaInicial.ScTotalMonedasColones)); comandoSQL.Parameters.Add(new SqlParameter("@impuesto", duaInicial.ScImpuestoTotal)); comandoSQL.Parameters.Add(new SqlParameter("@estado", duaInicial.ScEstado)); comandoSQL.Connection.Open(); comandoSQL.ExecuteNonQuery(); return(true); } catch (Exception ex) { Console.Write("ERROR: " + ex.Message); return(false); } finally { //Cerrar conexión if (comandoSQL.Connection.State == System.Data.ConnectionState.Open) { comandoSQL.Connection.Close(); } comandoSQL = null; } }
protected void Page_Load(object sender, EventArgs e) { detDua = new dataDetalleDua(); con = new ClsConexion(); duaInicial = new ScDUAInicial(); //// ------------------------- if (!IsPostBack) { /////------------------------------ dtPaisOrigen = detDua.obtenerPaisOrigen(); ddlPaisOrigen.DataSource = dtPaisOrigen.DefaultView; ddlPaisOrigen.DataTextField = "descripcion"; ddlPaisOrigen.DataValueField = "codigo"; ddlPaisOrigen.DataBind(); ddlPaisOrigen.SelectedIndex = 0; ////-------------------------- dtPaisOrigen = detDua.obtenerPaisOrigen(); DropDownList1.DataSource = dtPaisOrigen.DefaultView; DropDownList1.DataTextField = "descripcion"; DropDownList1.DataValueField = "codigo"; DropDownList1.DataBind(); DropDownList1.SelectedIndex = 0; ////-------------------------- dtArribo = detDua.obtenerPuerto(); DropDownList3.DataSource = dtArribo.DefaultView; DropDownList3.DataTextField = "descripcion"; DropDownList3.DataValueField = "codigo"; DropDownList3.DataBind(); DropDownList3.SelectedIndex = 0; ////-------------------------- dtArribo = detDua.obtenerPuerto(); DropDownList2.DataSource = dtArribo.DefaultView; DropDownList2.DataTextField = "descripcion"; DropDownList2.DataValueField = "codigo"; DropDownList2.DataBind(); DropDownList2.SelectedIndex = 0; /////------------------------------arribo dtArribo = detDua.obtenerPuerto(); DropDownList4.DataSource = dtArribo.DefaultView; DropDownList4.DataTextField = "descripcion"; DropDownList4.DataValueField = "codigo"; DropDownList4.DataBind(); DropDownList4.SelectedIndex = 0; /////------------------------------ dtMoneda = detDua.obtenerMonedas(); DropDownList5.DataSource = dtMoneda.DefaultView; DropDownList5.DataTextField = "descripcion"; DropDownList5.DataValueField = "codigo"; DropDownList5.DataBind(); DropDownList5.SelectedIndex = 0; /////------------------------------arancelPartida arancelPartida = detDua.obtenerArancelPartidas(); DropDownList6.DataSource = arancelPartida.DefaultView; DropDownList6.DataTextField = "descripcion"; DropDownList6.DataValueField = "codigo"; DropDownList6.DataBind(); DropDownList6.SelectedIndex = 0; #region /////------------------------------ COND DDE entrega /* arancelPartida = detDua.obtenerCatalogocondicionEntrega(); * DropDownList6.DataSource = arancelPartida.DefaultView; * DropDownList6.DataTextField = "descripcion"; * DropDownList6.DataValueField = "codigo"; * DropDownList6.DataBind(); * DropDownList6.SelectedIndex = 0;*/ #endregion #region /////------------------------------ unidad dtUnidad = detDua.obtenerUnidades(); DropDownList7.DataSource = dtUnidad.DefaultView; DropDownList7.DataTextField = "descripcion"; DropDownList7.DataValueField = "codigo"; DropDownList7.DataBind(); DropDownList7.SelectedIndex = 0; #endregion #region/////----------------------------- TRATADO CNVENCIONAL dtUnidad = detDua.obtenerUnidades(); DropDownList8.DataSource = dtUnidad.DefaultView; DropDownList8.DataTextField = "descripcion"; DropDownList8.DataValueField = "codigo"; DropDownList8.DataBind(); DropDownList8.SelectedIndex = 0; #endregion #region /////////----------------------------ddlPaisAdq dtPaisAdq = detDua.obtenerPaisOrigen(); ddlPaisAdq.DataSource = dtPaisAdq.DefaultView; ddlPaisAdq.DataTextField = "descripcion"; ddlPaisAdq.DataValueField = "codigo"; ddlPaisAdq.DataBind(); ddlPaisAdq.SelectedIndex = 0; #endregion #region ////////-------------------------------- ddlCondEntrega DataTable dtCondEntrega; dTCondEntrega = detDua.obtenerCatalogocondicionEntrega(); ddlCondEntrega.DataSource = dTCondEntrega.DefaultView; ddlCondEntrega.DataTextField = "descripc"; ddlCondEntrega.DataValueField = "codigo"; ddlCondEntrega.DataBind(); ddlCondEntrega.SelectedIndex = 0; #endregion if (Session["s_DuaInicial"] != null) { ScDUAInicial dInicial = (ScDUAInicial)Session["s_DuaInicial"]; lNumDetalleDua.Text = dInicial.ScNumeroDua.ToString(); idModalidad.Text = dInicial.ScModalidad.ToString(); idAduana.Text = dInicial.ScIdAduana.ToString(); tbFechaD.Text = dInicial.ScFechaDua.ToString(); RefrescarGrid(dInicial.listaDetalleDua); } else { Label1.Text = "No cargo ningun producto"; } } }
protected void Button2_Click(object sender, EventArgs e) { ScDUAInicial duaInicial = (ScDUAInicial)Session["s_DuaInicial"]; duaInicial.listaDetalleDua.RemoveAt(Convert.ToInt32(lNumDetalleDua.Text) - 1); //falta renumerar }