Esempio n. 1
0
 public override void ShowPanel(BelugaDb db)
 {
     dbcontacts = db.GetContactList();
 }
Esempio n. 2
0
        /* ��ȡ�û�����ϵ���б�� ���б�ֻ������ϵ�˵Ļ�����Ϣ��
         *  ����ϵ�˵����ݿ�id����Ӹ���ϵ���û�����user_id, ��ϵ�˵�����user_id���ֻ��ţ��û��Ը���ϵ�˵ijƺ���ƺ��ƴ�� */
        public Contact GetContactList()
        {
            SQLiteCommand cmd = _Connection.CreateCommand("select * from t_contact order by name_spell asc;");
            SQLiteDataReader reader = cmd.ExecuteReader();

            Contact contacts = new Contact(reader);
            return contacts;
        }
Esempio n. 3
0
        /* ������������ĸƥ����ϵ�� */
        public Contact FindContactList(string Letter)
        {
            SQLiteCommand cmd = _Connection.CreateCommand("select * from t_contact where name_spell like '@Letter%%' order by name_spell asc;");
            cmd.Parameters.Add("@Letter", DbType.String).Value = Letter;
            SQLiteDataReader reader = cmd.ExecuteReader();

            Contact contacts = new Contact(reader);
            return contacts;
        }
Esempio n. 4
0
        /* ��ȡ��ϵ�˻�����Ϣ��������ϵ�����ݿ�Id */
        public Contact GetContact(int contactId)
        {
            SQLiteCommand cmd = _Connection.CreateCommand("select * from t_contact where cid = @contactId;");
            cmd.Parameters.Add("@contactId", DbType.Int32).Value = contactId;
            SQLiteDataReader reader = cmd.ExecuteReader();

            Contact contacts = new Contact(reader);
            return contacts;
        }
Esempio n. 5
0
        /* ���ݵ绰����ƥ���ȷ����ϵ���Ի�ȡ������ */
        public Contact FindContact(string tel)
        {
            char[] sql = new char[640];
            int nBaseLen = 7, nLimitLen = 12;

            SQLiteCommand cmd = _Connection.CreateCommand("select * from t_contact where dst_user_mobile = '@tel' or cid in " +
                                                    "(select cid from t_contact_detail where home_tel = '@tel' or work_tel = '@tel' or other_tel = '@tel');");
            cmd.Parameters.Add("@tel", DbType.String).Value = tel;
            SQLiteDataReader reader = cmd.ExecuteReader();

            Contact contacts = new Contact(reader);
            return contacts;
        }