Exemplo n.º 1
0
        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="username"></param>
        /// <param name="pwd"></param>
        /// <param name="email"></param>
        /// <param name="sex"></param>
        /// <param name="baby"></param>
        /// <param name="baby_date"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        public int Add_User(string username, string pwd, string email, int sex, int baby, DateTime baby_date, string remark)
        {
            SqlParameter[] spInfo = new SqlParameter[7];
            spInfo[0] = new SqlParameter("@username", username);
            spInfo[1] = new SqlParameter("@pwd", pwd);
            spInfo[2] = new SqlParameter("@email", email);
            spInfo[3] = new SqlParameter("@sex", sex);
            spInfo[4] = new SqlParameter("@baby", baby);
            spInfo[5] = new SqlParameter("@baby_date", baby_date);
            spInfo[6] = new SqlParameter("@remark", remark);

            return(Convert.ToInt32(database.ExecuteScalar("Add_User", true, spInfo)));
        }
Exemplo n.º 2
0
 public string ExecuteScalar(string sql)
 {
     return(database.ExecuteScalar(sql, false, null).ToString());
 }