/// <summary> /// 查询已下的,且已经完成的 /// </summary> /// <returns></returns> public List<CompleteTakedOrder> getDataToGridView6() { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); List<CompleteTakedOrder> UnOrder = new List<CompleteTakedOrder>(); string jsonstr = jsonSerializer.Serialize(Session["ID"].ToString()); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string result = testService.SearchCompleteTakedOrder(soapHeader, jsonstr); UnOrder = jsonSerializer.Deserialize<List<CompleteTakedOrder>>(result); return UnOrder; }
public List<PointShow> getData() { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); List<PointShow> pointshow = new List<PointShow>(); string jsonstr = jsonSerializer.Serialize("0"); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string result = testService.SearchMapPoint(soapHeader, jsonstr); pointshow = jsonSerializer.Deserialize<List<PointShow>>(result); return pointshow; }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Comment") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); Services.Data.CommentOrder comment = new Services.Data.CommentOrder(); comment.OrderID = orderid; comment.Comment = TextBox1.Text; string jsonstr = jsonSerializer.Serialize(comment); string result = testService.AddComment(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 == "0")//退单成功 { Response.Redirect(Request.Url.ToString()); //刷新页面 } else //退单失败 { this.Page.RegisterStartupScript(" ", "<script>alert(' 评论失败 '); </script> "); } } }
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UnLock") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView2.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int userid = Convert.ToInt32(contact); UserQuest quest = new UserQuest(); quest.UserID = userid; quest.state = 3; JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string jsonstr = jsonSerializer.Serialize(quest); string result = testService.ModifyUserType(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 != null || result2 != "loginfalse") { Response.Redirect(Request.Url.ToString()); this.Page.RegisterStartupScript(" ", "<script>alert(' 修改成功 '); </script> "); } else { this.Page.RegisterStartupScript(" ", "<script>alert(' 修改失败 '); </script> "); } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Search") { int index = Convert.ToInt32(e.CommandArgument); // Get the last name of the selected author from the appropriate // cell in the GridView control. GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string jsonstr = jsonSerializer.Serialize(orderid); string result = testService.GetComment(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 != null || result2 != "loginfalse") { this.Page.RegisterStartupScript(" ", "<script>alert(' " + result2 + " '); </script> "); } else { this.Page.RegisterStartupScript(" ", "<script>alert(' 查看失败 '); </script> "); } } if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string jsonstr = jsonSerializer.Serialize(orderid); string result = testService.GetOrder(soapHeader, jsonstr); Order result2 = jsonSerializer.Deserialize<Order>(result); if (result2 != null ) { string str = "订单号:" + result2.OrderID.ToString() + "建单人ID:" + result2.CreaterID.ToString() + "货物名:" + result2.ProductName + "货物重量:" + result2.ProductWeight + "发件人名:" + result2.SenderName + "发件人手机号:" + result2.SenderPhone + "发件地址:" + result2.SenderAddress + "收件人姓名:" + result2.ReceiverName + "收件人手机号:" + result2.ReceiverPhone + "收件人地址:" + result2.ReceiverAddress + "接单人ID:" + result2.TakerID + "备注:" + result2.Remarks; this.Page.RegisterStartupScript(" ", "<script>alert(' "+ str +" '); </script> "); } else { this.Page.RegisterStartupScript(" ", "<script>alert(' 查看失败 '); </script> "); } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); // Get the last name of the selected author from the appropriate // cell in the GridView control. GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); Services.Entity.TakeOrder takeOrder = new Services.Entity.TakeOrder(); takeOrder.OrderID = orderid; takeOrder.TakerID = Convert.ToInt32(Session["ID"].ToString()); string jsonstr = jsonSerializer.Serialize(takeOrder); string result = testService.UserTakeOrder(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 == "0")//下单成功 { Response.Redirect(Request.Url.ToString()); //刷新页面 } else //下单失败 { this.Page.RegisterStartupScript(" ", "<script>alert(' 下单失败 '); </script> "); } } }
protected void Button1_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(TextBox11.Text) || String.IsNullOrEmpty(TextBox13.Text) || String.IsNullOrEmpty(TextBox6.Text) || String.IsNullOrEmpty(TextBox8.Text) || String.IsNullOrEmpty(TextBox14.Text) || String.IsNullOrEmpty(TextBox7.Text) || String.IsNullOrEmpty(TextBox9.Text) || String.IsNullOrEmpty(TextBox15.Text)) { this.Page.RegisterStartupScript(" ", "<script>alert(' 请填写完整信息 '); </script> "); } else { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); Services.Entity.PlaceOrder placeOrder = new Services.Entity.PlaceOrder(); //placeOrder.OrderID placeOrder.CreaterID = userID; //placeOrder.CreateDateTime = DateTime.Now; placeOrder.ProductName = TextBox11.Text; placeOrder.ProductWeight = DropDownList1.Text; placeOrder.Remarks = TextBox13.Text; placeOrder.SenderName = TextBox6.Text; placeOrder.SenderPhone = TextBox8.Text; placeOrder.SenderAddress = TextBox14.Text; placeOrder.ReceiverName = TextBox7.Text; placeOrder.ReceiverPhone = TextBox9.Text; placeOrder.ReceiverAddress = TextBox15.Text; placeOrder.PointX = ViewState["pointX1"].ToString(); placeOrder.PointY = ViewState["pointY1"].ToString(); placeOrder.PointX2 = ViewState["pointX2"].ToString(); placeOrder.PointY2 = ViewState["pointY2"].ToString(); placeOrder.Street = ViewState["Street"].ToString(); //执行序列化 part:1 string jsonstr = jsonSerializer.Serialize(placeOrder); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = uName; soapHeader.Password = ps; string result = testService.UserPlaceOrder(soapHeader, jsonstr); if (result != "0") { FieldInfo[] infos = GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance); for (int i = 0; i < infos.Length; i++) { if (infos[i].FieldType == typeof(TextBox)) { ((TextBox)infos[i].GetValue(this)).Text = ""; } } this.Page.RegisterStartupScript(" ", "<script>alert(' 下单成功 '); </script> "); } else { this.Page.RegisterStartupScript(" ", "<script>alert(' 下单失败 '); </script> "); } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); Services.Entity.TakeOrder takeOrder = new Services.Entity.TakeOrder(); takeOrder.OrderID = orderid; takeOrder.TakerID = Convert.ToInt32(Session["ID"].ToString()); string jsonstr = jsonSerializer.Serialize(takeOrder); string result = testService.BackTakedOrder(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 == "0")//退单成功 { Response.Redirect(Request.Url.ToString()); //刷新页面 } else //退单失败 { this.Page.RegisterStartupScript(" ", "<script>alert(' 退单失败 '); </script> "); } } if (e.CommandName == "Choose") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); Services.Entity.TakeOrder takeOrder = new Services.Entity.TakeOrder(); takeOrder.OrderID = orderid; takeOrder.TakerID = Convert.ToInt32(Session["ID"].ToString()); string jsonstr = jsonSerializer.Serialize(takeOrder); string result = testService.completeTakedOrder(soapHeader, jsonstr); string result2 = jsonSerializer.Deserialize<string>(result); if (result2 == "0")//下单成功 { Response.Redirect(Request.Url.ToString()); //刷新页面 } else //下单失败 { this.Page.RegisterStartupScript(" ", "<script>alert(' 确认完成失败 '); </script> "); } } if (e.CommandName == "Show") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView1.Rows[index]; TableCell contactName = selectedRow.Cells[0]; string contact = contactName.Text; int orderid = Convert.ToInt32(contact); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); string jsonstr = jsonSerializer.Serialize(orderid); string result = testService.GetPointRoute(soapHeader, jsonstr); PointRoute route = jsonSerializer.Deserialize<PointRoute>(result); //http://api.map.baidu.com/direction?origin=latlng:34.264642646862,108.95108518068|name: //我家&destination=大雁塔&mode=transit®ion=西安&output=html //http://api.map.baidu.com/direction/v1?mode=driving&origin=清华大学&destination=北京大学&origin_region=北京& //destination_region=北京&output=json&ak=E4805d16520de693a3fe707cdc962045 string str0 = "http://api.map.baidu.com/direction?origin=latlng:"; string str1 = route.PointX +","+ route.PointY; string str2 = "|起点&destination=latlng:"; string str3 = route.PointX2 + "," + route.PointY2; string str4 = "|终点&mode=walking®ion=宁波&output=html"; string str = str0 + str1 + str2 + str3 + str4; Response.Write("<script>window.open('" + str + "','_blank')</script>"); //Response.Redirect(str,true); } }
/// <summary> /// 封号中的用户 /// </summary> /// <returns></returns> public List<UserMessage> getDataToGridView88() { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); List<UserMessage> message = new List<UserMessage>(); //string jsonstr = jsonSerializer.Serialize(Session["ID"].ToString()); //调用服务 RunServiceSoapClient testService = new RunServiceSoapClient(); //接受json格式的字符串,反序列化 WebPages.RunServiceReference.MySoapHeader soapHeader = new WebPages.RunServiceReference.MySoapHeader(); soapHeader.UserName = Session["userName"].ToString(); soapHeader.Password = Session["PS"].ToString(); int i = 3; string jsonstr = jsonSerializer.Serialize(i); string result = testService.SearchUserByType(soapHeader, jsonstr); message = jsonSerializer.Deserialize<List<UserMessage>>(result); return message; }