本文整理汇总了C#中User.save方法的典型用法代码示例。如果您正苦于以下问题:C# User.save方法的具体用法?C# User.save怎么用?C# User.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
if (new User().getById(TextBox2.Text) == null)
{
if (new User().getByEmailId(TextBox5.Text) != null)
Label11.Text = "This E-Mail id is already used by some other person";
else
{
User u = new User(TextBox1.Text, TextBox2.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, DropDownList1.SelectedItem.Text, TextBox7.Text);
u.save();
Dummy d = new Dummy(TextBox2.Text, r.Next(10000, int.MaxValue) + "", r.Next(10000, int.MaxValue) + "");
d.Save();
if (WebMail.Send("[email protected]", TextBox5.Text, "Activation", "Activation Code:" + d.getEmailActivationCode()))
; // Label10.Text = "Mail sent Successfully";
if (Message.Send(TextBox6.Text, "Activation code:" + d.getMobileActivationCode()))
;
Response.Redirect("./SignUpStep2.aspx?UserName=" + TextBox2.Text + "&Email=" + TextBox5.Text + "&MobileNumber=" + TextBox6.Text);
}
}
}
示例2: saveUser
public void saveUser(User usr)
{
usr.save();
}
示例3: test
public void test()
{
//Create a new connection and connect
HbaseConnection connection = new HbaseConnection();
//Connect to the HBase DB
if(!connection.connect("localhost", 9090))
{
throw new Exception("Could Not Connect to HBase Thrift Server");
}
//Create a new user
User user = new User(connection, "charlie");
//Get just the auth info
user.loadAuth();
//Display the first name
Console.WriteLine("First Name: " + user.FirstName);
//Display the output
displayUser(user);
//Get all the data from the row
user.loadAll();
//Display the output
displayUser(user);
//Change some details
user.FirstName = "Bob";
user.LastName = "The Tester";
user.Enabled = false;
user.Email = "[email protected]";
//Display the output
displayUser(user);
//Save the changes
user.save();
User user2;
Console.WriteLine("Getting by Email");
if(User.tryGetFromEmail("[email protected]", connection, out user2))
{
//Get all user info again
user2.loadAll();
//Display the output
displayUser(user2);
//Change the details back
user2.FirstName = "Charlie";
user2.LastName = "Mason";
//Save the details back
user2.save();
}
else
{
Console.WriteLine("User Not Found");
}
connection.closeConnection();
}