Limpieza masiva ClsPaginas
-RegistraScript se unifica en una sola clase static/shared y se simplica el código -Alert se vuelve estático -Random() no se manda a crear cada vez que se registra un script (esto tenía un costo alto) -Se corrigieron unos errores en los nombres de funciones -Las clases que ya heredan de Clspaginas, se les quita el this a RegistraScript y a Alert puesto que era innecesario (y además al haberlos vuelto métodos estáticos, NO pueden llamarse de un this)
This commit is contained in:
@@ -81,7 +81,7 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
int NoEstatusInicio = DtEstatus.COUNT("CveEstatusTrayecto", "EsInicio = True");
|
||||
if (NoEstatusInicio > 0)
|
||||
{
|
||||
this.Alert("Ya existe un estatus de inicio.", TipoMensaje.MsgAdvertencia);
|
||||
Alert("Ya existe un estatus de inicio.", TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
int NoEstatusFin = DtEstatus.COUNT("CveEstatusTrayecto", "EsFin = True");
|
||||
if (NoEstatusFin > 0)
|
||||
{
|
||||
this.Alert("Ya existe un estatus de final.", TipoMensaje.MsgAdvertencia);
|
||||
Alert("Ya existe un estatus de final.", TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
|
||||
if (RblInicioFin.SelectedValue == "2" && CveEstatusAnterior <= 0)
|
||||
{
|
||||
this.Alert("No se puede agregar el estatus. Debe seleccionar un estatus anterior.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Alert("No se puede agregar el estatus. Debe seleccionar un estatus anterior.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
@@ -122,18 +122,18 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
{
|
||||
if (ObjGPS.UpdateEstatusTrayectos(CveEstatusSiguiente,"",false,false, CveEstatusNuevo, UsuarioActual.CveCliente))
|
||||
{
|
||||
this.Alert("El estatus se actualizo correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
Alert("El estatus se actualizo correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("Ocurrió un error al actualizar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
Alert("Ocurrió un error al actualizar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
this.Alert("El estatus se agrego correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
Alert("El estatus se agrego correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("Ocurrió un error al agregar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
Alert("Ocurrió un error al agregar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
{
|
||||
if (ObjGPS.UpdateEstatusTrayectos(CveEstatusSiguiente,"",false,false, CveEstatusAnterior, UsuarioActual.CveCliente))
|
||||
{
|
||||
this.Alert("El estatus se eliminó correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
Alert("El estatus se eliminó correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public partial class GPS_CatGrupos : ClsPaginas
|
||||
BtnGuardar.Text = "Guardar";
|
||||
UPConsulta.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalGrupo').modal();");
|
||||
RegistraScript("$('#DvModalGrupo').modal();");
|
||||
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public partial class GPS_CatGrupos : ClsPaginas
|
||||
|
||||
ObjGPS.Dispose();
|
||||
limpiarCamposModal();
|
||||
this.RegistraScript("$('#DvModalGrupo').modal('hide');");
|
||||
RegistraScript("$('#DvModalGrupo').modal('hide');");
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ public partial class GPS_CatGrupos : ClsPaginas
|
||||
BtnGuardar.Text = "Actualizar";
|
||||
UPConsulta.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalGrupo').modal('show');");
|
||||
RegistraScript("$('#DvModalGrupo').modal('show');");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -197,6 +197,6 @@ public partial class GPS_RepParardas : ClsPaginas
|
||||
{
|
||||
//var table = new System.Web.UI.HtmlControls.HtmlTable();
|
||||
// table.InnerHtml = DivIndicadores.InnerHtml;
|
||||
GvDatos.ExportToExcel("ReporteRutas");
|
||||
GvDatos.ExportToExcelX("ReporteRutas");
|
||||
}
|
||||
}
|
||||
@@ -145,12 +145,12 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
{
|
||||
IniciaDTStops();
|
||||
LimpiarModal();
|
||||
this.RegistraScript("$('#DivShipment').modal({backdrop: 'static', keyboard: false});");
|
||||
RegistraScript("$('#DivShipment').modal({backdrop: 'static', keyboard: false});");
|
||||
}
|
||||
protected void LnkAddNewStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
LimpiarModalStop();
|
||||
this.RegistraScript("$('#DivStop').modal({backdrop: 'static', keyboard: false});");
|
||||
RegistraScript("$('#DivStop').modal({backdrop: 'static', keyboard: false});");
|
||||
}
|
||||
protected void LnkAddStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -190,7 +190,7 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
this.OnError("Ocurrió un error al registrar la parada (stop)", ex);
|
||||
}
|
||||
|
||||
this.RegistraScript("$('#DivStop').modal('hide');");
|
||||
RegistraScript("$('#DivStop').modal('hide');");
|
||||
}
|
||||
protected void LimpiarModal()
|
||||
{
|
||||
@@ -623,13 +623,13 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
if (TieneError)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
this.Alert("No se pudo guardar el shipment.", TipoMensaje.MsgError);
|
||||
Alert("No se pudo guardar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGPS.Commit();
|
||||
this.Alert("El shipment se envió correctamente a FreightVerify.", TipoMensaje.MsgInformacion);
|
||||
this.RegistraScript("$('#DivShipment').modal('hide');");
|
||||
Alert("El shipment se envió correctamente a FreightVerify.", TipoMensaje.MsgInformacion);
|
||||
RegistraScript("$('#DivShipment').modal('hide');");
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
@@ -639,7 +639,7 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo enviar el shipment a FreightVerify.", TipoMensaje.MsgError);
|
||||
Alert("No se pudo enviar el shipment a FreightVerify.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
|
||||
CargaStops(CveShipment);
|
||||
|
||||
this.RegistraScript("$('#DivEvent').modal({backdrop: 'static', keyboard: false});", "1");
|
||||
RegistraScript("$('#DivEvent').modal({backdrop: 'static', keyboard: false});", "1");
|
||||
CargaPosicionStop(DdlStops.SelectedValue.ToEntero());
|
||||
UpEvent.Update();
|
||||
}
|
||||
@@ -662,7 +662,7 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
TxtLatLongEvent.Text = string.Format("{0},{1}", row["Lat"].ToString(), row["Lon"].ToString());
|
||||
TxtLatLongEvent.Text = string.Format("{0},{1}", row["Lat"].ToString(), row["Lon"].ToString());
|
||||
|
||||
this.RegistraScript($"cargapin('{row["Lat"].ToString()}','{row["Lon"].ToString()}');", "2"); ;
|
||||
RegistraScript($"cargapin('{row["Lat"].ToString()}','{row["Lon"].ToString()}');", "2"); ;
|
||||
}
|
||||
private void CargaStops(int CveShipment)
|
||||
{
|
||||
@@ -693,7 +693,7 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
@@ -727,16 +727,16 @@ public partial class GPS_Shipments : ClsPaginas
|
||||
if (envio)
|
||||
{
|
||||
Alert("Se envio el evento correctamente.");
|
||||
this.RegistraScript("$('#DivEvent').modal('hide');");
|
||||
RegistraScript("$('#DivEvent').modal('hide');");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user