当前位置: 首页>>代码示例>>C#>>正文


C# db_SeguimientoProtocolo_r2Entities.SaveChanges方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:32,代码来源:CondProRepository.cs

示例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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:32,代码来源:EstPuntoMedRepository.cs

示例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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:31,代码来源:SistemaRepository.cs

示例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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:32,代码来源:EstructuraDependenciaRepository.cs

示例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;
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:28,代码来源:CiTrakingRepository.cs

示例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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:31,代码来源:PuntoMedicionRepository.cs

示例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);
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:32,代码来源:AccionProtocoloRepository.cs

示例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)
     {
         ;
     }
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:25,代码来源:SyncLogRepository.cs

示例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();
                    }
                }
            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:35,代码来源:AppUsuarioRepository.cs

示例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();
     }
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:9,代码来源:ServerLastDataRepository.cs

示例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();
     }
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:13,代码来源:AppBitacoraRepository.cs

示例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 });
                }

            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:49,代码来源:AppSettingsRepository.cs

示例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 });
                }

            }
        }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:48,代码来源:CatProtocoloRepository.cs

示例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)
         {
             ;
         }
     }
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:16,代码来源:SyncRepository.cs

示例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();
     }
 }
开发者ID:slytsal,项目名称:wpfsistemalluviasv2,代码行数:17,代码来源:UploadLogRepository.cs


注:本文中的db_SeguimientoProtocolo_r2Entities.SaveChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。