protected void Button1_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity a = new seller_Entity(); a.S_account = txtSell_Account.Text; a.S_password = txtSell_password.Text; a.S_name = txtSell_Name.Text; a.S_storeName = txtSell_storename.Text; a.S_tel = txtSell_tel.Text; a.S_question = ddlQuestion.Text; a.S_answer = txtSell_answer.Text; if (!db.exist(txtSell_Account.Text)) { Session["UserAccount"] = a.S_account.Trim(); Session["UserPassword"] = a.S_password.Trim(); Session["Logged"] = true; Session["UserType"] = "1"; db.create(a); Response.Write(MessagesBox.showMessages("注册成功")); System.Web.Security.FormsAuthentication.RedirectFromLoginPage(a.S_account, true); } else { Response.Write(MessagesBox.showMessages("账号已存在,请重新输入")); } }
/// <summary> /// 创建卖家用户 /// </summary> /// <param name="seller"></param> /// <returns></returns> /// public bool createSell(seller_Entity sellT) { seller_T a = new seller_T(); a.s_account = sellT.S_account; a.s_answer = sellT.S_answer; a.s_name = sellT.S_name; a.s_password = sellT.S_password; a.s_profit = (decimal)sellT.S_profit; a.s_question = sellT.S_question; a.s_state = sellT.S_state; a.s_storeName = sellT.S_storeName; a.s_tel = sellT.S_tel; //seller_T是卖家表的对象,seller代表卖家的一个对象 sellDB.seller_T.InsertOnSubmit(a); sellDB.SubmitChanges(); createFolder(a.s_account); return(true); }
protected void btn_submit_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity sell = new seller_Entity(); string account = Session["UserAccount"].ToString().Trim(); sell.S_account = account; sell.S_name = txt_s_name.Text.Trim(); sell.S_storeName = txt_s_storename.Text.Trim(); sell.S_tel = txt_s_tel.Text.Trim(); sell.S_question = ddl_s_question.Text.Trim(); sell.S_answer = txt_s_answer.Text.Trim(); if (db.changeUserInfo(sell)) { Response.Write(MessagesBox.showMessages("用户信息修改成功!")); Response.Redirect("~/Default.aspx"); } else { Response.Write(MessagesBox.showMessages("用户信息修改失败!")); } }
protected void Button1_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity a = new seller_Entity(); a.S_account = txtSell_Account.Text; a.S_password = txtSell_password.Text; a.S_name = txtSell_Name.Text; a.S_storeName = txtSell_storename.Text; a.S_tel = txtSell_tel.Text; a.S_question = ddlQuestion.Text; a.S_answer = txtSell_answer.Text; if (!db.exist(txtSell_Account.Text)) { db.create(a); Response.Write(MessagesBox.showMessages("注册成功")); } else { Response.Write(MessagesBox.showMessages("账号已存在,请重新输入")); } }
public bool changeUserInfo(seller_Entity sell) { seller_T sellT = new DataAccess.seller_T(); var results = sellDB.seller_T.Where(c => c.s_account.Equals(sell.S_account)); if (results.Count() > 0) { foreach (seller_T r in results) { r.s_storeName = sell.S_storeName; r.s_tel = sell.S_tel; r.s_question = sell.S_question; r.s_answer = sell.S_answer; r.s_name = sell.S_name; } sellDB.SubmitChanges(); return(true); } else { return(false); } }
/// <summary> /// 创建卖家用户 /// </summary> /// <param name="a"></param> /// <returns></returns> public bool create(seller_Entity a) { return(db.createSell(a)); }
public bool changeUserInfo(seller_Entity sell) { return(db.changeUserInfo(sell)); }