Example #1
0
        /// <summary>
        /// 向数据库中插入sbs名称并创建相应的ID,ID-P文件
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="sbsname">sbs名称</param>
        /// <param name="sbsdescrible">sbs描述</param>
        /// <param name="sbstool">使用工具</param>

        public string CreateNodea(string username, string sbsname, string keywords, string classes, string sbsdescrible, string sbstool)
        {
            try
            {
                if (lsy.isaLogin(username) == "已登录")
                {
                    string     sql1 = "insert into 经验 (经验名称,更新成员,关键字,分类,经验描述,使用工具,赞,时间,热度) values('" + sbsname + "','" + username + "','" + keywords + "','" + classes + "','" + sbsdescrible + "','" + sbstool + "'," + 1 + ",'" + System.DateTime.Now.ToString() + "'," + 1 + ")" + "SELECT @@IDENTITY AS returnName from 经验";
                    SqlCommand cmd1 = new SqlCommand(sql1, sqlCon);
                    int        m    = Convert.ToInt32(cmd1.ExecuteScalar());
                    cmd1.Dispose();
                    WriteXML(m);
                    writexml(m);


                    return(Convert.ToString(m));
                }
                else
                {
                    return("false" + "未登录");
                }
            }
            catch (Exception e)
            {
                return("false" + e);
            }
        }
Example #2
0
 public string Addex(string username, string ID)
 {
     try
     {
         if (lsy.isaLogin(username) == "已登录")
         {
             string     sql = "update 用户信息表 set 积分=积分+1 where ID=" + Convert.ToInt32(ID);
             SqlCommand cmd = new SqlCommand(sql, sqlCon);
             cmd.ExecuteNonQuery();
             cmd.Dispose();
         }
     }
     catch (Exception)
     {
         throw;
     }
     return("成功");
 }
Example #3
0
 public string isaLogin(string username)
 {
     return(log.isaLogin(username));
 }