public ct_cbtecble_tipo_x_empresa_Info Get_Info_cbtecble_tipo_x_empresa(int IdEmpresa, int IdTipoCbte) { ct_cbtecble_tipo_x_empresa_Info Obj = new ct_cbtecble_tipo_x_empresa_Info(); try { EntitiesDBConta oEnti = new EntitiesDBConta(); ct_cbtecble_tipo_x_empresa item = oEnti.ct_cbtecble_tipo_x_empresa.FirstOrDefault( q => q.IdEmpresa == IdEmpresa && q.IdTipoCbte == IdTipoCbte); Obj.IdEmpresa = item.IdEmpresa; Obj.IdTipoCbte = item.IdTipoCbte; Obj.UltReg = item.UltReg; return(Obj); } 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(); throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(ct_cbtecble_tipo_x_empresa_Info Info) { try { using (EntitiesDBConta Context = new EntitiesDBConta()) { var Address = new ct_cbtecble_tipo_x_empresa(); Address.IdTipoCbte = Info.IdTipoCbte; Address.IdEmpresa = Info.IdEmpresa; Address.UltReg = 0; Context.ct_cbtecble_tipo_x_empresa.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.ToString(); throw new Exception(ex.ToString()); } }