public AccountSubtype Get(int id) { AccountSubtype subtype = (from sub in conn.Table <AccountSubtype>() where sub.id == id select sub ).First <AccountSubtype>(); return(subtype); }
public int Add(string name, string code, string typeString) { int add = -1; try { int type = int.Parse(typeString); AccountSubtype subtype = new AccountSubtype() { name = name, code = code, type = type, deleted = 0 }; conn.Insert(subtype); add = subtype.id; } catch (Exception e) { Debug.WriteLine(e.ToString()); add = -1; } return(add); }