public Boolean guardarDB(cp_TipoDocumento_Info Info) { try { List <cp_TipoDocumento_Info> Lst = new List <cp_TipoDocumento_Info>(); using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar()) { var Address = new cp_TipoDocumento(); Address.CodTipoDocumento = Info.CodTipoDocumento; Address.Codigo = Info.CodTipoDocumento; Address.Descripcion = Info.Descripcion; Address.Orden = Info.Orden; Address.DeclaraSRI = Info.DeclaraSRI; Address.GeneraRetencion = Info.GeneraRetencion; Address.CodSRI = Info.CodSRI; Address.Estado = "A"; Address.IdUsuario = Info.IdUsuario; Address.Fecha_Transac = DateTime.Now; Address.Codigo_Secuenciales_Transaccion = Info.Codigo_Secuenciales_Transaccion; Address.Sustento_Tributario = Info.Sustento_Tributario; Context.cp_TipoDocumento.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public Boolean GuardarDB(cp_TipoDocumento_Info Info) { try { List <cp_TipoDocumento_Info> Lst = new List <cp_TipoDocumento_Info>(); using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar()) { // var contact = cp_TipoDocumento.Createcp_TipoDocumento("","",0,"","","",DateTime.Now); var Address = new cp_TipoDocumento(); //Address.IdTipoDocumento = getId(Info.IdTipoDocumento); Address.CodTipoDocumento = Info.CodTipoDocumento; Address.Codigo = Info.CodTipoDocumento; Address.Descripcion = Info.Descripcion; Address.Orden = Info.Orden; Address.DeclaraSRI = Info.DeclaraSRI; Address.GeneraRetencion = Info.GeneraRetencion; Address.CodSRI = Info.CodSRI; Address.Estado = "A"; Address.IdUsuario = Info.IdUsuario; Address.Fecha_Transac = Info.Fecha_Transac; Address.nom_pc = Info.nom_pc; Address.ip = Info.ip; Address.Codigo_Secuenciales_Transaccion = Info.Codigo_Secuenciales_Transaccion; Address.Sustento_Tributario = Info.Sustento_Tributario; Address.ManejaTalonario = Info.ManejaTalonario; //contact = Address; Context.cp_TipoDocumento.Add(Address); 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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }