Beispiel #1
0
 public Boolean AnularDB(cp_archivos_para_banco_x_cxp_Info Info)
 {
     try
     {
         using (EntitiesCuentasxPagar Entity = new EntitiesCuentasxPagar())
         {
             cp_archivos_para_banco_x_cxp info_archivo = Entity.cp_archivos_para_banco_x_cxp.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdArchivo == Info.IdArchivo);
             if (info_archivo != null)
             {
                 info_archivo.IdUsuarioUltAnu  = Info.IdUsuarioUltAnu;
                 info_archivo.Fecha_UltAnu     = Info.Fecha_UltAnu;
                 info_archivo.estado           = "I";
                 info_archivo.Motivo_anulacion = Info.Motivo_anulacion;
                 Entity.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 mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
Beispiel #2
0
        public Boolean GuardaDB(cp_archivos_para_banco_x_cxp_Info info, ref decimal Id, ref string mensaje)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    cp_archivos_para_banco_x_cxp data = new cp_archivos_para_banco_x_cxp();

                    data.IdEmpresa     = info.IdEmpresa;
                    data.IdArchivo     = Get_IdArchivo(info.IdEmpresa);
                    data.IdBanco       = info.IdBanco;
                    data.Fecha         = info.Fecha;
                    data.Cod_Empresa   = info.Cod_Empresa;
                    data.Tipo          = info.Tipo;
                    data.Nom_Archivo   = info.Nom_Archivo;
                    data.archivo       = info.archivo;
                    data.estado        = info.estado;
                    data.IdUsuario     = info.IdUsuario;
                    data.Fecha_Transac = info.Fecha_Transac;
                    data.observacion   = info.observacion;
                    Id = data.IdArchivo;
                    Context.cp_archivos_para_banco_x_cxp.Add(data);
                    Context.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 mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }