Ajuste de codigo para peticion a url de enpoint de task status

This commit is contained in:
2026-03-09 12:18:46 -06:00
parent c52344d7f8
commit 03230e0cba
4 changed files with 64 additions and 13 deletions

View File

@@ -70,7 +70,7 @@ namespace EFCDesk.Forms
};
// Columna de acciones
//table.Columns.Add("Acciones", typeof(Image));
table.Columns.Add("Acciones", typeof(Image));
// Crear el icono UNA sola vez
Bitmap iconoVer = IconChar.Eye.ToBitmap(
@@ -87,7 +87,7 @@ namespace EFCDesk.Forms
row["Estatus"] = exp.Estado;
row["Fecha Registro"] = exp.FechaCreacion;
row["TaskId"] = exp.TaskId;
//row["Acciones"] = iconoVer;
row["Acciones"] = iconoVer;
table.Rows.Add(row);
}
return table;
@@ -115,9 +115,9 @@ namespace EFCDesk.Forms
dgwExpedientes.Columns["Fecha Registro"].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
dgwExpedientes.Columns["Fecha Registro"].Width = 180;
//dgwExpedientes.Columns["Acciones"].Width = 40;
//dgwExpedientes.Columns["Acciones"].HeaderText = "";
//((DataGridViewImageColumn)dgwExpedientes.Columns["Acciones"]).ImageLayout = DataGridViewImageCellLayout.Zoom;
dgwExpedientes.Columns["Acciones"].Width = 40;
dgwExpedientes.Columns["Acciones"].HeaderText = "";
((DataGridViewImageColumn)dgwExpedientes.Columns["Acciones"]).ImageLayout = DataGridViewImageCellLayout.Zoom;
_ = Task.Run(() =>
{
@@ -152,8 +152,8 @@ namespace EFCDesk.Forms
try
{
var apiClient = Globales.ApiClient;
string url = DominioEFC + $"/api/v1/tasks/status/?task_id={taskId}";
return await apiClient.GetAsync(url);
//string url = DominioEFC + $"/api/v1/tasks/status/{taskId}/";
return await apiClient.GetStatusTaskAsync(taskId);
}
catch (Exception ex)
{
@@ -209,7 +209,7 @@ namespace EFCDesk.Forms
}
// Actualizar en SQLite
_sqliteHelper.MarcarCarpetaProcesada(rutaExpediente, nuevoEstado);
_sqliteHelper.ActaulizarStatusCarpeta(rutaExpediente, nuevoEstado);
// Mostrar resultado
MessageBox.Show(mensaje, "Estado de Tarea", MessageBoxButtons.OK, MessageBoxIcon.Information);
@@ -384,6 +384,9 @@ namespace EFCDesk.Forms
if (string.IsNullOrEmpty(taskId))
return;
if (string.IsNullOrEmpty(expediente))
return;
//// Ejecutar trabajo pesado en segundo plano
//var resultado = await Task.Run(() =>
//{
@@ -394,7 +397,7 @@ namespace EFCDesk.Forms
//MessageBox.Show(resultado);
string responseJson = await ConsultarEstadoTareaAsync(taskId);
string responseJson = await ConsultarEstadoTareaAsync(taskId);
await ProcesarRespuestaTareaAsync(responseJson, expediente);

View File

@@ -1902,8 +1902,19 @@ namespace EFCDesk.Forms
private void btn_VisorExpedientes_Click(object sender, EventArgs e)
{
FormExpedientes winExpedientes = new FormExpedientes();
winExpedientes.Show();
var form = Application.OpenForms.OfType<FormExpedientes>().FirstOrDefault();
if (form != null)
{
form.BringToFront();
form.WindowState = FormWindowState.Normal;
}
else
{
FormExpedientes winExpedientes = new FormExpedientes();
winExpedientes.Show();
}
}
}
}