protected void submit_Click(object sender, EventArgs e)
{
int intro = 0; string opra = String.Empty;
Random diaran = new Random();
DateTime diad = DateTime.Today;
string diadt = diad.Year.ToString() + diad.Month.ToString() + diad.Day.ToString();
string diablo = (diaran.Next() % 999).ToString();
while (diablo.Length < 3)
{
diablo = "0" + diablo;
}
//String temp = (diaran.Next() % 999).toString;
//while (temp.length < 3)
//{
// temp = "0" + temp;
//}
diadt += diablo;
//diadt += diaran.Next() % 999;
//string diadt = diad.Year.ToString() + diad.Month.ToString() + diad.Day.ToString();
//diadt += diaran.Next() % 999;
//string diadt = DateTime.Today.ToString();
string name = this.tbxzusername.Text.Trim();
string zuserno = diadt;
string zuserreal = this.tbxzuserrealname.Text.Trim();
string diapass = this.tbxzpwd.Text.Trim();
string sex = this.ddlSex.Value.Trim();
string tel = this.tbxtelephone.Text.Trim();
string mobile = this.tbxmobiletelephone.Text.Trim();
intro = int.Parse(this.dropzuserid.Text.Trim());
opra = this.dropoperation.Text.Trim();
if (!zvili(name))
{
updintrosam(intro);
insertzuser(name, zuserno, zuserreal,diapass, sex, tel, mobile, intro, opra);
Response.Write("<script language='javascript'>alert('" + zuserno + "');;window.location='zuerlist.aspx';</script>");
}
else
{
Response.Write("<script language='javascript'>alert('登录名已存在!');</script>");
}
}
String temp = (diaran.Next() % 999).toString;
while(temp.length < 3) {
temp = "0" + temp;
}