protected void btnOK_Click(object sender, System.EventArgs e) { ST_BookBiz.ST_User st_user = new STGROUP.ST_BookBiz.ST_User(); //�ж����������Ʋ�����δ�գ����Ƴ��Ȳ�����20���ַ� if(txtName.Text=="") Response.Write("<script defer>alert('���Ʋ�����δ�գ�');</script>"); else if(txtPass.Text=="") Response.Write("<script defer>alert('���벻����δ�գ�');</script>"); else if(txtPass.Text != txtPass2.Text) { Response.Write("<script defer>alert('���벻һ�£�');</script>"); } else if (st_user.ST_IsUserExist(txtName.Text.Trim()) && Request["Action"] == "add") { Response.Write("<script defer>alert('�û����Ѿ����ڣ�');</script>"); } else { ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(User.Identity.Name); int userid = identity.UserID; //�û���Ϣ����ӻ���ɾ������ if (Request["Action"] == "add") { userid = 0; st_entity.ST_Name = txtName.Text; st_entity.ST_Address = txtAddress.Text; st_entity.ST_Email = txtEmail.Text; st_entity.ST_Telephone = txtPhone.Text; st_entity.ST_Postcode = txtPostCode.Text ; st_entity.ST_TrueName = txtTrueName.Text; st_entity.ST_Pass = txtPass.Text; st_entity.ST_Gender = RadioButtonList1.SelectedValue; userid = st_user.InsertUser(st_entity); identity = new ST_BookBiz.ST_Identity(txtName.Text.Trim(), userid); Context.User = new ST_BookBiz.ST_Principal(identity, new string[] { "User" }); identity.Name = txtName.Text; identity.Roles = "User"; identity.Save(); FormsAuthentication.SetAuthCookie(txtName.Text, false);//�������֤Ʊ Response.Redirect("../ST_Common/ST_Main.aspx"); } else if (Request["Action"] == "edit" && userid!=0) { //����Ϣ st_entity.ST_Name = txtName.Text; st_entity.ST_Address = txtAddress.Text; st_entity.ST_Email = txtEmail.Text; st_entity.ST_Telephone = txtPhone.Text; st_entity.ST_Postcode = txtPostCode.Text; st_entity.ST_TrueName = txtTrueName.Text; st_entity.ST_Pass = txtPass.Text; st_entity.ST_Gender = RadioButtonList1.SelectedValue; st_entity.ST_UserID = userid; st_user.UpdateUser(st_entity); string str = "<script language=javascript>alert('���³ɹ���');</script>"; Response.Write(str); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //取得所有订单 ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(User.Identity.Name); int userid = identity.UserID; DataSet ds = st_order.GetAllOrder(userid); dgProduct.DataSource = ds; dgProduct.DataBind(); } }
protected void Page_Load(object sender, System.EventArgs e) { // �ڴ˴������û������Գ�ʼ��ҳ�� if(!IsPostBack) { //Ĭ�ϵ��ջ�����Ϣ���Լ� ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(User.Identity.Name); int userid = identity.UserID; ST_BookBiz.ST_UserEntity st_entity = st_user.GetUserInfo(userid); txtName.Text = st_entity.ST_TrueName; txtAddress.Text = st_entity.ST_Address; txtEmail.Text = st_entity.ST_Email; txtPostCode.Text = st_entity.ST_Postcode; txtPhone.Text = st_entity.ST_Telephone; } }
protected void btnOK_Click(object sender, System.EventArgs e) { //�ж��û��Ƿ��¼�ɹ�������ɹ���ת��ST_Main.aspx�����ʧ�ܣ���ʾʧ�� STGROUP.ST_BookBiz.ST_Auth st_auth = new STGROUP.ST_BookBiz.ST_Auth(); int userid=0; if(st_auth.ST_Login(txtName.Text, txtPass.Text, out userid)) { string[] role = st_auth.ST_LoginType(txtName.Text); ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(txtName.Text.Trim(), userid); Context.User = new ST_BookBiz.ST_Principal(identity,role); identity.Name = txtName.Text; identity.Roles = role[0]; identity.Save(); FormsAuthentication.SetAuthCookie(txtName.Text, false); Response.Redirect("ST_Common/ST_Main.aspx"); } else { Response.Write("<script language='javascript'>alert('��¼ʧ�ܣ�');</script>"); } }
protected void btnNext_Click(object sender, System.EventArgs e) { //ȡ�����ﳵ�е���Ʒ��Ϣ ST_BookBiz.ST_Cart cart = (ST_BookBiz.ST_Cart)Session["Cart"]; DataTable table = null; if (cart != null) { table = cart.GetProductItems(); } float sum = 0.00f; for(int i=0;i<table.Rows.Count;i++) { sum += float.Parse(table.Rows[i]["ST_Total"].ToString()); } ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(User.Identity.Name); int userid = identity.UserID; ST_BookBiz.ST_OrderEntity st_entity = new STGROUP.ST_BookBiz.ST_OrderEntity(); st_entity.ST_Consignee = txtName.Text; st_entity.ST_ConsingeeAddress = txtAddress.Text; st_entity.ST_ConsingeeEmail = txtEmail.Text; st_entity.ST_ConsingeePhone = txtPhone.Text; st_entity.ST_ConsingeePostcode = txtPostCode.Text; st_entity.ST_CreateTime = DateTime.Now; st_entity.ST_Payment = Select1.Value; st_entity.ST_Ship = Select2.Value; st_entity.ST_UserID = userid; st_entity.ST_Sum = sum; //���ɶ��� ST_BookBiz.ST_Order st_order = new STGROUP.ST_BookBiz.ST_Order(); st_order.InsertOrder(st_entity); //��չ��ﳵ Session.Remove("Cart"); Response.Write("<script language='javascript'>alert('�������ɳɹ�');window.top.location='../ST_Common/st_main.aspx';</script>"); }
protected void Page_Load(object sender, System.EventArgs e) { // �ڴ˴������û������Գ�ʼ��ҳ�� Response.Cache.SetCacheability(HttpCacheability.NoCache);//ȥ��ҳ�滺�� if(!IsPostBack) { //��ʼ���û���Ϣ ST_BookBiz.ST_User st_user = new STGROUP.ST_BookBiz.ST_User(); if(Request["Action"]=="edit")//���²���ʱ����ʼ������ { ST_BookBiz.ST_Identity identity = new ST_BookBiz.ST_Identity(User.Identity.Name); int userid = identity.UserID; if (userid == 0) Response.Redirect("../ST_Login.aspx"); st_entity = st_user.GetUserInfo(userid); txtNumber.Text = userid.ToString(); txtName.Text = st_entity.ST_Name; txtAddress.Text = st_entity.ST_Address; txtEmail.Text = st_entity.ST_Email; txtPhone.Text = st_entity.ST_Telephone; txtPostCode.Text = st_entity.ST_Postcode; txtTrueName.Text = st_entity.ST_TrueName; txtPass.Text = st_entity.ST_Pass; RadioButtonList1.SelectedIndex = RadioButtonList1.Items.IndexOf(RadioButtonList1.Items.FindByText(st_entity.ST_Gender)); txtName.ReadOnly = true; } } }