Ejemplo n.º 1
0
        public void UpdateState(Message m)
        {
            ModelConvert <Message> convert = new ModelConvert <Message>();

            SQLiteParameter[] parameters = convert.CreateParameters(m,
                                                                    new ColumnMapping("C_ID", "ID"),
                                                                    new ColumnMapping("C_FLAG", "Flag"));

            LanIMStore.Instance.Update(Sql.UPDATE_MESSAGE_STATE, parameters);
        }
Ejemplo n.º 2
0
        public void UpdateMemo(Contacter c)
        {
            ModelConvert <Contacter> convert = new ModelConvert <Contacter>();

            SQLiteParameter[] parameters = convert.CreateParameters(c,
                                                                    new ColumnMapping("C_MAC", "MAC"),
                                                                    new ColumnMapping("C_MEMO", "Memo"));

            LanIMStore.Instance.Update(Sql.UPDATE_CONTACTER_MEMO, parameters);
        }
Ejemplo n.º 3
0
        public void Update(Contacter m)
        {
            ModelConvert <Contacter> convert = new ModelConvert <Contacter>();

            SQLiteParameter[] parameters = convert.CreateParameters(m,
                                                                    new ColumnMapping("C_NICK_NAME", "NickName"),
                                                                    new ColumnMapping("C_MAC", "MAC"),
                                                                    new ColumnMapping("C_PORT", "Port"),
                                                                    new ColumnMapping("C_IP", "IP"));

            LanIMStore.Instance.Update(Sql.UPDATE_CONTACTER, parameters);
        }
Ejemplo n.º 4
0
        public void Add(Contacter c)
        {
            ModelConvert <Contacter> convert = new ModelConvert <Contacter>();

            SQLiteParameter[] parameters = convert.CreateParameters(c,
                                                                    new ColumnMapping("C_NICK_NAME", "NickName"),
                                                                    new ColumnMapping("C_MAC", "MAC"),
                                                                    new ColumnMapping("C_IP", "IP"),
                                                                    new ColumnMapping("C_PORT", "Port"));

            int id = LanIMStore.Instance.Insert(Sql.ADD_CONTACTER, parameters);

            c.ID = id;
        }
Ejemplo n.º 5
0
        public void Add(Message m)
        {
            if (m is IPrepare)
            {
                //如果是需要准备的文件,事先准备工作
                (m as IPrepare).Prepare();
            }

            ModelConvert <Message> convert = new ModelConvert <Message>();

            SQLiteParameter[] parameters = convert.CreateParameters(m,
                                                                    new ColumnMapping("C_TYPE", "Type"),
                                                                    new ColumnMapping("C_TIME", "Time"),
                                                                    new ColumnMapping("C_FROM_USER_ID", "FromUserId"),
                                                                    new ColumnMapping("C_TO_USER_ID", "ToUserId"),
                                                                    new ColumnMapping("C_CONTENT", "Content"),
                                                                    new ColumnMapping("C_FLAG", "Flag"));

            int id = LanIMStore.Instance.Insert(Sql.ADD_MESSAGE, parameters);

            m.ID = id;
        }