public long CreateNewCustomer(CustomerInfo customerInfo) { DataCommand command = new DataCommand(ConnectionString, GetDbCommand(CustomerStatement.RegisterSql, "Text")); command.AddOutParameter("@CustomerID", DbType.Int64, 0); command.AddInputParameter("@CustomerName", DbType.String, customerInfo.CustomerName); command.AddInputParameter("@CustomerCode", DbType.String, customerInfo.CustomerCode); command.AddInputParameter("@Password", DbType.String, customerInfo.Password); command.AddInputParameter("@Channel", DbType.Int32, 1); command.AddInputParameter("@Name", DbType.String, customerInfo.Name); command.AddInputParameter("@Mobile", DbType.String, customerInfo.Mobile); command.AddInputParameter("@WXCode", DbType.String, customerInfo.WXCode); command.AddInputParameter("@CreateDate", DbType.DateTime, DateTime.Now); command.AddInputParameter("@LastLoginDate", DbType.DateTime, DateTime.Now); command.ExecuteNonQuery(); return(Convert.ToInt64(command.GetParameterValue("@CustomerID"))); }
/// <summary> /// 注册用户信息 /// </summary> /// <param name="telephone"></param> /// <param name="password"></param> /// <param name="vcode"></param> /// <returns></returns> public long Register(string telephone, string password, string vcode) { DataCommand command = new DataCommand(ConnectionString, GetDbCommand(CustomerStatement.RegisterSql, "Text")); command.AddOutParameter("@CustomerID", DbType.Int64, 0); command.AddInputParameter("@CustomerName", DbType.String, ""); command.AddInputParameter("@CustomerCode", DbType.String, vcode); command.AddInputParameter("@Password", DbType.String, password); command.AddInputParameter("@Channel", DbType.Int32, 1); command.AddInputParameter("@Name", DbType.String, ""); command.AddInputParameter("@Mobile", DbType.String, telephone); command.AddInputParameter("@WXCode", DbType.String, ""); command.AddInputParameter("@CreateDate", DbType.DateTime, DateTime.Now); command.AddInputParameter("@LastLoginDate", DbType.DateTime, DateTime.Now); command.ExecuteNonQuery(); long cid = Convert.ToInt64(command.GetParameterValue("@CustomerID")); return(cid); }