示例#1
0
        public PartySubtype Get(int id)
        {
            PartySubtype subtype = (from sub in conn.Table <PartySubtype>()
                                    where sub.id == id
                                    select sub
                                    ).First <PartySubtype>();

            return(subtype);
        }
示例#2
0
        public int Add(string name, string code)
        {
            int add = -1;

            try
            {
                PartySubtype subtype = new PartySubtype()
                {
                    name    = name,
                    code    = code,
                    deleted = 0
                };
                conn.Insert(subtype);
                add = subtype.id;
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
                add = -1;
            }
            return(add);
        }