当前位置: 首页>>代码示例>>C#>>正文


C# Users.Save方法代码示例

本文整理汇总了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;
    }
开发者ID:Hookem22,项目名称:BPlan,代码行数:54,代码来源:Default.aspx.cs

示例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);
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:21,代码来源:register.ascx.cs

示例3: SaveUser

 public static Users SaveUser(Users user)
 {
     user.Save();
     return user;
 }
开发者ID:Hookem22,项目名称:Mayfly-Web,代码行数:5,代码来源:Default.aspx.cs

示例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;
 }
开发者ID:Hookem22,项目名称:Mayfly-Web,代码行数:10,代码来源:Default.aspx.cs


注:本文中的Users.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。