本文整理汇总了C#中Util.CreateMobiFlexAccount方法的典型用法代码示例。如果您正苦于以下问题:C# Util.CreateMobiFlexAccount方法的具体用法?C# Util.CreateMobiFlexAccount怎么用?C# Util.CreateMobiFlexAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.CreateMobiFlexAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAccountSubmit_ServerClick
protected void CreateAccountSubmit_ServerClick(object sender, EventArgs e)
{
//check for competitors
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
string address = EmailTextBox.Text.ToLower();
string bad_domains = Server.MapPath(".") + @"\App_Data\BadDomains.txt";
string[] lines = File.ReadAllLines(bad_domains);
foreach(string line in lines)
{
if (address.EndsWith(line))
{
MessageLabel.Text = "An email has been sent to you to complete your registration. Please follow the directions in the email.";
return;
}
}
Util util = new Util();
DB db = new DB();
Label Error = new Label();
StringBuilder err = new StringBuilder();
string username = UsernameBox.Text.Trim().ToLower();
if (!Check.ValidateUsername(Error, username))
{
err.Append(Error.Text.Clone() + "<BR>");
}
else
{
string query = "SELECT username FROM customers WHERE username='" + username + "'";
string prev_username = db.ViziAppsExecuteScalar(State,query);
if (username == prev_username)
{
/* query = "SELECT password FROM customers WHERE username='" + username + "'";
string password = db.ViziAppsExecuteScalar(State, query);
if(password != PasswordTextBox.Text)*/
err.Append("The " + username + " account already exists.<BR>");
}
if (address.Length> 0 && address.ToLower() != "[email protected]") //for every email not for testing
{
query = "SELECT email FROM customers WHERE email='" + address + "'";
string email = db.ViziAppsExecuteScalar(State, query);
if (email == this.EmailTextBox.Text)
{
err.Append("An account already exists with the same email.<BR>");
}
}
}
if (!Check.ValidatePassword(Error, PasswordTextBox.Text))
{
err.Append("Enter Password: " +Error.Text.Clone() + "<BR>");
}
if (!Check.ValidateEmail(Error, EmailTextBox.Text))
{
err.Append(Error.Text.Clone() + "<BR>");
}
if (PasswordTextBox.Text != ConfirmPasswordBox.Text)
{
err.Append("The password and confirming password do not match. Try again.<BR>");
}
if (!Check.ValidateName(Error,FirstNameTextBox.Text))
{
err.Append("Enter First Name: " + Error.Text.Clone() + "<BR>");
}
if (!Check.ValidateName(Error, LastNameTextBox.Text))
{
err.Append("Enter Last Name: " + Error.Text.Clone() + "<BR>");
}
string phone = PhoneTextBox.Text.Trim ();
if (PhoneTextBox.Text.Length > 0) //optional field
{
if (!Check.ValidatePhone(Error, PhoneTextBox.Text))
{
err.Append("Enter a valid phone number: " + Error.Text.Clone() + "<BR>");
}
}
if (err.Length > 0)
{
MessageLabel.Text = "The following input(s) are required:<BR>" + err.ToString();
db.CloseViziAppsDatabase(State);
return;
}
try
{
string account_type = "type=viziapps;"; //set default for now
string security_question = "";
string security_answer = "";
string customer_id = util.CreateMobiFlexAccount(State, username, PasswordTextBox.Text.Trim(), security_question, security_answer, FirstNameTextBox.Text.Trim(), LastNameTextBox.Text.Trim(),
EmailTextBox.Text.ToLower().Trim(), phone, account_type, ReferralSourceList.SelectedValue,AppToBuild.Text, "inactive");
string email_template_path = Server.MapPath(".") + @"\templates\EmailValidation.txt";
string url = HttpRuntime.Cache["PublicViziAppsUrl"].ToString() + "/ValidateEmail.aspx?id=" + customer_id;
string from = HttpRuntime.Cache["TechSupportEmail"].ToString();
string body = File.ReadAllText(email_template_path)
.Replace("[NAME]", FirstNameTextBox.Text.Trim())
.Replace("[LINK]",url)
.Replace("[SUPPORT]",from);
//.........这里部分代码省略.........