Пример #1
0
        public ActionResult AddDisableword(string disable)
        {
            string nr = disable.Trim();

            string[] strs;
            if (!string.IsNullOrEmpty(nr))
            {
                strs = nr.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
                Disable_word word = new Disable_word();
                for (int i = 0; i < strs.Length; i++)
                {
                    word.Content = strs[i];
                    dis.AddDisable_word(word);
                }
            }
            return(Redirect("/Admin/Index"));
        }
Пример #2
0
        public IMessageEntity AddDisable_word(Disable_word w)
        {
            IMessageEntity msg = new MessageEntity();

            w.Cdate = DateTime.Now;
            string sql = "insert into disable_word(content,cdate) values(@content,@cdate)";

            MySqlParameter[] pms = new MySqlParameter[2];
            pms[0] = new MySqlParameter("@content", MySqlDbType.String)
            {
                Value = w.Content
            };
            pms[1] = new MySqlParameter("@cdate", MySqlDbType.DateTime)
            {
                Value = w.Cdate
            };
            msg = GetInt(sql, pms);
            return(msg);
        }