public ActionResult member(FormCollection fc,FansContract fans) { string session = Request.QueryString["sessionid"]; ViewData["sessionid"] = session; fans.FromUserName = session; //修改会员的姓名和生日 try { FansBll.UpdateFansName(fans); } catch (Exception) { } return View(fans); }
public ActionResult Member(FormCollection fc, FansContract fans, string sessionid, string userid) { int eid = int.Parse(SecurityEncryption.DESDecrypt(sessionid)); var a = fc["br"]; ViewData["userid"] = userid; ViewData["sessionid"] = sessionid; ViewData["Top4Channel"] = ChannelBll.GetChannelByList(eid, 4); string bak = Request.QueryString["bak"]; string session = Request.QueryString["userid"]; if (fans.UserBr == null) { try { fans.UserBr = DateTime.Parse(fans.UserBr).ToString("yyyy-MM-dd"); } catch (Exception) { fans.UserBr = "1990-01-01"; } } else { fans.UserBr = DateTime.Parse(fans.UserBr).ToString("yyyy-MM-dd"); } fans.FromUserName = userid; //修改会员信息 try { FansBll.UpdateFansName(fans); if (bak != null) { ViewData["url"] = Url.Action(bak, new { sessionid = sessionid, userid = userid }); } else { ViewData["url"] = Url.Action("article", new { sessionid = sessionid, id = 243 }); } ViewData["msg"] = "完善个人信息成功!"; return View("Success"); } catch (Exception) { } return View(fans); }
/// <summary> /// 修改用户信息 /// </summary> /// <param name="fans"></param> public void UpdateFansName(FansContract fans) { FansDao.UpdateFansName(fans.ToPO<Fans>()); }