public void update(Profile_Wraper wrap) { wrap.extendProfile.userid = wrap.Id; DAL.Profile_DAL.update(db, wrap.extendProfile); MembershipUser m= Membership.GetUser(wrap.Id, false); m.Email = wrap.Email; Membership.UpdateUser(m); }
protected void Button1_Click1(object sender, EventArgs e) { Profile_Wraper pw = new Profile_Wraper(); pw.extendProfile = new calendar_profile(); pw.Email=email.Text ; pw.extendProfile.sex=sex.Text ; pw.extendProfile.name=name.Text ; pw.extendProfile.Dislike =dislike.Text ; pw.extendProfile.Favorate =favor.Text ; pw.Id =(Guid) Membership.GetUser().ProviderUserKey; p.update(pw); Response.Redirect("Default.aspx"); }
public Profile_Wraper get(Guid uid) { byte[] img; calendar_profile p=DAL.Profile_DAL.get(db,uid); if(p==null) { BinaryReader read = new BinaryReader(File.OpenRead(server.MapPath("/Image/usericon.png"))); img = read.ReadBytes((int)read.BaseStream.Length); p= DAL.Profile_DAL.insert(db, img, uid); } Profile_Wraper wrap = new Profile_Wraper { Email=Membership.GetUser(uid,false).Email, Id=uid, extendProfile=p}; return wrap; }