Exemple #1
0
        public void Update(string w, string d, string user)
        {
            var o = col.FindOne(x => x.keyword == w);

            o.reply       = d;
            o.contributor = user;
            o.time        = DateTime.Now;
            col.Update(o);
        }
Exemple #2
0
        public editDataForm(string alias)
        {
            InitializeComponent();

            db = new LSPMDatabase(Properties.Settings.Default.pwdHash);
            LiteDB.LiteCollection <LSPMData> col = db.getDBCollection();

            col.EnsureIndex(x => x.lAlias);
            editable = col.FindOne(x => x.lAlias.Equals(alias));

            aliasInput.Text             = editable.lAlias;
            userInput.Text              = editable.lUser;
            passwordInput.Text          = editable.lPass;
            userAccessCheck.Checked     = editable.lUserFastAccess;
            passwordAccessCheck.Checked = editable.lPasswordFastAccess;
            markColor(editable.lDataIcon);
        }
Exemple #3
0
        public Message Unsubscribe(string[] parameters, MessageEvent e)
        {
            if (parameters.Length == 0)
            {
                return(new Message("/unsubscribe [feed]"));
            }
            var obj = col.FindOne(x =>
                                  x.endpoint_type == e.GetEndpoint().Item1&&
                                  x.endpoint_num == e.GetEndpoint().Item2&&
                                  x.feed == parameters[0]
                                  );

            if (obj != null)
            {
                col.Delete(x => x.id == obj.id);
                return(new Message("unsubscribed"));
            }
            return(new Message("not subscribed yet"));
        }