public Boolean DescartarConRegContratosTemporal(Decimal ID_REQUERIMIENTO, Decimal ID_SOLICITUD, String OBSERVACIONES) { Boolean correcto = true; Conexion conexion = new Conexion(Empresa); conexion.IniciarTransaccion(); try { if (ActualizarDescarte(ID_REQUERIMIENTO, ID_SOLICITUD, OBSERVACIONES, conexion) == false) { correcto = false; conexion.DeshacerTransaccion(); } else { radicacionHojasDeVida _rad = new radicacionHojasDeVida(Empresa, Usuario); if (_rad.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(ID_REQUERIMIENTO), Convert.ToInt32(ID_SOLICITUD), "EN DESCARTE", Usuario, conexion) == false) { correcto = false; conexion.DeshacerTransaccion(); } } if (correcto == true) { conexion.AceptarTransaccion(); } } catch { correcto = false; conexion.DeshacerTransaccion(); } finally { conexion.Desconectar(); } return(correcto); }
protected void Button_Guardar_Click(object sender, EventArgs e) { EntregaServicioComplementario _entregas = new EntregaServicioComplementario(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); String idEntrega = null; String talla = null; DropDownList dropTalla; TextBox CantidadaEntregar; DataTable tablaConfigurados = new DataTable(); tablaConfigurados.Columns.Add("ID_PRODUCTO"); tablaConfigurados.Columns.Add("CANTIDAD_A_ENTREGAR"); tablaConfigurados.Columns.Add("TALLA"); DataTable tablaLotes = new DataTable(); tablaLotes.Columns.Add("ID_PRODUCTO"); tablaLotes.Columns.Add("ID_LOTE"); tablaLotes.Columns.Add("TALLA"); tablaLotes.Columns.Add("CONTENIDO_LOTE"); tablaLotes.Columns.Add("CANTIDAD_CONFIGURADA"); String[] datos = HiddenField_persona.Value.Split(','); int empleado = Convert.ToInt32(datos[6].ToString()); int id_producto; int id_lote; int ContenidoLote; int cantidadConf; DateTime fecha = System.DateTime.Today; for (int i = 0; i < GridView_Entregas_Configurados.Rows.Count; i++) { id_producto = Convert.ToInt32(GridView_Entregas_Configurados.DataKeys[i].Values["ID_PRODUCTO"].ToString()); dropTalla = GridView_Entregas_Configurados.Rows[i].FindControl("DropDownList_Talla") as DropDownList; CantidadaEntregar = GridView_Entregas_Configurados.Rows[i].FindControl("TextBox_Cantidad") as TextBox; DataRow productosConfigurados = tablaConfigurados.NewRow(); productosConfigurados[0] = id_producto; productosConfigurados[1] = CantidadaEntregar.Text; productosConfigurados[2] = dropTalla.SelectedValue; tablaConfigurados.Rows.Add(productosConfigurados); } for (int i = 0; i < GridView_lotes.Rows.Count; i++) { id_producto = Convert.ToInt32(GridView_lotes.DataKeys[i].Values["ID_PRODUCTO"].ToString()); id_lote = Convert.ToInt32(GridView_lotes.DataKeys[i].Values["ID_LOTE"].ToString()); talla = GridView_lotes.Rows[i].Cells[3].Text; ContenidoLote = Convert.ToInt32(GridView_lotes.Rows[i].Cells[2].Text); cantidadConf = Convert.ToInt32(GridView_lotes.Rows[i].Cells[4].Text); DataRow lotesDisponibles = tablaLotes.NewRow(); lotesDisponibles[0] = id_producto; lotesDisponibles[1] = id_lote; lotesDisponibles[2] = talla; lotesDisponibles[3] = ContenidoLote; lotesDisponibles[4] = cantidadConf; tablaLotes.Rows.Add(lotesDisponibles); } if (HiddenField_idBodega.Value.Equals("")) { Label_MENSAJE_Entregas.Text = "ADVERTENCIA: No se tiene bodega. Verifique con el administrador"; configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas); } else { int idbodega = Convert.ToInt32(HiddenField_idBodega.Value); String faltantes = HiddenField_Faltantes.Value; idEntrega = _entregas.adicionarEntregas(empleado, fecha, idbodega, tablaConfigurados, tablaLotes, datos, faltantes); HiddenField_idEntrega.Value = idEntrega; if (idEntrega.Equals("")) { Label_MENSAJE_Entregas.Text = "ADVERTENCIA: No se almaceno correctamente la entrega. Verifique por favor" + _entregas.MensajeError; configurarMensajes(true, System.Drawing.Color.Red, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas); } else { Panel_Entregas_configurados.Enabled = false; registroContrato _contrato = new registroContrato(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); SecureQueryString QueryStringSeguro; tools _tools = new tools(); QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]); String persona = QueryStringSeguro["persona"].ToString(); String[] datosEmpleado = persona.Split(','); radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); _solIngreso.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(datosEmpleado[1]), Convert.ToInt32(datosEmpleado[0]), "CONTRATADO", Session["USU_LOG"].ToString()); Label_MENSAJE_Entregas.Text = "La entrega se almacenó correctamente. Número entrega: " + idEntrega; configurarMensajes(true, System.Drawing.Color.Green, Label_MENSAJE_Entregas, Panel_MENSAJE_Entregas); activarEmpleado(); } } }