本文整理汇总了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;
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}