public int EditApi_yg_addorder_output(Api_yg_addorder_output mout) { using (var helper = new SqlHelper()) { int r = new Internalapi_yg_addorder_output(helper).EditApi_yg_addorder_output(mout); return(r); } }
public string repeat_order(ApiService mapiservice, Api_yg_addorder_output moutput) { string req_seq = mapiservice.Organization + DateTime.Now.ToString("yyyyMMddhhssmm") + CommonFunc.CreateNum(6);//请求流水号 StringBuilder buildOrder = new StringBuilder(); buildOrder.Append(@"<?xml version=""1.0"" encoding=""utf-8""?>"); buildOrder.Append(@"<business_trans version=""1.0"">"); buildOrder.Append("<request_type>repeat_order</request_type>"); //<!--重发--> buildOrder.AppendFormat("<organization>{0}</organization>", mapiservice.Organization); //<!--机构号--> buildOrder.AppendFormat("<password>{0}</password>", mapiservice.Password); //<!-- 接口使用密码 --> buildOrder.AppendFormat("<req_seq>{0}</req_seq>", req_seq); //<!--请求流水号--> buildOrder.Append("<order>"); buildOrder.AppendFormat("<order_num>{0}</order_num>", moutput.yg_ordernum); //<!-- 订单号 y--> buildOrder.Append("</order>"); buildOrder.Append("</business_trans>"); string bstr = ""; try { ITicketService its12 = new ITicketService(); string en = EncryptionHelper.DESEnCode(buildOrder.ToString(), mapiservice.Deskey); string retxmls = its12.getEleInterface(mapiservice.Organization, en); bstr = EncryptionHelper.DESDeCode(retxmls, mapiservice.Deskey); } catch (Exception e) { bstr = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<business_trans>" + "<response_type>repeat_order</response_type>" + "<req_seq>" + req_seq + "</req_seq>" + "<result>" + "<id></id>" + "<comment>" + e.Message + "</comment>" + " </result>" + "</business_trans>"; } //录入交互日志 ApiLog mapilog = new ApiLog { Id = 0, request_type = "repeat_order", Serviceid = 1, Str = buildOrder.ToString().Trim(), Subdate = DateTime.Now, ReturnStr = bstr, ReturnSubdate = DateTime.Now, Errmsg = "", }; int ins = new ApiLogData().EditLog(mapilog); return(bstr); }
internal Api_yg_addorder_output Getapi_yg_addorder_output(int sysorderid) { string sql = "select * from api_yg_addorder_output where orderid=" + sysorderid; var cmd = sqlHelper.PrepareTextSqlCommand(sql); using (var reader = cmd.ExecuteReader()) { Api_yg_addorder_output m = null; if (reader.Read()) { m = new Api_yg_addorder_output { id = reader.GetValue <int>("id"), yg_ordernum = reader.GetValue <string>("yg_ordernum"), code = reader.GetValue <string>("code"), orderId = reader.GetValue <int>("orderId"), req_seq = reader.GetValue <string>("req_seq"), resultcomment = reader.GetValue <string>("resultcomment"), resultid = reader.GetValue <string>("resultid"), }; } return(m); } }