本文整理汇总了C#中Users.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Users.Save方法的具体用法?C# Users.Save怎么用?C# Users.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUser
public static string CreateUser(Users user, string restaurantName)
{
try
{
user.Joined = DateTime.Now;
user.Save();
Restaurant restaurant = new Restaurant() { Name = restaurantName, UserId = user.Id };
restaurant.Save();
HttpContext.Current.Session["CurrentUser"] = user;
if (ConfigurationManager.AppSettings["IsProduction"] == "true")
{
//string body = "New Sign Up";
//body += string.Format("<br/>Name: {0}<br/>Email: {1}", user.Name, user.Email);
////Email email1 = new Email("[email protected]", "[email protected]", "New Sign Up", body);
////email1.Send();
//Email email2 = new Email("[email protected]", "[email protected]", "New Sign Up", body);
//email2.Send();
}
}
catch (Exception ex)
{
////Email email1 = new Email("[email protected]", "[email protected]", "Sign Up Error", ex.Message);
////email1.Send();
//Email email2 = new Email("[email protected]", "[email protected]", "Sign Up Error", ex.Message);
//email2.Send();
}
return "";
//string error = BuyPlan(user);
//if(string.IsNullOrEmpty(error))
//{
// user.Joined = DateTime.Now;
// user.Save();
// Restaurant restaurant = new Restaurant() { Name = restaurantName, UserId = user.Id };
// restaurant.Save();
// HttpContext.Current.Session["CurrentUser"] = user;
// if (ConfigurationManager.AppSettings["IsProduction"] == "true")
// {
// string body = user.Annual ? "Purchase: Annual" : "Purchase: Monthly";
// body += string.Format("<br/>Name: {0}<br/>Email: {1}", user.Name, user.Email);
// //Email email1 = new Email("[email protected]", "[email protected]", "New Purchase", body);
// //email1.Send();
// Email email2 = new Email("[email protected]", "[email protected]", "New Purchase", body);
// email2.Send();
// }
// return "";
//}
//return error;
}
示例2: uiButtonRegister_Click
protected void uiButtonRegister_Click(object sender, EventArgs e)
{
Users user = new Users();
user.AddNew();
user.FirstName = uiTextBoxFN.Text;
user.LastName = uiTextBoxLN.Text;
user.UserName = uiTextBoxUsername.Text;
user.Password = uiTextBoxPassword.Text;
user.Mail = uiTextBoxMail.Text;
user.Address = uiTextBoxAddress.Text;
user.City = uiTextBoxCity.Text;
user.Country = uiTextBoxCountry.Text;
user.Phone = uiTextBoxPhone.Text;
user.Fax = uiTextBoxFax.Text;
user.PostalCode = uiTextBoxPC.Text;
user.State = uiTextBoxState.Text;
user.Save();
Session["UserLoggedIn"] = user;
if (null != registered)
registered(this, EventArgs.Empty);
}
示例3: SaveUser
public static Users SaveUser(Users user)
{
user.Save();
return user;
}
示例4: GetSchool
public static School GetSchool(Users user)
{
School school = School.GetClosest(user.Latitude.ToString(), user.Longitude.ToString());
if(!string.IsNullOrEmpty(user.SchoolId) && school != null && user.SchoolId != school.Id)
{
user.SchoolId = school.Id;
user.Save();
}
return school;
}