Beispiel #1
0
 public bool Modificar_DB(List <ro_Grupo_empleado_det_Info> lista)
 {
     try
     {
         int sec = 0;
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             foreach (var info in lista)
             {
                 if (sec == 0)
                 {
                     db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_Grupo_empleado_det where IdEmpresa='" + info.IdEmpresa + "' and IdGrupo='" + info.IdGrupo + "' ");
                 }
                 sec++;
                 ro_Grupo_empleado_det add = new ro_Grupo_empleado_det();
                 add.IdEmpresa          = info.IdEmpresa;
                 add.IdGrupo            = info.IdGrupo;
                 add.cod_Pago_Variable  = info.cod_Pago_Variable;
                 add.Porcentaje_calculo = info.Porcentaje_calculo;
                 db.ro_Grupo_empleado_det.Add(add);
                 db.SaveChanges();
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         MensajeError = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
Beispiel #2
0
 public bool Guardar_DB(List <ro_Grupo_empleado_det_Info> lista)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             foreach (var item in lista)
             {
                 ro_Grupo_empleado_det add = new ro_Grupo_empleado_det();
                 add.IdEmpresa         = item.IdEmpresa;
                 add.IdGrupo           = item.IdGrupo;
                 add.cod_Pago_Variable = item.cod_Pago_Variable;
                 //add.Valor = item.Valor;
                 //  add.Observacion = item.Observacion;
                 db.ro_Grupo_empleado_det.Add(add);
                 db.SaveChanges();
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         MensajeError = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }