protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") { string orderid = Request.QueryString["id"].ToString(); order= obll.getOrdersViewModel(int.Parse(orderid)); this.customer_name.Text = order.Username; this.sales_orderid.Text = order.OrderNo; this.customer_address.Text = order.Address; //查询详细客户信息 c= cb.GetModel(int.Parse(order.Customerid.ToString())); this.customer_linker.Text = c.link_men; this.customer_tel.Text = order.Tel + "/" + order.Mobile; this.customet_email.Text = c.email; //查询详细物流公司信息 tbLogs logs=new tbLogs(); tbLogsBLL tblogbll=new tbLogsBLL(); if (order.Logid != null) { logs = tblogbll.tbLogs_GetModel(order.Logid.ToString()); this.logistics.Text = logs.LogisticsName; this.logistics_num.Text = order.LogNumber; } this.state.Text = order.StateName; this.create_date.Text = DateTime.Parse(order.createdate.ToString()).ToString("yyyy-MM-dd"); attach_pay.Text =decimal.Parse(order.Postmoney.ToString()).ToString("0.00"); dt = sql.getDataByCondition("dbo.OrdersPro_View", "*", " OrderID="+order.OrderID); } }
protected void btnSubmit_Click(object sender, EventArgs e) { tbCustomer tbc = new tbCustomer() { address = txtAddress.Text, c_name = txtCName.Text, email = txtEmail.Text, link_men = txtLink.Text, mobile = txtMobile.Text, password = "******", PinPai = txtPingPai.Text, ProName = txtProduct.Text, remark = txtBZ.Text, tel = txtTel.Text, types = 2, username = txtCName.Text }; CustomerBLL cbll = new CustomerBLL(); int cid= cbll.supplierAdd(tbc); if (cid > 0) { Response.Redirect("ThankReg.htm"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if(Request.QueryString["id"]!=null ) { string id=Request.QueryString["id"].ToString(); c= cb.GetModel(int.Parse(id)); this.DropDownList1.SelectedValue = c.state.ToString(); } } }
/// <summary> /// 用户基本信息提交注册 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { tbCustomer tbcustomer = new tbCustomer() { address = "", c_code = "", c_name = username.Value.Trim(), email = email.Value.Trim(), link_men = "", mobile = "", password = password.Value.Trim(), rank = "", remark = "", state = 1, tel = "", types = 1, username = username.Value.Trim() }; CustomerBLL cbll = new CustomerBLL(); int count= cbll.Add(tbcustomer); if (count != 0) { MailAddress messagefrom = new MailAddress("*****@*****.**"); string MessageTo = email.Value.Trim(); string MessageSuject = "邮件主题"; string MessageBody = "请进行邮箱验证来完成您注册的最后一步操作,<a href='http://localhost:55419/JiHuoEmail.aspx?id="+count+"'>邮箱账号激活</a>"; //发送邮件 if (emailsend(messagefrom, MessageTo, MessageSuject, MessageBody)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "test1", "alert('邮件发送成功,请激活邮件后登录')", true); Session["Email"] = email.Value.Trim(); Response.Redirect("JiHuoEmail.aspx"); } } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.Customer.tbCustomer GetModel(int id) { SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int,4) }; parameters[0].Value = id; Model.Customer.tbCustomer model = new Model.Customer.tbCustomer(); DataSet ds = dbhelper.ExcuteSelectReturnDataSet("getview_CustomerModel", CommandType.StoredProcedure, parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } model.username = ds.Tables[0].Rows[0]["username"].ToString(); model.password = ds.Tables[0].Rows[0]["password"].ToString(); if (ds.Tables[0].Rows[0]["types"].ToString() != "") { model.types = int.Parse(ds.Tables[0].Rows[0]["types"].ToString()); } model.c_name = ds.Tables[0].Rows[0]["c_name"].ToString(); model.c_code = ds.Tables[0].Rows[0]["c_code"].ToString(); model.tel = ds.Tables[0].Rows[0]["tel"].ToString(); model.mobile = ds.Tables[0].Rows[0]["mobile"].ToString(); model.email = ds.Tables[0].Rows[0]["email"].ToString(); model.link_men = ds.Tables[0].Rows[0]["link_men"].ToString(); model.address = ds.Tables[0].Rows[0]["address"].ToString(); model.remark = ds.Tables[0].Rows[0]["remark"].ToString(); model.rank = ds.Tables[0].Rows[0]["rank"].ToString(); if (ds.Tables[0].Rows[0]["state"].ToString() != "") { model.state = int.Parse(ds.Tables[0].Rows[0]["state"].ToString()); } model.Typename = ds.Tables[0].Rows[0]["Typename"].ToString(); return model; } else { return null; } }