public static bool getAccountInfo(int Account, ref TAccountInfo CardInfo) { bool flag; try { CardInfo.Size = (ushort)Marshal.SizeOf(typeof(TAccountInfo)); if (GetAccountInfo(Account, ref CardInfo)) { LastMsg = "The request GetAccountInfo is successful"; p_IsGAI = true; return(true); } p_IsGAI = false; LastMsg = GetError(); flag = false; } catch (Exception e) { p_IsGAI = false; LastMsg = e.ToString(); flag = false; } return(flag); }
public static bool setAccountInfo(TAccountInfo CardInfo) { try { if (p_IsGAI) { if (SetAccountInfo(ref CardInfo)) { LastMsg = "The request SetAccountInfo is successful"; return(true); } LastMsg = GetError(); return(false); } LastMsg = "Please first call the function GetAccountInfo"; return(false); } catch (Exception e) { LastMsg = e.ToString(); p_IsGAI = false; return(false); } }
private static extern bool SetAccountInfo(ref TAccountInfo Info);
private static extern bool GetAccountInfo(int Account, ref TAccountInfo Info);
private static void AddAccount(ref TAccountInfo info) { ListAccountsInfo.Add(info); }