protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetRequest g=new GetRequest (); string name = g.GetRequestQueryString("name", ""); data_conn cn = new data_conn(); DataSet ds = cn.mdb_ds("select * from TB_Ship where name_en_s='" + name + "'", "ship"); if (ds.Tables["ship"].Rows.Count > 0) { Literal1.Text = ds.Tables["ship"].Rows[0]["name_cn_s"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_cn"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_en"].ToString(); Literal2.Text = ds.Tables["ship"].Rows[0]["name_cn"].ToString(); Literal3.Text = ds.Tables["ship"].Rows[0]["Website"].ToString(); Literal4.Text = ds.Tables["ship"].Rows[0]["cargotail"].ToString(); Literal5.Text = ds.Tables["ship"].Rows[0]["contact"].ToString(); Literal6.Text = ds.Tables["ship"].Rows[0]["introduction"].ToString(); //Literal7.Text = ds.Tables["ship"].Rows[0]["name_cn_s"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_cn"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "/" + ds.Tables["ship"].Rows[0]["name_en"].ToString(); Littitle.Text = "<title>" + ds.Tables["ship"].Rows[0]["name_cn_s"].ToString() + "-" + ds.Tables["ship"].Rows[0]["name_cn"].ToString() + "-" + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "-" + ds.Tables["ship"].Rows[0]["name_en"].ToString() + "-联系方式-公司介绍-环球运费网</title>"; Litkey.Text = "<meta name=\"keywords\" content=\"" + ds.Tables["ship"].Rows[0]["name_cn_s"].ToString() + "," + ds.Tables["ship"].Rows[0]["name_cn"].ToString() + "," + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "," + ds.Tables["ship"].Rows[0]["name_en"].ToString() + ",船公司信息,船公司联系方式,船公司网站,船公司介绍-环球运费网\" />"; Litdes.Text = "<meta name=\"description\" content=\"" + ds.Tables["ship"].Rows[0]["name_cn_s"].ToString() + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "船公司的联系方式和介绍,环球运费网提供最新最全面的" + ds.Tables["ship"].Rows[0]["name_en_s"].ToString() + "船公司信息\" />"; LoadLeft(ds.Tables["ship"].Rows[0]["name_en_s"].ToString()); } else { } } }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); string uvid = "0"; if (GetRequest1.GetRequestCookies("uvid", "0") == "0") { data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = "INSERT INTO TB_UV_LIST (uvtime) values (getdate());select @@identity"; ds = cn.mdb_ds(sql, "uvid"); uvid = ds.Tables["uvid"].Rows[0][0].ToString(); Response.Cookies["uvid"].Value = uvid; Response.Cookies["uvid"].Expires = DateTime.Now.AddDays(365); } else { uvid = GetRequest1.GetRequestCookies("uvid", "0"); } string srvlink = ""; srvlink += "<a title=\"欢迎使用在线客服\" id=\"service_link\" href=\"http://im.cn.alisoft.com/webim/webim/webclient!open.jspa?lang=zh_cn&img=0&memberid="; srvlink += "e" + uvid; srvlink += "&targetid=cnalichna910254766&siteId=4035516&initiative=1&domain=probe.alisoft.com&siteFlag=enet&colorStyle=orange&msg=&ct=\" target=\"_blank\">在线客服</a>"; Literal3.Text = srvlink; }
protected void Page_Load(object sender, EventArgs e) { check check1 = new check(); GetRequest GetRequest1 = new GetRequest(); string u = ""; u = check1.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0")); if (u == "0") { PlaceHolder1.Visible = false; PlaceHolder2.Visible = true; } else { PlaceHolder1.Visible = true; PlaceHolder2.Visible = false; string[] udetail; AllinUser AllinUser1 = new AllinUser(); udetail = AllinUser1.GetUserDetail(u); string uhomeid = udetail[10]; string name = udetail[3]; Literal1.Text = "<A class=login_thumb href=\"/home/space.php?uid=" + udetail[10] + "\"><IMG height=20 alt=" + udetail[3] + " src=\"/uc/avatar.php?uid=" + udetail[10] + "&size=small&type=virtual\" width=20></A> <A class=loginName href=\"/home/space.php?uid=" + udetail[10] + "\">" + udetail[3] + "</A>"; } }
public void get(string MovieID) { GetRequest<string[]> Req = new GetRequest<string[]>(); Req.Error += Req_Error; Req.Completed += Req_Completed; Req.Download(APIuris.MoviePhotos_byID, MovieID); }
protected void Page_Load(object sender, EventArgs e) { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/6464_034.png\" width=\"32\" height=\"32\" />您的申请已提交,感谢您的支持!</strong>"; GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; try { uid = ck.CheckNumber(ss.Decrypto(GetRequest1.GetRequestQueryString("uid", ""))); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; sql = "SELECT userid FROM TB_TOPIC_REG WHERE userid = " + uid + ""; ds = cn.mdb_ds(sql, "user"); if (ds.Tables["user"].Rows.Count > 0) { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/wr.gif\" width=\"32\" height=\"32\" />您已经提交过申请!</strong>"; } else { sql = "INSERT INTO TB_TOPIC_REG (userid) VALUES (" + uid + ")"; cn.mdb_exe(sql); Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/6464_034.png\" width=\"32\" height=\"32\" />您的申请已提交,感谢您的支持!</strong>"; } } catch { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/wr.gif\" width=\"32\" height=\"32\" />抱歉,您需在注册邮件或普通会员注册页面中点击申请链接!</strong>"; } }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); string port = GetRequest1.GetRequestQueryString("port","1"); if (port.ToString().ToLower() == "shanghai") { PlaceHolder1.Visible = true; } if (port.ToString().ToLower() == "ningbo") { PlaceHolder2.Visible = true; } if (port.ToString().ToLower() == "tianjin") { PlaceHolder3.Visible = true; } if (port.ToString().ToLower() == "dalian") { PlaceHolder4.Visible = true; } }
public async Task<SnapshotResult> Get(Firebase reference) { CheckDisposed(); var request = new GetRequest(reference); return await PerformRequest(request) as SnapshotResult; }
public void get() { GetRequest<RootObject> Req = new GetRequest<RootObject>(); Req.Error += Req_Error; Req.Completed += Req_Completed; Req.Download(APIuris.Filmler); }
public void UnsuccessfulMatchReturnsNotFound() { // Arrange var validatorFactory = new Mock<IValidatorEngine>(); var mappingEngine = new Mock<IMappingEngine>(); var repository = new Mock<IRepository>(); var searchCache = new Mock<ISearchCache>(); var service = new PersonService(validatorFactory.Object, mappingEngine.Object, repository.Object, searchCache.Object); var list = new List<PersonMapping>(); repository.Setup(x => x.Queryable<PersonMapping>()).Returns(list.AsQueryable()); var message = new GetRequest { EntityId = 0, }; // Act var contract = service.Request(message); // Assert Assert.IsNotNull(contract, "Contract null"); Assert.IsFalse(contract.IsValid, "Contract valid"); Assert.AreEqual(ErrorType.NotFound, contract.Error.Type, "ErrorType difers"); }
public GetRequest<string> GetUrl(string scorecardViewId, string departmentId = null, string nodeId = null) { var request = new GetRequest<string>(m_clientService, scorecardViewId + "/url"); request.RequestParameters.Add("departmentId", departmentId); request.RequestParameters.Add("nodeId", nodeId); return request; }
public void get(double lat, double lng, string FilmID) { filmID = FilmID; GetRequest<NearestCinema_RootObject> Req = new GetRequest<NearestCinema_RootObject>(); Req.Completed +=NearestCinema_Req_Completed; Req.Download(APIuris.TekSalon_byGPS_byMovieID, lat.ToString(), lng.ToString(), FilmID); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { GetRequest GetRequest1 = new GetRequest(); check check1 = new check(); string pro1 = check1.CheckInput(CheckBox1.Checked == true ? "1" : "0"); //Response.Write(pro1 + ":" + pro2 + ":" + pro3 + ":" +pro4); string userid = check1.CheckInput(GetRequest1.GetRequestQueryString("user_id", "0")); string companyname = check1.CheckInput(TextBox1.Text); string realname = check1.CheckInput(TextBox2.Text); string gender = RadioButtonList1.SelectedValue; string rank = check1.CheckInput(TextBox3.Text); string phone = check1.CheckInput(TextBox4.Text + "-" + TextBox7.Text + "-" + TextBox8.Text); string movephone = check1.CheckInput(TextBox5.Text); string useremail = check1.CheckInput(TextBox6.Text); if (pro1 == "0") { MessageBox("", "您好!请至少选择一件产品"); } else { if (companyname == "" | realname == "" | gender == "" | rank == "" | TextBox7.Text == "" | TextBox8.Text == "" | movephone == "" | useremail == "") { MessageBox("", "您好!请将表格填写完整"); } else { data_conn cn = new data_conn(); string sql = ""; sql += "INSERT INTO TB_PRODUCTS_APPLY "; sql += "("; sql += "pro7,"; sql += "userid,"; sql += "companyname,"; sql += "realname,"; sql += "gender,"; sql += "rank,"; sql += "phone,"; sql += "movephone,"; sql += "useremail "; sql += ") VALUES ("; sql += "" + pro1 + ","; sql += "" + userid + ","; sql += "'" + companyname + "',"; sql += "'" + realname + "',"; sql += "'" + gender + "',"; sql += "'" + rank + "',"; sql += "'" + phone + "',"; sql += "'" + movephone + "',"; sql += "'" + useremail + "' "; sql += ")"; cn.mdb_exe(sql); Response.Redirect("success.aspx"); } } }
public void RequestNotMade() { // Arrange GetRequest request = new GetRequest("http://www.somewhere.co.uk"); // Act and Assert Assert.Throws<RequestNotMadeException>(() => { int i = request.StatusCode; }); }
void NearestCinema_Req_Completed(SalonVeSeans.NearestCinema_RootObject data) { EnYakinSalon = data; GetRequest<RootObject> Req = new GetRequest<RootObject>(); Req.Completed += Req_Completed; Req.Download(APIuris.SalonlarVeSeanslar_byCity_byMovieID, data.cinema.cityId, filmID); }
public void GetRequestValidIdentifierTest2() { GetRequest request = new GetRequest(); request.Identifier = "ark:/87273/q800002m"; var map = request.ExecuteRequest(); Assert.IsNotNull(map); Assert.IsTrue(map.ContainsKey(Metadata.MetadataKeys.Profile)); Assert.IsTrue(map[Metadata.MetadataKeys.Profile] == Metadata.MetadataTypes.DublinCore); }
public GetRequestTests() { var request = new GetRequest<ElasticsearchProject>(2) { Preference = "local", Routing = "2", }; var response = this._client.Get<ElasticsearchProject>(request); this._status = response.ConnectionStatus; }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; uid = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "")); Literal1.Text = "<area shape=\"rect\" coords=\"533,672,844,732\" href=\"join.aspx?uid=" + ss.Encrypto(uid) + "\" />"; }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; uid = ck.CheckNumber(GetRequest1.GetRequestQueryString("uid", "")); Response.Redirect("index.aspx?uid=" + ss.Encrypto(uid)); }
public void TestGetRequest(string url, int expectedStatusCode, string expectedStatusDescription) { // Arrange GetRequest request = new GetRequest(url); // Act request.MakeRequest(); // Assert Assert.AreEqual(expectedStatusCode, request.StatusCode, "Status code"); Assert.AreEqual(expectedStatusDescription, request.StatusDescription, "Status description"); }
public void GetRequestInvalidIdentifierTest() { GetRequest request = new GetRequest(); request.Identifier = "ark:/99999/madeup"; try { var map = request.ExecuteRequest(); throw new Exception("Shouldn't reach this point"); } catch (EZIDApiException) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetRequest g = new GetRequest(); string name = g.GetRequestQueryString("name", ""); data_conn cn = new data_conn(); DataSet ds = cn.mdb_ds("select * from TB_Y_Port where portname_en='" + name + "'", "ship"); //Response.Write("select * from TB_Y_Port where portname_en='" + name + "'"); if (ds.Tables["ship"].Rows.Count > 0) { Literal1.Text = ds.Tables["ship"].Rows[0]["country_en"].ToString() + "/" + ds.Tables["ship"].Rows[0]["country"].ToString() + "-" + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "/" + ds.Tables["ship"].Rows[0]["portname"].ToString(); Literal4.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal2.Text = ds.Tables["ship"].Rows[0]["portname"].ToString(); Literal10.Text = ds.Tables["ship"].Rows[0]["portNum"].ToString(); Literal5.Text = ds.Tables["ship"].Rows[0]["Line"].ToString(); Literal3.Text = ds.Tables["ship"].Rows[0]["country_en"].ToString(); Literal11.Text = ds.Tables["ship"].Rows[0]["country"].ToString(); //Literal7.Text = "<a href='http://localhost/ports/list---" + ds.Tables["ship"].Rows[0]["int_country"].ToString() + "-----1.html'>" + ds.Tables["ship"].Rows[0]["country_en"].ToString() + "/" + ds.Tables["ship"].Rows[0]["country"].ToString() + "</a> > " + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "/" + ds.Tables["ship"].Rows[0]["portname"].ToString(); Literal6.Text = ds.Tables["ship"].Rows[0]["intro"].ToString(); Literal8.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal13.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal15.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal17.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal19.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal21.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal23.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal25.Text = ds.Tables["ship"].Rows[0]["portname"].ToString() + ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal9.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal12.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal14.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal16.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal18.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal20.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal22.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Literal24.Text = ds.Tables["ship"].Rows[0]["portname_en"].ToString(); Littitle.Text = "<title>" + ds.Tables["ship"].Rows[0]["country"].ToString() + "-" + ds.Tables["ship"].Rows[0]["country_en"].ToString() + "-" + ds.Tables["ship"].Rows[0]["portname"].ToString() + "-" + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "-港口介绍,港口介绍-环球运费网</title>"; Litkey.Text = "<meta name=\"keywords\" content=\"" + ds.Tables["ship"].Rows[0]["country"].ToString() + "港口," + ds.Tables["ship"].Rows[0]["country_en"].ToString() + " port," + ds.Tables["ship"].Rows[0]["portname"].ToString() + "," + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "," + ds.Tables["ship"].Rows[0]["portname"].ToString() + "港," + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "port,港口介绍,港口代码-环球运费网\" />"; Litdes.Text = "<meta name=\"description\" content=\"" + ds.Tables["ship"].Rows[0]["country"].ToString() + "港口," + ds.Tables["ship"].Rows[0]["country_en"].ToString() + " port," + ds.Tables["ship"].Rows[0]["portname"].ToString() + "," + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "," + ds.Tables["ship"].Rows[0]["portname"].ToString() + "港," + ds.Tables["ship"].Rows[0]["portname_en"].ToString() + "ports介绍,港口代码,环球运费网提供最全面的" + ds.Tables["ship"].Rows[0]["portname"].ToString() + "港口信息\" />"; //LoadHotShip(); } else { } } }
public byte[] Get(Identifier512 key, int timeout) { byte[] localData = GetData(key); if (localData != null) return localData; var token = Callback.AllocateToken(); GetRequest request = new GetRequest(key, token.Id); using (MemoryStream mStream = new MemoryStream()) { mStream.WriteByte((byte)PacketFlag.GetRequest); Serializer.SerializeWithLengthPrefix<GetRequest>(mStream, request, PrefixStyle.Base128); var remote = RoutingTable.GetConsumer<GetClosestNodes>(GetClosestNodes.GUID).GetClosestContacts(key).First(); remote.Send(RoutingTable.LocalContact, ConsumerId, mStream.ToArray()); } if (!token.Wait(timeout)) throw new TimeoutException(); return token.Response; }
public HtmlTag get_csrf(GetRequest request) { return new HtmlTag("h1", h => h.Text("GET HOLA")); }
public void LoadEditOrder() { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); GetRequest GetRequest1 = new GetRequest(); string u = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0")); string orderid = ck.CheckInput(GetRequest1.GetRequestQueryString("orderid", "0")); string role = GetRequest1.GetRequestQueryString("role", ""); AllinOrder AllinOrder1 = new AllinOrder(); string[] odetail; odetail = AllinOrder1.GetOrderDetail(orderid); ltrHyf.Text = odetail[59]; txtPubf.Text = odetail[4]; txtCode.Value = odetail[0]; txtShipper.Value = odetail[8]; txtConsignee.Value = odetail[9]; txtNotifyParty.Value = odetail[10]; txtCompanyName.Value = odetail[11]; txtEmail.Value = odetail[12]; txtContactor.Value = odetail[13]; txtMobile.Value = odetail[14]; txtTel.Value = odetail[15]; txtFax.Value = odetail[16]; txtstartport.Value = odetail[17]; txtmidport.Value = odetail[18]; txtdestport.Value = odetail[19]; txtMarksNumbers.Value = odetail[20]; txtNumbersofPackages.Value = odetail[21]; txtDescription.Value = odetail[22]; txtGrossWeight.Value = odetail[23]; txtMeasurement.Value = odetail[24]; txtkaihangri.Value = odetail[27]; txtzhuangxiangri.Value = odetail[28]; txtjieguanri.Value = odetail[29]; ltrEndDate.Text = odetail[105]; txtcarrier_name.Value = odetail[26]; ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>"; txtgp.Value = odetail[34]; if (odetail[44] != "") { ltrOrderFujiafei1.Text = "(附加费:" + odetail[44] + ")"; } ltrFreightGP.Text = odetail[49]; ltrFreightGPV.Text = odetail[50]; ltrFreightAppend.Text = odetail[44]; ltrFreightCarrier.Text = odetail[68]; txtbeizhu.Value = odetail[36]; SetStep(odetail[1], odetail[37], odetail[38]); ltrSMS.Text = "<a href=\"/member/pm_detail.aspx?cid=" + odetail[4] + "\" id=\"linkSMS\" target=\"_blank\"></a>"; if (u != odetail[3]) { Response.Redirect("/search/err.aspx"); }//不是买方的用户无修改订单! if (odetail[1] != "2" & odetail[1] != "3" & odetail[1] != "7") { Response.Redirect("/search/err.aspx"); }//排除不能修改的订单状态! ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:center; background:#FFFCF3;border:1px solid #F7E4A5;\">修改订舱单</div>"; AllinFreight AllinFreight1 = new AllinFreight(); string[] fdetail; if (odetail[7] == "0") { fdetail = AllinFreight1.GetFreightDetail("9", ck.CheckNumber(odetail[6]), "0"); } else { fdetail = AllinFreight1.GetFreightDetail("9", "0", ck.CheckNumber(odetail[7])); } ltrEndDate.Text = Convert.ToDateTime(fdetail[6]).ToString("yyyy-MM-dd"); ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>"; ltrFreightPostdate.Text = Convert.ToDateTime(odetail[65]).ToString("MM") + "/" + Convert.ToDateTime(odetail[65]).ToString("dd"); ltrFreightEnddate.Text = Convert.ToDateTime(odetail[66]).ToString("MM") + "/" + Convert.ToDateTime(odetail[66]).ToString("dd"); ltrFreightCompany.Text = fdetail[18]; ltrFreightAllinStar.Text = fdetail[19]; ltrFreightUserStar.Text = fdetail[20]; ltrFreightLine.Text = odetail[69]; ltrFreightStartport.Text = odetail[70]; ltrFreightDestport.Text = odetail[71]; ltrFreightAssuranceSpace.Text = odetail[100]; ltrFreightAssurancePrice.Text = odetail[101]; lblTousu.Text = fdetail[18]; AllinUser AllinUser1 = new AllinUser(); string[] udetail; udetail = AllinUser1.GetUserDetail(u); txtbank.Value = udetail[50]; txtbankname.Value = udetail[51]; txtbankaccount.Value = udetail[52]; txtotheraccount.Value = udetail[53]; txtaliaccount.Value = udetail[9]; }
protected void SetStep(string status, string yiping_shipper, string yiping_forward) { GetRequest GetRequest1 = new GetRequest(); string role = GetRequest1.GetRequestQueryString("role", ""); string ss1 = "<img src=\"/images/fcl/shipper_booking_m_r1_c1.gif\" /> "; string ss4 = "<img src=\"/images/fcl/shipper_booking_m2_r1_c9.gif\" /> "; string ss4_p = "<img src=\"/images/fcl/shipper_booking_m_r1_c9.gif\" /> "; if (role == "shipper") { ss1 = "<img src=\"/images/fcl/shipper_booking_m_r1_c1.gif\" /> "; ss4 = "<img src=\"/images/fcl/shipper_booking_m2_r1_c9.gif\" /> "; ss4_p = "<img src=\"/images/fcl/shipper_booking_m_r1_c9.gif\" /> "; }//订舱方显示的文本 if (role == "forward") { ss1 = "<img src=\"/images/fcl/booking_m_r1_c1.gif\" /> "; ss4 = "<img src=\"/images/fcl/booking_m2_r1_c9.gif\" /> "; ss4_p = "<img src=\"/images/fcl/booking_m_r1_c9.gif\" /> "; }//承运方显示的文本 string s1 = ss1; string a1 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; string s2 = "<img src=\"/images/fcl/booking_m2_r1_c3.gif\" /> "; string a2 = "<img src=\"/images/fcl/booking_bb2.gif\" /> "; string s3 = "<img src=\"/images/fcl/booking_m2_r1_c5.gif\" /> "; string a3 = "<img src=\"/images/fcl/booking_bb2.gif\" /> "; string s4 = ss4; string a4 = "<img src=\"/images/fcl/booking_bb2.gif\" /> "; string s5 = "<img src=\"/images/fcl/booking_m2_r1_c7.gif\" />"; string s = ""; if (status == "3") { s2 = "<img src=\"/images/fcl/booking_m_r1_c3.gif\" /> "; a2 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; } if (status == "4") { s2 = "<img src=\"/images/fcl/booking_m_r1_c3.gif\" /> "; a2 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s3 = "<img src=\"/images/fcl/booking_m_r1_c5.gif\" /> "; a3 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; } if (status == "5") { s2 = "<img src=\"/images/fcl/booking_m_r1_c3.gif\" /> "; a2 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s3 = "<img src=\"/images/fcl/booking_m_r1_c5.gif\" /> "; a3 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s4 = ss4_p; a4 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; } if (yiping_shipper == "1" & yiping_forward == "1") { s2 = "<img src=\"/images/fcl/booking_m_r1_c3.gif\" /> "; a2 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s3 = "<img src=\"/images/fcl/booking_m_r1_c5.gif\" /> "; a3 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s4 = ss4_p; a4 = "<img src=\"/images/fcl/booking_m_r1_c12.gif\" /> "; s5 = "<img src=\"/images/fcl/booking_m_r1_c7.gif\" />"; } s = s1 + a1 + s2 + a2 + s3 + a3 + s4 + a4 + s5; ltrStep.Text = s; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetRequest GetRequest1 = new GetRequest(); cr = GetRequest1.GetRequestQueryString("cr", ""); l = GetRequest1.GetRequestQueryString("l", ""); p = GetRequest1.GetRequestQueryString("p", "1"); loadRecord(); } }
public void LoadSavedOrder() { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); GetRequest GetRequest1 = new GetRequest(); string u = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0")); string orderid = ck.CheckInput(GetRequest1.GetRequestQueryString("orderid", "0")); string role = GetRequest1.GetRequestQueryString("role", ""); AllinOrder AllinOrder1 = new AllinOrder(); string[] odetail; odetail = AllinOrder1.GetOrderDetail(orderid); ltrOrderViewCode.Text = odetail[0]; ltrOrderViewShipper.Text = odetail[8]; ltrOrderViewConsignee.Text = odetail[9]; ltrOrderViewNotifyParty.Text = odetail[10]; ltrOrderViewCompanyName.Text = odetail[11]; ltrOrderViewEmail.Text = odetail[12]; ltrOrderViewContactor.Text = odetail[13]; ltrOrderViewMobile.Text = odetail[14]; ltrOrderViewTel.Text = odetail[15]; ltrOrderViewFax.Text = odetail[16]; ltrOrderViewStartport.Text = odetail[17]; ltrOrderViewMidport.Text = odetail[18]; ltrOrderViewDestport.Text = odetail[19]; ltrOrderViewMarksNumbers.Text = odetail[20]; ltrOrderViewNumbersofPackages.Text = odetail[21]; ltrOrderViewDescription.Text = odetail[22]; ltrOrderViewGrossWeight.Text = odetail[23]; ltrOrderViewMeasurement.Text = odetail[24]; ltrOrderViewCarrier.Text = odetail[26]; ltrOrderViewKaihangri.Text = odetail[27]; ltrOrderViewZhuangxiangri.Text = odetail[28]; ltrOrderViewJieguanri.Text = odetail[29]; ltrOrderViewGP.Text = odetail[34]; ltrFreightGP.Text = odetail[49]; ltrFreightGPV.Text = odetail[50]; ltrFreightAppend.Text = odetail[44]; ltrFreightCarrier.Text = odetail[68]; ltrOrderViewHyf.Text = odetail[59]; ltrOrderViewBeizhu.Text = odetail[36]; ltrOverageThis.Text = odetail[62]; txt_edit_pricegp.Text = odetail[49]; txt_edit_pricegpv.Text = odetail[50]; txt_edit_price_shipcompany.Text = odetail[68]; if (odetail[44] != "") { ltrOrderFujiafei.Text = "(附加费:" + odetail[44] + ")"; } SetStep(odetail[1], odetail[37], odetail[38]); if (u != odetail[3] & u != odetail[4]) { Response.Redirect("/search/err.aspx"); }//不是买卖双方的用户无法查看该订单! string order_type_string = odetail[58]; if (role == "shipper") { PlaceHolder3.Visible = true; ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:left; background:#FFFCF3;border:1px solid #F7E4A5;\">" + odetail[89].Replace("{1}", orderid).Replace("{9}", order_type_string) + "</div>"; if (u != odetail[3]) { Response.Redirect("/search/err.aspx"); }//不是买卖双方的用户无法查看该订单! }//订舱方显示的文本 if (role == "forward") { PlaceHolder4.Visible = true; ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:left; background:#FFFCF3;border:1px solid #F7E4A5;\">" + odetail[90].Replace("{1}", orderid).Replace("{9}", order_type_string) + "</div>"; if (u != odetail[4]) { Response.Redirect("/search/err.aspx"); }//不是买卖双方的用户无法查看该订单! if (odetail[1] != "2") { phEditDisabled.Visible = true; phEditEnabled.Visible = false; } else { phEditDisabled.Visible = false; phEditEnabled.Visible = true; } }//承运方显示的文本 if (odetail[1] != "2") { PlaceHolder2.Visible = false; PlaceHolder1.Visible = false; } ltrSMS.Text = "<a href=\"/member/pm_detail.aspx?cid=" + odetail[4] + "\" id=\"linkSMS\" target=\"_blank\"></a>"; AllinFreight AllinFreight1 = new AllinFreight(); string[] fdetail; if (odetail[7] == "0") { fdetail = AllinFreight1.GetFreightDetail("9", ck.CheckNumber(odetail[6]), "0"); } else { fdetail = AllinFreight1.GetFreightDetail("9", "0", ck.CheckNumber(odetail[7])); } ltrEndDate.Text = Convert.ToDateTime(fdetail[6]).ToString("yyyy-MM-dd"); ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>"; ltrFreightPostdate.Text = Convert.ToDateTime(odetail[65]).ToString("MM") + "/" + Convert.ToDateTime(odetail[65]).ToString("dd"); ltrFreightEnddate.Text = Convert.ToDateTime(odetail[66]).ToString("MM") + "/" + Convert.ToDateTime(odetail[66]).ToString("dd"); ltrFreightCompany.Text = fdetail[18]; ltrFreightAllinStar.Text = fdetail[19]; ltrFreightUserStar.Text = fdetail[20]; ltrFreightLine.Text = odetail[69]; ltrFreightStartport.Text = odetail[70]; ltrFreightDestport.Text = odetail[71]; ltrFreightAssuranceSpace.Text = odetail[100]; ltrFreightAssurancePrice.Text = odetail[101]; lblTousu.Text = fdetail[18]; AllinUser AllinUser1 = new AllinUser(); string[] udetail; udetail = AllinUser1.GetUserDetail(u); txtbank.Value = udetail[50]; txtbankname.Value = udetail[51]; txtbankaccount.Value = udetail[52]; txtotheraccount.Value = udetail[53]; ltrOverageTotal.Text = udetail[55]; ltrOverageAvailable.Text = (Convert.ToInt32(ltrOverageTotal.Text) - Convert.ToInt32(ltrOverageThis.Text)).ToString(); ltrPayJump.Text = "<a href=\"/member/order/pay_sel_single.aspx?orderid=" + orderid + "\">立即充值</a>"; //if (Convert.ToInt32(ltrOverageTotal.Text) - Convert.ToInt32(ltrOverageThis.Text) >= 0) //{ // PlaceHolder8.Visible = true; // PlaceHolder9.Visible = false; // PlaceHolder10.Visible = true; // PlaceHolder11.Visible = false; //} //else //{ // PlaceHolder8.Visible = false; // PlaceHolder9.Visible = true; // PlaceHolder10.Visible = false; // PlaceHolder11.Visible = true; //} PlaceHolder8.Visible = true; PlaceHolder9.Visible = false; PlaceHolder10.Visible = true; PlaceHolder11.Visible = false; }
public override void VisitGetDescription(GetRequest element) => _builder.MapGet(element.Path, RequestDelegate());
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { AllinOrder AllinOrder1 = new AllinOrder(); GetRequest GetRequest1 = new GetRequest(); string u = GetRequest1.GetRequestCookies("user_id", "0"); if (u == "0") { } else { if (AllinOrder1.GetOrderTry(u) == "success") { Response.Redirect("tryalready.aspx"); } else { AllinOrder1.SetOrderTry(u); Response.Redirect("trysuccess.aspx"); } } } }
public object Get(GetRequest request) { return new GetRequestResponse(); }
/* post new order row to API */ public string PostOrderRowRequest(string orderId, BPvalues value, int index) { // set has error to false HasError = false; // get product id GetRequest get = new GetRequest(appRef, appToken); string productId = get.GetProductId(value.Sku[index]); // fields for web request string uri = "https://ws-use.brightpearl.com/2.0.0/ashlin/order-service/order/" + orderId + "/row"; request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "POST"; request.ContentType = "application/json"; request.Headers.Add("brightpearl-app-ref", appRef); request.Headers.Add("brightpearl-account-token", appToken); // flags creation string sku = value.Sku[index]; int quantity = value.Quantity[index]; bool imprint = value.Logo; bool rush = value.Rush; double netPrice = Price.GetPrice(value.BasePrice[index], value.PricingTier[index], quantity, imprint, rush, !value.Country.ToUpper().Contains("CA")) * quantity; string taxCode; double taxRate; if (!value.Country.ToUpper().Contains("CA")) { // the case if it's US order, no need tax taxCode = "Z"; taxRate = 0; } else { // the case if it's CA order, get tax code depend on region switch (value.Province) { case "NB": taxCode = "NB"; taxRate = 0.13; break; case "NF": taxCode = "NF"; taxRate = 0.13; break; case "NL": taxCode = "NL"; taxRate = 0.13; break; case "NS": taxCode = "NS"; taxRate = 0.13; break; case "ON": taxCode = "ON"; taxRate = 0.13; break; case "PEI": taxCode = "PEI"; taxRate = 0.14; break; case "BC": taxCode = "BC"; taxRate = 0.05; break; case "MAN": taxCode = "MAN"; taxRate = 0.05; break; case "PQ": taxCode = "PQ"; taxRate = 0.05; break; case "SK": taxCode = "SK"; taxRate = 0.05; break; case "AB": taxCode = "AB"; taxRate = 0.05; break; case "NV": taxCode = "NV"; taxRate = 0.05; break; case "YK": taxCode = "YK"; taxRate = 0.05; break; default: taxCode = "N"; taxRate = 0; break; } } // generate JSON file for order row post string textJson; if (productId != null) { textJson = "{\"productId\":\"" + productId + "\",\"productName\":\"" + value.Description[index] + " - " + (value.GiftBox[index] ? "Includes Gift Boxes" : "Basic packaging included : {gift boxes extra}") + "\",\"quantity\":{\"magnitude\":\"" + quantity + "\"},\"rowValue\":{\"taxCode\":\"" + taxCode + "\",\"rowNet\":{\"value\":\"" + Math.Round(netPrice, 4) + "\"},\"rowTax\":{\"value\":\"" + Math.Round(netPrice * taxRate, 4) + "\"}}}"; } else { textJson = "{\"productName\":\"" + sku + ' ' + value.Description[index] + " - " + (value.GiftBox[index] ? "Includes Gift Boxes" : "Basic packaging included : {gift boxes extra}") + "\",\"quantity\":{\"magnitude\":\"" + quantity + "\"},\"rowValue\":{\"taxCode\":\"" + taxCode + "\",\"rowNet\":{\"value\":\"" + Math.Round(netPrice, 4) + "\"},\"rowTax\":{\"value\":\"" + Math.Round(netPrice * taxRate, 4) + "\"}}}"; } // turn request string into a byte stream byte[] postBytes = Encoding.UTF8.GetBytes(textJson); // send request using (Stream requestStream = request.GetRequestStream()) requestStream.Write(postBytes, 0, postBytes.Length); // get the response from server try { response = (HttpWebResponse)request.GetResponse(); } catch { HasError = true; return(null); // 500 server internal error or 503 Server Unavailable } string result; using (StreamReader streamReader = new StreamReader(response.GetResponseStream())) result = streamReader.ReadToEnd(); result = SubstringMethod(result, ":", 1); return(GetTarget(result)); //return the order row ID }
/// <inheritdoc /> public override Task <GetMongoDBResponse> GetMongoDB(GetRequest request, ServerCallContext context) => Task.FromResult(_mongodb.GetResource(request.CallContext.ExecutionContext.ToExecutionContext()));
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); admin_id = GetRequest1.GetRequestCookies("admin_id", "0"); //LoadUser(); if (Page.IsPostBack == false) { LoadRecord(lblCurrentPage.Text); } }
public void RedundantGetRequestTest() { byte[] message = null; Status status = Status.UnknownCommand; var headerOK = new MemcacheResponseHeader { Opcode = Opcode.Get, Status = Status.NoError }; var headerFail = new MemcacheResponseHeader { Opcode = Opcode.Get, Status = Status.KeyNotFound }; // 1. Test redundancy = 3 and all gets are successful var request = new GetRequest(CallBackPolicy.AnyOK) { Key = "Hello".Select(c => (byte)c).ToArray(), RequestId = 0, CallBack = (s, m) => { message = m; status = s; }, Replicas = 2, }; var queryBuffer = request.GetQueryBuffer(); CollectionAssert.AreEqual(GET_QUERY, queryBuffer, "The get query buffer is different from the expected one"); Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.NoError, status, "Returned status should be NoError after the first successful get"); Assert.AreSame(GET_MESSAGE, message, "Sent message and the one returned by the request are different"); status = Status.UnknownCommand; Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "The callback should not be called a second time"); status = Status.UnknownCommand; Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "The callback should not be called a second time"); // 2. Test redundancy = 3, the first get is failing request = new GetRequest(CallBackPolicy.AnyOK) { Key = "Hello".Select(c => (byte)c).ToArray(), RequestId = 0, CallBack = (s, m) => { message = m; status = s; }, Replicas = 2, }; status = Status.UnknownCommand; Assert.DoesNotThrow(() => request.HandleResponse(headerFail, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "Callback should not be called after the first failed get"); Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.NoError, status, "Returned status should be NoError after the first successful get"); Assert.AreSame(GET_MESSAGE, message, "Sent message and the one returned by the request are different"); status = Status.UnknownCommand; Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "The callback should not be called a second time"); // 3. Test redundancy = 3, the first and second gets are failing request = new GetRequest(CallBackPolicy.AnyOK) { Key = "Hello".Select(c => (byte)c).ToArray(), RequestId = 0, CallBack = (s, m) => { message = m; status = s; }, Replicas = 2, }; status = Status.UnknownCommand; Assert.DoesNotThrow(() => request.HandleResponse(headerFail, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "Callback should not be called after the first failed get"); Assert.DoesNotThrow(() => request.Fail(), "Handle request should not throw an exception"); Assert.AreEqual(Status.UnknownCommand, status, "Callback should not be called after the second failed get"); Assert.DoesNotThrow(() => request.HandleResponse(headerOK, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception"); Assert.AreEqual(Status.NoError, status, "Returned status should be NoError after the first successful get"); Assert.AreSame(GET_MESSAGE, message, "Sent message and the one returned by the request are different"); }