public order GetOrderObjectRequestByExternalRef(long external_ref, string status_description) { order o = new order(); using (var dc = new stylusDataContext()) { List<item> itm = new List<item>(); List<tracking> trk = new List<tracking>(); ISingleResult<sp_get_order_by_external_refResult> res = dc.sp_get_order_by_external_ref(external_ref); foreach (sp_get_order_by_external_refResult ret in res) { o.id = ret.order_external_ref; o.status = status_description; item i = new item(); i.id = ret.item_external_ref; itm.Add(i); o.item = itm; tracking t = new tracking(); t.number = ret.tracking; trk.Add(t); o.tracking = trk; } } return o; }
protected void Button1_Click(object sender, EventArgs e) { if (Session["order"] == null) { Response.Write("<script type='text/javascript'>alert('请先添加购物车!')</script>"); } else { SqlConnection conn = GetConn(); order a = new order(); a = (order)Session["order"]; DateTime t = DateTime.Now; string ss = "配送中"; string strsql = "INSERT INTO map VALUES('" + a.totalprice.ToString() + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + Session["user"].ToString() + "','" + ss.ToString() + "','" + t.Date + "')"; SqlCommand cmd = new SqlCommand(strsql, conn); if (cmd.ExecuteNonQuery() > 0) { Session.Remove("order"); Response.Write("<script type='text/javascript'>alert('购买成功!')</script>"); Response.Redirect("shopping.aspx"); } else { Response.Write("<script type='text/javascript'>alert('购买失败!')</script>"); } conn.Close(); } }
protected void Page_Load(object sender, EventArgs e) { order a = new order(); Label2.Text=""; if (Session["order"] == null) { Label2.Text = "<p style='margin:0 auto'>购物车为空</p>"; } else { a = (order)Session["order"]; if (a.a.Count == 0) { Label2.Text = "<p style='margin:0 auto'>购物车为空</p>"; } else { Label2.Text="<table border=1 ><table align='center' width='900' border='1' bordercolor='#000000' style='border-collapse:collapse'><tr><th>书名</th><th>价格</th><th>数量</th></tr>"; foreach (orderItemInfo cur in a.a) { Label2.Text += "<tr><td>" + cur.name.ToString() + "</td>"; Label2.Text += "<td>" + cur.price + "</td>"; Label2.Text += "<td>" + cur.booknum + "</td>"; Label2.Text += "</tr>"; } Label2.Text += "</table>"; Label1.Text += "<p style='margin-left:800px'>总价为" + a.totalprice + "</p>"; } } }
public void GetData(out order, out amount) { String s1, s2; Console.Write("Enter order number "); Console.Write("Enter quantity "); order = Convert.ToInt32(s1); amount = Convert.ToInt32(s2); return order, amount; }
static void Main(string[] args) { order Todd = new order(); //int count, cost; //string name; Console.Write("\nEnter the Count: "); Todd.unitCount = Convert.ToDouble(Console.ReadLine()); Console.Write("\nEnter the Cost: "); Todd.unitCost = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nThe Total Cost is: {0}", Todd.totalPrice()); Console.ReadKey(); }
public static void show( Form parent, order ind) { if ( mode && !alreadySeen[ (int)ind ] ) { string title = parent.Text; // S:\pH\Pocket Humanity\forms\ parent.Text = ""; frmInfo fi = new frmInfo( enums.infoType.tutorial, (int)ind ); fi.ShowDialog(); alreadySeen[ (int)ind ] = true; parent.Text = title; } }
static void Main(string[] args) { order Todd = new order(); //int count, cost; //string name; Console.Write("\nEnter the item Name: "); Todd.itemName = Console.ReadLine(); Console.Write("\nEnter the Count: "); Todd.unitCount = Convert.ToDouble(Console.ReadLine()); Console.Write("\nEnter the Cost: "); Todd.unitCost = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\n{0}",Todd.itemInfo()); Console.ReadKey(); }
protected void Page_Load(object sender, EventArgs e) { order order1 = new order(); check ck = new check(); string u = ck.CheckNumber(order1.GetRequestQueryString("u", "0")); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = "SELECT * FROM TB_USER WHERE userid = " + u; ds = cn.mdb_ds(sql, "user"); Label1.Text = ds.Tables["user"].Rows[0]["companyname"].ToString(); Label9.Text = ds.Tables["user"].Rows[0]["postnumber"].ToString(); Label11.Text = ds.Tables["user"].Rows[0]["address"].ToString(); Label4.Text = "<span><a href=\"/company/" + setkey(u) + "\" style='font-size:14px; font-weight:bold; color:#FF6600;' target=\"_blank\">" + ds.Tables["user"].Rows[0]["realname"].ToString() + "</a></span>"; Literal25.Text = "<a href=\"/member/pm_detail.aspx?pid=1&cid=" + u + "\" target=\"_blank\"><img src=\"/images/fcl/bot_1.jpg\" border=\"0\" style= 'margin-top: 12px;'/></a>"; if ((bool)ds.Tables["user"].Rows[0]["HeadURL"] == true) { imghead.Src = "/member/Head/" + ds.Tables["user"].Rows[0]["UserID"].ToString() + ".jpg"; } else { imghead.Src = "/member/Head/default.jpg"; } LtrStars1.Text = Star1(ds.Tables["user"].Rows[0]["star_allin"].ToString()); LtrStars2.Text = Star2(ds.Tables["user"].Rows[0]["star_user"].ToString()); try { ImageButton1.ImageUrl = "/images/get/company_tel.aspx?u=" + setkey(u); ImageButton3.ImageUrl = "/images/get/company_email.aspx?u=" + setkey(u); ImageButton4.ImageUrl = "/images/get/company_mobile.aspx?u=" + setkey(u); } catch { } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { check ck = new check(); order order1 = new order(); string u = ck.CheckNumber(order1.GetRequestQueryString("u", "0")); mysqldata_conn mycn = new mysqldata_conn(); data_conn cn=new data_conn (); DataSet ds = cn.mdb_ds("select * from TB_User where UserID=" + u,"UCenterHomeUid"); string fuid = ds.Tables["UCenterHomeUid"].Rows[0]["UCenterHomeUid"].ToString(); //Response.Write("select * from TB_User where UserID=" + Request.Cookies["user_id"].Value.ToString()); ds = cn.mdb_ds("select * from TB_User where UserID=" + Request.Cookies["user_id"].Value.ToString(), "UCenterHomeUid"); string uid = ds.Tables["UCenterHomeUid"].Rows[0]["UCenterHomeUid"].ToString(); string fuername = ds.Tables["UCenterHomeUid"].Rows[0]["UCenterHomeUid"].ToString(); mycn.mdb_exe("insert into uchome_friend (uid,fuid,fusername,status,dateline) values (" + uid + "," + fuid + ",'',1," + UnixTimestamp() + ")"); mycn.mdb_exe("insert into uc_friends (uid,friendid,direction) values (" + uid + "," + fuid + ",3)"); mycn.mdb_exe("insert into uc_friends (uid,friendid,direction) values (" + fuid + "," + uid + ",3)"); ScriptManager.RegisterStartupScript(ImageButton2, ImageButton2.GetType(), "Alert", "alert('好友添加成功');window.location.href='friend.aspx'", true); }
private void OnLeapHand(float pn_x, float pn_y, float pn_z, float pp_x, float pp_y, float pp_z, float pd_x, float pd_y, float pd_z) { string log = null; if (pn_z < -0.4 && lastStrOrder != order.FORWARD) { aSocket.SendData(NXTRemoteLib.Controllers.XML.SendOrder("0", EFFORT.ToString(), "1", "true")); lastStrOrder = order.FORWARD; log = "Forward !"; } else if (pn_z > 0.4 && lastStrOrder != order.BACKWARD) { aSocket.SendData(NXTRemoteLib.Controllers.XML.SendOrder("0", EFFORT.ToString(), "1", "false")); lastStrOrder = order.BACKWARD; log = "Backward !"; } else if (pn_x > 0.3 && lastStrOrder != order.LEFT) { aSocket.SendData(NXTRemoteLib.Controllers.XML.SendOrder("1", EFFORT.ToString(), "1", "false")); lastStrOrder = order.LEFT; log = "Left !"; } else if (pn_x < -0.3 && lastStrOrder != order.RIGHT) { aSocket.SendData(NXTRemoteLib.Controllers.XML.SendOrder("1", EFFORT.ToString(), "1", "true")); lastStrOrder = order.RIGHT; log = "Right !"; } else if (lastStrOrder != order.STOP) { if ((pn_z > -0.4 && pn_z < 0.4) && (pn_x < 0.3 && pn_x > -0.3)) { aSocket.SendData(NXTRemoteLib.Controllers.XML.SendOrder("0", "0", "0", "false")); lastStrOrder = order.STOP; log = "Stop !"; } } if (log != null) { UpdateLogListbox(log); } }
protected void Page_Load(object sender, EventArgs e) { writeLog("����ʼ", DateTime.Now.ToString()); //***************************************************************************************** ///����֪��https��ʱ����ʹ��http //string alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?"; string alipayNotifyURL = "http://notify.alipay.com/trade/notify_query.do?"; string partner = "2088201885472720"; //*********partner�������id��������д�� string key = "o272s6dqq0s60tm44sy314jvnsfeihd0"; //************partner �Ķ�Ӧ���װ�ȫУ���루������д�� alipayNotifyURL = alipayNotifyURL + "service=notify_verify" + "&partner=" + partner + "¬ify_id=" + Request.Form["notify_id"]; // alipayNotifyURL = alipayNotifyURL + "&partner=" + partner + "¬ify_id=" + Request.Form["notify_id"]; //��ȡ֧����ATN���ؽ����true����ȷ�Ķ�����Ϣ��false ����Ч�� string responseTxt = Get_Http(alipayNotifyURL, 120000); //**************************************************************************************** int i; NameValueCollection coll; //Load Form variables into NameValueCollection variable. coll = Request.Form; // Get names of all forms into a string array. String[] requestarr = coll.AllKeys; //�������� string[] Sortedstr = BubbleSort(requestarr); //for (i = 0; i < Sortedstr.Length; i++) //{ // Response.Write("Form: " + Sortedstr[i] + "=" + Request.Form[Sortedstr[i]] + "<br>"); //} //�����md5ժҪ�ַ��� �� string prestr = ""; for (i = 0; i < Sortedstr.Length; i++) { if (Request.Form[Sortedstr[i]] != "" && Sortedstr[i] != "sign") { if (i == Sortedstr.Length - 1) { prestr = prestr + Sortedstr[i] + "=" + Request.Form[Sortedstr[i]]; } else { prestr = prestr + Sortedstr[i] + "=" + Request.Form[Sortedstr[i]] + "&"; } } } prestr = prestr + key; string mysign = GetMD5(prestr); string sign = Request.Form["sign"]; string dingdan = Request.Form["outOrderNo"]; //��ȡ���ݹ����Ķ����� string status = Request.Form["status"]; //��ȡ����״̬ writeLog("prestr=" + prestr + ",request_sign=" + Request.Form["sign"] + ",mysign=" + mysign + ",sign=" + sign + ",dingdan=" + dingdan + ",status=" + status + ",responseTxt=" + responseTxt, DateTime.Now.ToString()); if (mysign == sign && responseTxt == "true" && status == "S") //��֤֧������������Ϣ��ǩ���Ƿ���ȷ { writeLog("��ȷ", DateTime.Now.ToString()); //�����Լ����ݿ�Ķ�����䣬���Լ���дһ�� check ck = new check(); string orderid = ck.CheckInput(dingdan); //��ö����� string[] odetail; odetail = AllinOrder1.GetOrderDetail(orderid); string alipay_pay_return = odetail[120]; if (alipay_pay_return == "0") { string userid = odetail[4]; //��û������ string otherid = odetail[3]; //��û������ string order_type_string = odetail[58]; double base_fee = Convert.ToDouble(odetail[62]); order o = new order(); AllinOrder1.OrderAddCredit(userid,base_fee.ToString(), "9", orderid, "0", "1"); //o.OrderAddCredit(base_fee.ToString(), "9", orderid, "0", "1");//Ԥ�汣֤�� AllinOrder1.SetOrderDetail("2", "2", "3", orderid, ""); //����״̬�����ݶ���Ϣ AllinOrder1.SetAliPayReturn(orderid, "1"); writeLog("д�����ݿ�", DateTime.Now.ToString()); } Response.Write("success"); //���ظ�֧������Ϣ���ɹ� } else { writeLog("����", DateTime.Now.ToString()); Response.Write("fail"); } writeLog("�������", DateTime.Now.ToString()); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (Session["user"] != null) { //添加购物车 if (e.CommandName.ToLower() == "add") { order or = null; //存储购物车信息 orderItemInfo orderItem = null; // 购买书籍的信息 string index=e.CommandArgument.ToString(); SqlConnection conn = GetConn(); string strsql = "select * from Book where bookid='" +index+ "'"; SqlCommand cmd = new SqlCommand(strsql, conn); SqlDataReader dr = cmd.ExecuteReader(); if(dr.Read()) { orderItem=new orderItemInfo(); orderItem.price=Convert.ToDouble(dr["price"]); orderItem.name=dr["name"].ToString(); orderItem.bookid=Convert.ToInt32(dr["bookid"]); orderItem.booknum = 1; } //判断购物车中是否有书籍 if (Session["order"] == null) { //创建购物车 or = new order(); or.a.Add(orderItem); //添加新书到列表 //购买时间 or.totalprice=Convert.ToInt32(orderItem.price); //总价格 or.totalnum = 1; //总数量 Session["order"] = or;//记录订单 } else //购物车中有书籍 { or = (order)Session["order"]; //将Session存入到order int i = 0; //判断购物车中是否已经有了此书 for (i = 0; i < or.a.Count; i++) { //如果有此书,在此基础上加 if (orderItem.bookid == ((orderItemInfo)or.a[i]).bookid) { ((orderItemInfo)or.a[i]).booknum++; //书籍数量加1 ((orderItemInfo)or.a[i]).price += orderItem.price; break; } } if (i == or.a.Count)//购物车中没有此书,就将此书加到购物车 { or.a.Add(orderItem); } or.totalnum++; //总数量加1 or.totalprice += orderItem.price; //总价格加1 Session["order"] = or; } order or1 = (order)Session["order"]; // Label4.Text = ((orderItemInfo)or.a[0]).price.ToString(); Response.Write("<script language='javascritp'>alert('添加成功!');</script>"); conn.Close(); } } else { Response.Write("<script language='javascritp'>alert('清先登录!');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { login lg = new login(); lg.login(); order order1 = new order(); check ck = new check(); string u = ck.CheckNumber(order1.GetRequestQueryString("u", "0")); string myu = ck.CheckNumber(order1.GetRequestCookies("user_id", "")); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = "SELECT * FROM TB_USER WHERE userid = " + u; ds = cn.mdb_ds(sql, "user"); Label1.Text = ds.Tables["user"].Rows[0]["companyname"].ToString(); Label9.Text = ds.Tables["user"].Rows[0]["postnumber"].ToString(); Label11.Text = ds.Tables["user"].Rows[0]["address"].ToString(); Label4.Text = "<span><a href=\"/company/" + setkey(u) + "\" style='font-size:14px; font-weight:bold; color:#FF6600;' target=\"_blank\">" + ds.Tables["user"].Rows[0]["realname"].ToString() + "</a></span>"; Literal25.Text = "<a href=\"/member/pm_detail.aspx?pid=1&cid=" + u + "\" target=\"_blank\"><img src=\"/images/fcl/bot_1.jpg\" border=\"0\" style= 'margin-top: 12px;'/></a>"; if ((bool)ds.Tables["user"].Rows[0]["HeadURL"] == true) { imghead.Src = "/member/Head/" + ds.Tables["user"].Rows[0]["UserID"].ToString() + ".jpg"; } else { imghead.Src = "/member/Head/default.jpg"; } LtrStars1.Text = Star1(ds.Tables["user"].Rows[0]["star_allin"].ToString()); LtrStars2.Text = Star2(ds.Tables["user"].Rows[0]["star_user"].ToString()); try { ImageButton1.ImageUrl = "/images/get/company_tel.aspx?u=" + setkey(u); ImageButton3.ImageUrl = "/images/get/company_email.aspx?u=" + setkey(u); ImageButton4.ImageUrl = "/images/get/company_mobile.aspx?u=" + setkey(u); } catch { } AllinUser AllinUser1 = new AllinUser(); mysqldata_conn mycn = new mysqldata_conn(); sql = "SELECT uid FROM uc_friends WHERE uid = " + AllinUser1.GetUserDetail(myu)[10] + " AND friendid = " + ds.Tables["user"].Rows[0]["UCenterHomeUid"].ToString(); //Response.Write(sql); DataSet dsu = new DataSet(); dsu = mycn.mdb_ds(sql, "ufriend"); if (dsu.Tables["ufriend"].Rows.Count > 0) { ImageButton2.Visible = false; Label2.Visible = true; } }
public static string getAString(order ind) { if ( list == null ) populate( false ); string s = null; try { s = list[ (int)ind ]; } catch { s = "Error getting string: " + ind.ToString(); } return s; }
protected void Page_Load(object sender, EventArgs e) { writeLog("程序开始", DateTime.Now.ToString()); ///当不知道https的时候,请使用http //string alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?"; string alipayNotifyURL = "http://notify.alipay.com/trade/notify_query.do?"; string partner = "2088201885472720"; //partner string key = "o272s6dqq0s60tm44sy314jvnsfeihd0"; //partner //alipayNotifyURL = alipayNotifyURL + "service=notify_verify" + "&partner=" + partner + "¬ify_id=" + Request.QueryString["notify_id"]; alipayNotifyURL = alipayNotifyURL + "&partner=" + partner + "¬ify_id=" + Request.QueryString["notify_id"]; string responseTxt = Get_Http(alipayNotifyURL, 120000); //********************************************************************************************* int i; NameValueCollection coll; //Load Form variables into NameValueCollection variable. coll = Request.QueryString; // Get names of all forms into a string array. String[] requestarr = coll.AllKeys; //进行排序; string[] Sortedstr = BubbleSort(requestarr); //构造待md5摘要字符串 ; StringBuilder prestr = new StringBuilder(); for (i = 0; i < Sortedstr.Length; i++) { if (Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type") { if (i == Sortedstr.Length - 1) { prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]]); } else { prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "&"); } } } prestr.Append(key); //生成Md5摘要; string mysign = GetMD5(prestr.ToString()); string sign = Request.QueryString["sign"]; //Response.Write(Request.QueryString["amount"]); //Response.Write(mysign); //Response.Write("=="); //Response.Write(sign); writeLog("prestr=" + prestr + ",request_sign=" + Request.QueryString["sign"] + ",mysign=" + mysign + ",sign=" + sign + ",dingdan=" + Request.QueryString["out_order_no"] + ",responseTxt=" + responseTxt, DateTime.Now.ToString()); if (mysign == sign && responseTxt == "true") //验证支付发过来的消息,签名是否正确 { //更新自己数据库的订单语句,请自己填写一下 check ck = new check(); string orderid = ck.CheckInput(GetRequestQueryString("out_order_no", "")); //获得订单号 string[] odetail; odetail = AllinOrder1.GetOrderDetail(orderid); string alipay_pay_return = odetail[120]; if (alipay_pay_return == "0") { string userid = odetail[4]; //获得货代编号 string otherid = odetail[3]; //获得货主编号 string order_type_string = odetail[58]; double base_fee = Convert.ToDouble(odetail[62]); Literal1.Text = base_fee.ToString(); order o = new order(); o.OrderAddCredit(base_fee.ToString(), "9", orderid, "0", "1");//预存保证金 AllinOrder1.SetOrderDetail("2", "2", "3", orderid, ""); //设置状态,传递短消息 AllinOrder1.SetAliPayReturn(orderid, "1"); } Literal2.Text = "支付宝信息:成功"; //Response.Write(Request.QueryString["amount"]); //返回给支付宝消息,成功 //Response.Write("success"); //Response.Write("<br>------------------" + Request.QueryString["subject"] + "--------------冻结成功,订单号为:"); //Response.Write(Request.QueryString["out_order_no"]); //返回给支付宝消息,成功 } else { Literal2.Text = "支付宝信息:失败"; //Response.Write("fail"); //Response.Write("<br>------------------" + Request.QueryString["subject"]); } writeLog("程序结束", DateTime.Now.ToString()); }
//public ActionResult ShoppingCartEnd() //{ // statusLogin(); // return View(); //} //[HttpPost] public ActionResult ShoppingCartEnd(int deliveryMethodID, int totalCost) { statusLogin(); string userName = Convert.ToString(Session["Username"]); //userName = "******"; string momery_Cart = Convert.ToString(Session["memoryCart"]); string[] momery_Cart_Array; momery_Cart_Array = momery_Cart.Split(';'); //[2][3][5][7][8] int memory_Cart_Size = momery_Cart_Array.Length; order order = new order(); using (OnlineShoppingDataClassesDataContext OnlineShoppingDB = new OnlineShoppingDataClassesDataContext()) { order = new order() { username = userName, orderstatusID = 2, deliverymethodID = deliveryMethodID, date = DateTime.Now, total = totalCost }; OnlineShoppingDB.orders.InsertOnSubmit(order); OnlineShoppingDB.SubmitChanges(); var orderID = (from o in OnlineShoppingDB.orders where o.username == userName orderby o.orderID descending select o.orderID).FirstOrDefault(); for (int j = 0; j < memory_Cart_Size; j++) { int counterSameTime = 0; for (int k = 0; k < memory_Cart_Size; k++) // count Same item { if (momery_Cart_Array[j] == momery_Cart_Array[k]) { counterSameTime++; } } bool repeatItem = false; for (int p = 0; p < j; p++) // find print already { if (momery_Cart_Array[j] == momery_Cart_Array[p]) { repeatItem = true; break; } } if (!repeatItem) { int currentItemID = Convert.ToInt16(momery_Cart_Array[j]); Item currentItem = AdminController.SelectByID_Item(currentItemID); itemorder itemOrder = new itemorder() { orderID = orderID, itemID = currentItemID, price = currentItem.SellingPrice, amount = counterSameTime, cost = currentItem.Cost }; OnlineShoppingDB.itemorders.InsertOnSubmit(itemOrder); OnlineShoppingDB.SubmitChanges(); } } order = new order(); order.orderID = orderID; } return View("ShoppingCartEnd", order); }
/// <summary> /// Create a new order object. /// </summary> /// <param name="id">Initial value of Id.</param> /// <param name="order_Date">Initial value of Order_Date.</param> public static order Createorder(int id, global::System.DateTime order_Date) { order order = new order(); order.Id = id; order.Order_Date = order_Date; return order; }
public string PostJsonOrderRedBubble(order o) { ServicePointManager.DefaultConnectionLimit = 6; var oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); dynamic itemClassName = AddClassName(o); string sJSON = oSerializer.Serialize(itemClassName); string wRespStatusCode = string.Empty; var baseAddress = "https://www.redbubble.com/orders/status_update"; var http = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress)); http.Accept = "application/json"; http.ContentType = "application/json"; http.Method = "POST"; http.Headers.Add("Redbubble-Auth-Token", "YourSecretCode"); http.Timeout = 30000; http.KeepAlive = false; ASCIIEncoding encoding = new ASCIIEncoding(); Byte[] bytes = encoding.GetBytes(sJSON); Stream newStream = http.GetRequestStream(); newStream.Write(bytes, 0, bytes.Length); newStream.Close(); HttpWebResponse response = null; try { response = (HttpWebResponse)http.GetResponse(); } catch (WebException we) { wRespStatusCode = ((HttpWebResponse)we.Response).StatusCode.ToString(); } catch (Exception ex) { wRespStatusCode = ex.Message.ToString(); } if (wRespStatusCode == "") { wRespStatusCode = response.StatusCode.ToString(); } try { response.Close(); newStream.Dispose(); response.Dispose(); bytes = null; } catch { } return wRespStatusCode; }
internal List<order> getOrdersByMonth_RP(int month, int year) { List<order> listToReturn = new List<order>(); try { cn.Open(); SqlCommand cmd = new SqlCommand("sp_Get_coffeeID_and_quantity_by_month_OrderTable_ReDone", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@month", SqlDbType.Int)).Value = month; cmd.Parameters.Add(new SqlParameter("@year", SqlDbType.Int)).Value = year; cmd.CommandTimeout = TIMEOUT; using(SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { order aRecord = new order(); aRecord.coffeeID = (int)reader["CoffeeID"]; aRecord.quantity = (int)reader["Quantity"]; listToReturn.Add(aRecord); } } } finally { cn.Close(); } return listToReturn; }
internal List<order> getOrdersByMonthForUser_RP(int month, int year, string UserName) { List<order> listToReturn = new List<order>(); try { cn.Open(); SqlCommand cmd = new SqlCommand("sp_Get_order_details_by_month_and_user_Ordertable_ReDone", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@month", SqlDbType.Int)).Value = month; cmd.Parameters.Add(new SqlParameter("@year", SqlDbType.Int)).Value = year; cmd.Parameters.Add(new SqlParameter("@userName", SqlDbType.NVarChar)).Value = UserName; cmd.CommandTimeout = TIMEOUT; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { order aRecord = new order(); aRecord.coffeeID = (int)reader["CoffeeID"]; aRecord.quantity = (int)reader["Quantity"]; aRecord.total = (decimal)reader["Total"]; aRecord.orderPaid = (bool)reader["OrderPaid"]; aRecord.orderReceived = (bool)reader["OrderReceived"]; listToReturn.Add(aRecord); } } } finally { cn.Close(); } return listToReturn; }
public void SetPay(string baozhengjin,string orderid) { order o = new order(); string ali_account = o.OrderGetAliAccount(); System.DateTime currentTime = new System.DateTime(); currentTime = System.DateTime.Now; string out_order_no = ""; out_order_no = orderid + "_AA"; //out_trade_no 外部商家订单号 string out_trade_no = ""; out_trade_no = orderid + "_BB"; //业务参数赋值; string gateway = "https://www.alipay.com/cooperate/gateway.do?"; //'支付接口 string service = "unfreeze2fastpay"; string partner = "2088201885472720"; //partner 合作伙伴ID 保留字段 string sign_type = "MD5"; string key = "o272s6dqq0s60tm44sy314jvnsfeihd0"; //partner账户的支付宝安全校验码 string out_order_dt = "2008-01-17 21:46:00"; //外部系统订单生成时间 string buyer_nick = ali_account; //买家昵称 string seller_nick = "*****@*****.**"; //卖家昵称 string order_from = "100002"; //(6) 订单的来源地(电子客票使用,淘宝=100001) Y string old_out_order_no = orderid; //(64) 外部系统的冻结资金时的订单号 string goods_detail = "PREPAY"; //(400) 购买商品详情(不同于商品名称) Y string totle_fee = baozhengjin; // 交易总金额 (0.01-100000000.00元) N string price = baozhengjin; // 商品价格(0.01-100000000.00元) N string other_fee = "0"; // 其他费用(0.00-100000000.00元) N string op_type = "0006"; //(50) 见业务类型表 N string _input_charset = "utf-8"; string aliay_url = CreatUrl2( gateway, service, partner, sign_type, out_order_no, out_trade_no, seller_nick, buyer_nick, _input_charset, out_order_dt, op_type, totle_fee, price, other_fee, old_out_order_no, order_from, goods_detail, key ); // sign_type = "MD5" ' 见签名方式N //aliay_url = aliay_url.Replace("订舱保证金", "%e8%ae%a2%e8%88%b1%e4%bf%9d%e8%af%81%e9%87%91").Replace("返还订舱保证金", "%e8%bf%94%e8%bf%98%e8%ae%a2%e8%88%b1%e4%bf%9d%e8%af%81%e9%87%91"); aliay_url = aliay_url.Replace("预存费用", "%e9%a2%84%e5%ad%98%e8%b4%b9%e7%94%a8"); XmlTextReader textReader = null; try { textReader = new XmlTextReader(aliay_url); textReader.Read(); textReader.WhitespaceHandling = WhitespaceHandling.None; baozhengjin = baozhengjin.ToString(); //实际订舱费比支付宝放大10w倍,正式版去掉 o.OrderAddCredit(baozhengjin, "1", orderid, "0", "1");//预存保证金 data_conn cn = new data_conn(); string sql = "UPDATE TB_ORDER_ALIPREPAY SET alipay_pay_return = 1 WHERE order_code = '" + orderid + "'"; //更新存根状态 cn.mdb_exe(sql); ScriptManager.RegisterStartupScript(this, this.GetType(), "提示", "alert(\"支付宝到账成功!\");", true); //Response.Write("成功"); //while (textReader.Read()) //{ // Response.Write("<br>Type=" + textReader.NodeType + "<br>Name=" + textReader.Name + "<br>Value=" + textReader.Value + "<br>LocalName=" + textReader.LocalName + "<br>XmlLang=" + textReader.XmlLang); // 自己定义输出格式 //} } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "提示", "alert(\"支付宝到账失败!\");", true); } finally { if (textReader != null) { textReader.Close(); } } //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "提示", "window.open('" + aliay_url + "' ,'_blank','');", true); }
// Update is called once per frame void Update() { if (sava_queue [summonToken].Count > 0 && !creating) { creating = true; slip = sava_queue [summonToken].Dequeue (); Invoke ("make", slip.summonTime); summonToken = summonToken > 4 ? 0 : summonToken + 1; } /* barrierOb.text = barrier.ToString (); HPBar.sizeDelta = new Vector2 (HP * HPUnit, HPBar.sizeDelta.y); if (canRecover && barrier < maxBarrier) { recF++; if (recF % 50 == 0) { recF = 0; barrier++; } } else if (barrier > maxBarrier) { recF++; if (recF % 20 == 0) { recF = 0; barrier--; } } */ // GetComponent<UnityEngine.UI.Image>().enabled=true; }
private dynamic AddClassName(order item) { //used if you want the class name in your JSION serialized return new { order = item }; }
/// <summary> /// There are no comments for order in the schema. /// </summary> public void AddToorder(order order) { base.AddObject("order", order); }
protected void Page_Load(object sender, EventArgs e) { //SetPay("0.01", "PRE10022211226701", "*****@*****.**"); //Response.Write(Server.UrlEncode("预存费用")); string base_fee = "4000"; order o = new order(); o.OrderAddCredit(base_fee, "9", "FCL10022216305647", "0", "1");//预存保证金 o.OrderAddCredit((0 - Convert.ToDouble(base_fee)).ToString(), "4", "FCL10022216305647", "8299", "0");//预存保证金 }