Esempio n. 1
0
        public string Add(HtTagInfo tagInfo)
        {
            string h_result = "";
            string h_tagName = tagInfo.HtTagName.Trim();

            if (h_tagName == "")
                h_result = "标签名不能为空";

            if (h_tagName.Length > 50)
                return "标签名不能多于50个字符。";

            // CheckInfo(info);

            //if (Exist(info.HtUrl, info.HtULCase))
            //    return "url已经存在!";

            if (h_result != "")
                return h_result;

            IDataParameter[] m_parameters = new SqlParameter[1];
            m_parameters[0] = new SqlParameter("@HtTagName", SqlDbType.NVarChar, 100);
            m_parameters[0].Value = h_tagName;

            int m_returnCount;

            //执行结果等于1表示添加成功
            m_returnCount = KeleyiSQLHelper.HoverTreeSql.RunProcedureWithReturn("p_HoverTreeSCJ_Tag_Add", m_parameters);

            if (m_returnCount == 1)
                return string.Empty;
            else
                return "添加失败 ";
        }
Esempio n. 2
0
 private void button_add_Click(object sender, EventArgs e)
 {
     HtTagInfo h_tagInfo = new HtTagInfo();
     h_tagInfo.HtTagName = textBox_tagName.Text;
        string h_result= HtTag.Add(h_tagInfo);
     if (h_result == "")
     {
         MessageBox.Show("添加成功!");
         textBox_tagName.Clear();
     }
     else
         MessageBox.Show(h_result);
 }
Esempio n. 3
0
        public string Save(HtTagInfo info)
        {
            IDataParameter[] m_parameters = new SqlParameter[2];
            m_parameters[0] = new SqlParameter("@htid", SqlDbType.Int, 4);
            m_parameters[0].Value = info.HtId;
            m_parameters[1] = new SqlParameter("@htTagName", SqlDbType.NVarChar, 100);
            m_parameters[1].Value = info.HtTagName.Trim();

            int m_returnCount;

            //执行结果等于1表示添加成功
            m_returnCount = KeleyiSQLHelper.HoverTreeSql.RunProcedureWithReturn("p_HoverTreeSCJ_Tag_Save", m_parameters);

            if (m_returnCount == 1)
                return string.Empty;
            else
                return "保存失败 ";
        }
Esempio n. 4
0
        private void button_save_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(numericUpDown_id.Value.ToString());

            HtTagInfo h_info = new HtTagInfo();
            h_info.HtId = _tagId;
            h_info.HtTagName = textBox_tagName.Text;
            string h_tips = HtTag.Save(h_info);
            if (h_tips == "")
            {
                // MessageBox.Show("保存成功");
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                MessageBox.Show(h_tips);
            }
        }
Esempio n. 5
0
        HtTagInfo ConvertToInfo(DataRow htDataRow)
        {
            HtTagInfo h_info = new HtTagInfo();
            if (htDataRow == null)
                return h_info;

            h_info.HtId = Convert.ToInt32(htDataRow["htid"]);
            h_info.HtTagName = htDataRow["HtTagName"].ToString();
            h_info.HtAddTime = Convert.ToDateTime(htDataRow["HtAddTime"]);

            return h_info;
        }
Esempio n. 6
0
 public static string Save(HtTagInfo info)
 {
     return dal.Save(info);
 }
Esempio n. 7
0
 public static string Add(HtTagInfo tagInfo)
 {
     return dal.Add(tagInfo);
 }