本文整理汇总了C#中db_SeguimientoProtocolo_r2Entities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# db_SeguimientoProtocolo_r2Entities.SaveChanges方法的具体用法?C# db_SeguimientoProtocolo_r2Entities.SaveChanges怎么用?C# db_SeguimientoProtocolo_r2Entities.SaveChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db_SeguimientoProtocolo_r2Entities
的用法示例。
在下文中一共展示了db_SeguimientoProtocolo_r2Entities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteCondPro
// Delete.
public void DeleteCondPro(IEnumerable<Model.CondProModel> condpros)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.CondProModel p in condpros)
{
CAT_CONDPRO result = null;
try
{
result = (from o in entity.CAT_CONDPRO
where o.IdCondicion == p.IdCondicion
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例2: DeleteEstPuntoMed
// Delete.
public void DeleteEstPuntoMed(IEnumerable<Model.EstPuntoMedModel> estpuntomeds)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.EstPuntoMedModel p in estpuntomeds)
{
REL_EST_PUNTOMED result = null;
try
{
result = (from o in entity.REL_EST_PUNTOMED
where o.IdEstPuntoMed == p.IdEstPuntoMed
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例3: DeleteSistema
// Delete.
public void DeleteSistema(IEnumerable<Model.SistemaModel> sistemas)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.SistemaModel p in sistemas)
{
CAT_SISTEMA result = null;
try
{
result = (from o in entity.CAT_SISTEMA
where o.IdSistema == p.IdSistema
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例4: DeleteEstructuraDependencia
// Delete.
public void DeleteEstructuraDependencia(IEnumerable<Model.EstructuraDependenciaModel> estructuradependencias)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.EstructuraDependenciaModel p in estructuradependencias)
{
REL_ESTRUCTURA_DEPENDENCIA result = null;
try
{
result = (from o in entity.REL_ESTRUCTURA_DEPENDENCIA
where o.IdEstructuraDependencia == p.IdEstructuraDependencia
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例5: ConfirmationUpload
public bool ConfirmationUpload(List<CiTrackingUploadConfirmationModel> items)
{
bool x = false;
using (var entity=new db_SeguimientoProtocolo_r2Entities())
{
foreach (var row in items)
{
try
{
CI_TRACKING result = null;
result = (from i in entity.CI_TRACKING
where i.IdTracking == row.IdTracking
select i).First();
if (result != null)
{
result.IsModified = false;
result.ServerLastModifiedDate = row.SLMD;
}
}
catch (Exception ex)
{
AppBitacoraRepository.Insert(new AppBitacoraModel() { Fecha = DateTime.Now, Metodo = ex.StackTrace, Mensaje = ex.Message });
}
}
entity.SaveChanges();
}
return x;
}
示例6: DeletePuntoMedicion
// Delete.
public void DeletePuntoMedicion(IEnumerable<Model.PuntoMedicionModel> puntomedicions)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.PuntoMedicionModel p in puntomedicions)
{
CAT_PUNTO_MEDICION result = null;
try
{
result = (from o in entity.CAT_PUNTO_MEDICION
where o.IdPuntoMedicion == p.IdPuntoMedicion
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例7: DeleteAccionProtocolo
// Delete.
public void DeleteAccionProtocolo(IEnumerable<Model.AccionProtocoloModel> accionprotocolos)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
foreach (Model.AccionProtocoloModel p in accionprotocolos)
{
REL_ACCION_PROTOCOLO result = null;
try
{
result = (from o in entity.REL_ACCION_PROTOCOLO
where o.IdAccionProtocolo == p.IdAccionProtocolo
select o).First();
}
catch (Exception)
{
throw;
}
if (result != null)
{
result.IsActive = false;
result.IsModified = true;
result.LastModifiedDate = new UNID().getNewUNID();
}
}
entity.SaveChanges();
_SyncRepository.UpdateSyn(entity);
}
}
示例8: InsertSyncLog
public void InsertSyncLog(SyncLogModel syncModel)
{
try
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
if (syncModel != null)
{
entity.CAT_SYNC_LOG.AddObject(new CAT_SYNC_LOG()
{
IdSyncLog = syncModel.IdSyncLog,
FechaSinc = syncModel.Fecha,
Hora = syncModel.Hora,
Menssage = syncModel.Menssage,
Exception=syncModel.Exception
});
entity.SaveChanges();
}
}
}
catch (Exception)
{
;
}
}
示例9: InsertAppUsuario
public void InsertAppUsuario(Model.AppUsuarioModel usuario)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
if (usuario != null)
{
//Validar si el elemento ya existe
APP_USUARIO result = null;
try
{
result = (from o in entity.APP_USUARIO
where o.IdUsuario == usuario.IdUsuario
select o).First();
}
catch (Exception ex)
{
;
}
if (result == null)
{
entity.APP_USUARIO.AddObject(
new APP_USUARIO()
{
IdUsuario = usuario.IdUsuario,
Nombre = usuario.Nombre,
IsActive = usuario.IsActive
}
);
entity.SaveChanges();
}
}
}
}
示例10: UpdateServerLastDataLocal
public void UpdateServerLastDataLocal(long serverFecha)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
var modified = entity.CAT_SERVER_LASTDATA.First(p => p.IdServerLastData == 20120101000000000);
modified.ActualDate = serverFecha;
entity.SaveChanges();
}
}
示例11: Insert
public static void Insert(AppBitacoraModel model)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
entity.APP_BITACORA.AddObject(new APP_BITACORA()
{
Fecha=model.Fecha,
Metodo=model.Metodo,
Mensaje=model.Mensaje
});
entity.SaveChanges();
}
}
示例12: Upsert
public void Upsert(ObservableCollection<AppSettingsModel> items)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
try
{
foreach (AppSettingsModel row in items)
{
APP_SETTINGS result = null;
try
{
result = (from s in entity.APP_SETTINGS
where s.IdSettings == row.IdSettings
select s).First();
}
catch (Exception)
{
;
}
if (result == null)
{
entity.APP_SETTINGS.AddObject(
new APP_SETTINGS()
{
IdSettings = row.IdSettings,
SettingName = row.SettingName,
Value = row.Value,
LastModifiedDate =(long)row.LastModifiedDate,
ServerLastModifiedDate = row.ServerLastModifiedDate
});
}
if (result != null && result.LastModifiedDate < row.LastModifiedDate)
{
result.IdSettings = row.IdSettings;
result.SettingName = row.SettingName;
result.Value = row.Value;
result.LastModifiedDate =(long)row.LastModifiedDate;
result.ServerLastModifiedDate = row.ServerLastModifiedDate;
}
}
entity.SaveChanges();
}
catch (Exception ex)
{
AppBitacoraRepository.Insert(new AppBitacoraModel() { Fecha = DateTime.Now, Metodo = ex.StackTrace, Mensaje = ex.Message });
}
}
}
示例13: Upsert
public void Upsert(ObservableCollection<ProtocoloModel> items)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
try
{
foreach (ProtocoloModel row in items)
{
CAT_PROTOCOLO result = null;
try
{
result = (from s in entity.CAT_PROTOCOLO
where s.IdPuntoMedicion == row.IdPuntoMedicion
select s).First();
}
catch (Exception)
{
;
}
if (result == null)
{
entity.CAT_PROTOCOLO.AddObject(
new CAT_PROTOCOLO()
{
IdProtocolo = row.IdProtocolo,
IdPuntoMedicion = row.IdPuntoMedicion,
LastModifiedDate = row.LastModifiedDate,
ServerLastModifiedDate = row.ServerLastModifiedDate,
});
}
if (result != null && result.LastModifiedDate < row.LastModifiedDate)
{
result.IdProtocolo = row.IdProtocolo;
result.IdPuntoMedicion = row.IdPuntoMedicion;
result.LastModifiedDate = row.LastModifiedDate;
result.ServerLastModifiedDate = row.ServerLastModifiedDate;
}
}
entity.SaveChanges();
}
catch (Exception ex)
{
AppBitacoraRepository.Insert(new AppBitacoraModel() { Fecha = DateTime.Now, Metodo = ex.StackTrace, Mensaje = ex.Message });
}
}
}
示例14: ResetSyncDummy
public void ResetSyncDummy()
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
try
{
var modified = entity.CAT_SYNC.First(p => p.IdSycn == 20120101000000000);
modified.ActualDate = 0;
entity.SaveChanges();
}
catch (Exception)
{
;
}
}
}
示例15: InsertUploadLogLocal
public void InsertUploadLogLocal(Model.UploadLogModel uploadLog)
{
using (var entity = new db_SeguimientoProtocolo_r2Entities())
{
entity.CAT_UPLOAD_LOG.AddObject(
new CAT_UPLOAD_LOG()
{
IdUploadLog = uploadLog.IdUploadLog,
IdUsuario = uploadLog.IdUsuario,
IpDir = uploadLog.IpDir,
Msg = uploadLog.Msg,
PcName = uploadLog.PcName
}
);
entity.SaveChanges();
}
}