E140, Correcion en entrega de ruta
This commit is contained in:
@@ -249,8 +249,6 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
protected void LnkGeneraRecoleccion_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
if (DdlChoferRec.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
@@ -268,10 +266,11 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
//ActualizaOrdenDTGenerarDocumentos();
|
||||
List<int> ListaTimbres = new List<int>();
|
||||
|
||||
|
||||
bool TieneError = false;
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
ObjGeneral.IniciaTransacSQL();
|
||||
try
|
||||
{
|
||||
string Usuario = DdlChofer.SelectedItem.Text;
|
||||
|
||||
int CveDireccionOrigen = -1;
|
||||
@@ -293,7 +292,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
if (CveTimbre <= 0)
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
|
||||
SBError.AppendLine($"Folio <b>{row.DataKey("FolioReferencia")}</b> ocurrió un error al agregar timbre. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
@@ -304,45 +303,42 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al aplicar condiciones de entrega. ");
|
||||
SBError.AppendLine($"Folio <b>{row.DataKey("FolioReferencia")}</b> ocurrió un error al aplicar condiciones de entrega. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega almacen. ");
|
||||
SBError.AppendLine($"Folio <b>{row.DataKey("FolioReferencia")}</b> ocurrió un error al agregar entrega almacen. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
|
||||
foreach (GridViewRow row in gvR.Rows)
|
||||
{
|
||||
try
|
||||
{
|
||||
//MandarNotificacionCorreo(row);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (global::System.Exception ex)
|
||||
{
|
||||
TieneError = true;
|
||||
ModExtensiones.GuardaLog(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
this.OnError("Ocurrió un error al generar la entrega", ex);
|
||||
}
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGeneral.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGeneral.RollBack();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
StringBuilder MensajeAlert = new StringBuilder();
|
||||
//recorrer para timbrar
|
||||
MensajeAlert.Append(" Entregas creadas correctamente <br/><br/>");
|
||||
|
||||
foreach (int cvetimbre in ListaTimbres)
|
||||
{
|
||||
Timbres ObjTimbres = new Timbres("Rec", cvetimbre, UsuarioActual);
|
||||
@@ -378,7 +374,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbres.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
|
||||
CargaDatosRecoleccion();
|
||||
DdlChofer.SelectedValueExist("-1");
|
||||
DdlUnidadCamion.SelectedValueExist("-1");
|
||||
@@ -389,14 +387,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGeneral.RollBack();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(SBError.ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Alert(SBError.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
}
|
||||
private void CargaDatos()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user