protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["usr"]; IBLL.IStudent stu = BLLFactory.DataAccess.CreateStudent(); int ID = -1; if (null != cookie) { ID = Convert.ToInt32(cookie.Values["ID"]); } if (ID != -1) { try { Model.StudentInfo stuInfo = stu.Get(ID); HyperLink1.Text = stuInfo.Stu_UserName + "的个人中心"; HyperLink1.NavigateUrl = "~/Purchase/AccountInfo.aspx"; HyperLink2.Text = "退出登录"; } catch { Request.Cookies.Remove("usr"); HyperLink1.NavigateUrl = "~/Student/Login.aspx"; HyperLink1.Text = "点击这里登录"; HyperLink2.Text = "没有账号,注册"; } } else { HyperLink1.NavigateUrl = "~/Student/Login.aspx"; HyperLink1.Text = "点击这里登录"; HyperLink2.Text = "没有账号,注册"; } }
/// <summary> /// ����Ա���ѧ���û� /// </summary> /// <param name="mStudent">����ӵ�ѧ������</param> /// <returns>����Ƿ�ɹ����ɹ���true,ʧ����false</returns> public bool AddStudent(StudentInfo mStudent) { return dal.AddStudent(mStudent); }
/// <summary> /// ����Ա��ѧ���û�����Ϣ /// </summary> /// <param name="mStudent">ѧ���Ķ�������Ӧ�������ĵ�ѧ����Id��ѧ��������ֹ���ڣ�ѧ���������</param> /// <returns>���Ƿ�ɹ����ɹ���true,ʧ����false</returns> public bool EditStudent(StudentInfo mStudent) { return dal.EditStudent(mStudent); }