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


C# AuthorProfile.Save方法代码示例

本文整理汇总了C#中AuthorProfile.Save方法的典型用法代码示例。如果您正苦于以下问题:C# AuthorProfile.Save方法的具体用法?C# AuthorProfile.Save怎么用?C# AuthorProfile.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AuthorProfile的用法示例。


在下文中一共展示了AuthorProfile.Save方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetProfile

        public static JsonProfile GetProfile(string id)
        {
            if (!Utils.StringIsNullOrWhitespace(id))
            {
                bool canEditRoles;
                if (!CanUserEditProfile(id, out canEditRoles))
                    return null;

                var pf = AuthorProfile.GetProfile(id);

                if (pf == null)
                {
                    pf = new AuthorProfile(id);
                    pf.Birthday = DateTime.Parse("01/01/1900");
                    pf.DisplayName = id;
                    pf.EmailAddress = Utils.GetUserEmail(id);
                    pf.FirstName = id;
                    pf.Private = true;
                    pf.Save();
                }

                return AuthorProfile.ToJson(id);
            }

            return null;
        }
开发者ID:jperilla,项目名称:FreelanceHubSales,代码行数:26,代码来源:Profile.aspx.cs

示例2: btnok_Click

    protected void btnok_Click(object sender, EventArgs e)
    {
        string reg_uid = Request["reg_uid"];
        Membership.CreateUser(Request["reg_uid"], Request["reg_pwd1"], Request["reg_email"]);

        AuthorProfile pc = new AuthorProfile(reg_uid);
        pc.DisplayName = Request["reg_xingming"];

        //pc.Company = Request["reg_company"];
        if (Request["reg_phone2"] != string.Empty)
        {
            pc.PhoneMain = (Request["reg_phone1"].Trim() != string.Empty ? Request["reg_phone1"] + "-" : "") + Request["reg_phone2"] + (Request["reg_phone3"].Trim() != string.Empty ? "-" + Request["reg_phone3"] : "");
        }

        pc.PhoneMobile = Request["reg_mobile"];
        if (Request["reg_fax2"] != string.Empty)
        {
            pc.PhoneFax = (Request["reg_fax1"].Trim() != string.Empty ? Request["reg_fax1"] + "-" : "") + Request["reg_fax2"];
        }
        pc.CityTown = Request["reg_shi"];
        pc.MSN_QQ = Request["reg_qqmsn"];
        pc.Company = Request["reg_company"];
        pc.Address = Request["reg_address"];
        pc.AboutMe = Request["reg_jianjie"];
        pc.Description1 = Request["reg_kehu"];

        Uppic(pc);
        pc.Save();

        Roles.AddUserToRole(reg_uid, "organs");

        Response.Redirect(Utils.AbsoluteWebRoot + "reg/regok.aspx?uType=org", true);
    }
开发者ID:BGCX261,项目名称:zhenzhuo-px-svn-to-git,代码行数:33,代码来源:regorg.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.Params["id"] != null)
            {
                lbID.Text = Request.Params["id"];
            }
            ap = AuthorProfile.GetProfile(lbID.Text);
            //机构名称
            lbTitle.Text = ap.Company;
            strTitle = ap.Company;
            strCity = ap.Address;
            strGSJS = ap.AboutMe;
            strFWGKH = ap.Description1;
            this.Title = ap.Company;

            if (Request.Cookies["OrgansViewCount_" + lbID.Text] == null)
            {
                HttpCookie MyCookie = new HttpCookie("OrgansViewCount_" + lbID.Text);
                DateTime now = DateTime.Now;

                MyCookie["IP"] = Request.UserHostAddress;
                MyCookie["tid"] = lbID.Text;
                MyCookie.Expires = now.AddHours(1);

                Response.Cookies.Add(MyCookie);
                ap.ViewCount++;
                ap.Save();
            }
        }
    }
开发者ID:BGCX261,项目名称:zhenzhuo-px-svn-to-git,代码行数:32,代码来源:OrgansView.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        lbID.Text = Request.Params["uid"];
        tch = AuthorProfile.GetProfile(lbID.Text);
        this.Title = tch.DisplayName;
        if (Request.Cookies["tchViewCount_" + lbID.Text] == null)
        {
            HttpCookie MyCookie = new HttpCookie("tchViewCount_" + lbID.Text);
            DateTime now = DateTime.Now;

            MyCookie["IP"] = Request.UserHostAddress;
            MyCookie["tid"] = lbID.Text;
            MyCookie.Expires = now.AddHours(1);

            Response.Cookies.Add(MyCookie);
            tch.ViewCount++;
            tch.Save();
        }
    }
开发者ID:BGCX261,项目名称:zhenzhuo-px-svn-to-git,代码行数:19,代码来源:TeacherView.aspx.cs

示例5: btnok_Click

    protected void btnok_Click(object sender, EventArgs e)
    {
        string reg_uid = Request["reg_uid"];
        Membership.CreateUser(Request["reg_uid"], Request["reg_pwd1"],  Request["reg_email"]);
        //reg_nicheng reg_company
        //reg_phone1 reg_phone2 reg_phone3 reg_mobile reg_qqmsn
        AuthorProfile pc = new AuthorProfile(reg_uid);
        pc.DisplayName = Request["reg_nicheng"];
        pc.CityTown = Request["reg_shi"];
        pc.Company = Request["reg_company"];
        if (Request["reg_phone2"]!=string.Empty)
        {
            pc.PhoneMain =  Request["reg_phone1"].Trim() != string.Empty ?Request["reg_phone1"] + "-":"" + Request["reg_phone2"] + Request["reg_phone3"].Trim() != string.Empty ? "-" + Request["reg_phone3"] : "";
        }

        pc.PhoneMobile = Request["reg_mobile"];
        pc.MSN_QQ = Request["reg_qqmsn"];
        pc.IsPrivate = true;//学员注册直接审核通过
        pc.Save();

        Roles.AddUserToRole(reg_uid, "students");
        Response.Redirect(Utils.AbsoluteWebRoot + "reg/regok.aspx?uType=std", true);
    }
开发者ID:BGCX261,项目名称:zhenzhuo-px-svn-to-git,代码行数:23,代码来源:regstd.aspx.cs

示例6: btnok_Click

    protected void btnok_Click(object sender, EventArgs e)
    {
        string reg_uid = Request["reg_uid"];
        Membership.CreateUser(Request["reg_uid"], Request["reg_pwd1"], Request["reg_email"]);

        AuthorProfile pc = new AuthorProfile(reg_uid);
        pc.DisplayName = Request["reg_xingming"];
        pc.CityTown = Request["reg_shi"];
        //pc.Company = Request["reg_company"];
        if (Request["reg_phone2"] != string.Empty)
        {
            pc.PhoneMain = (Request["reg_phone1"].Trim() != string.Empty ? Request["reg_phone1"] + "-" : "") + Request["reg_phone2"] + (Request["reg_phone3"].Trim() != string.Empty ? "-" + Request["reg_phone3"] : "");
        }

        pc.PhoneMobile = Request["reg_mobile"];
        pc.MSN_QQ = Request["reg_qqmsn"];
        pc.Pay = Request["reg_pay"];
        pc.AboutMe = Request["reg_jianjie"];
        pc.Description1 = Request["reg_kehu"];
        pc.Description2 = Request["reg_zhujiang"];

        string fields = string.Empty;
        for (int i = 0; i < Field.Fields.Count; i++)
        {
            if (Request["reg_lingyu:" + i]!=null)
            {
                Field fld = Field.Fields[i];
                fields += fld.Id + "|";
            }
        }
        pc.Fields = fields.TrimEnd('|');
        Uppic(pc);
        pc.Save();

        Roles.AddUserToRole(reg_uid, "teachers");
        Response.Redirect(Utils.AbsoluteWebRoot + "reg/regok.aspx?uType=tch", true);
    }
开发者ID:BGCX261,项目名称:zhenzhuo-px-svn-to-git,代码行数:37,代码来源:regtch.aspx.cs

示例7: GetProfile

 static Profile GetProfile(string id)
 {
     if (!Utils.StringIsNullOrWhitespace(id))
     {
         var pf = AuthorProfile.GetProfile(id);
         if (pf == null)
         {
             pf = new AuthorProfile(id);
             pf.Birthday = DateTime.Parse("01/01/1900");
             pf.DisplayName = id;
             pf.EmailAddress = Utils.GetUserEmail(id);
             pf.FirstName = id;
             pf.Private = true;
             pf.Save();
         }
         
         return new Profile { 
             AboutMe = string.IsNullOrEmpty(pf.AboutMe) ? "" : pf.AboutMe,
             Birthday = pf.Birthday.ToShortDateString(),
             CityTown = string.IsNullOrEmpty(pf.CityTown) ? "" : pf.CityTown,
             Country = string.IsNullOrEmpty(pf.Country) ? "" : pf.Country,
             DisplayName = pf.DisplayName,
             EmailAddress = pf.EmailAddress,
             PhoneFax = string.IsNullOrEmpty(pf.PhoneFax) ? "" : pf.PhoneFax,
             FirstName = string.IsNullOrEmpty(pf.FirstName) ? "" : pf.FirstName,
             Private = pf.Private,
             LastName = string.IsNullOrEmpty(pf.LastName) ? "" : pf.LastName,
             MiddleName = string.IsNullOrEmpty(pf.MiddleName) ? "" : pf.MiddleName,
             PhoneMobile = string.IsNullOrEmpty(pf.PhoneMobile) ? "" : pf.PhoneMobile,
             PhoneMain = string.IsNullOrEmpty(pf.PhoneMain) ? "" : pf.PhoneMain,
             PhotoUrl = string.IsNullOrEmpty(pf.PhotoUrl) ? "" : pf.PhotoUrl.Replace("\"", ""),
             RegionState = string.IsNullOrEmpty(pf.RegionState) ? "" : pf.RegionState
         };
     }
     return null;
 }
开发者ID:ildragocom,项目名称:BlogEngine.NET,代码行数:36,代码来源:UsersRepository.cs


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