예제 #1
0
 public int Editmjldrefundlog(Api_mjld_RefundByOrderID mrefund)
 {
     using (var helper = new SqlHelper())
     {
         int r = new Internalapi_mjld_RefundByOrderID(helper).Editmjldrefundlog(mrefund);
         return(r);
     }
 }
        internal int Editmjldrefundlog(Api_mjld_RefundByOrderID m)
        {
            if (m.id > 0)
            {
                return(0);
            }
            else
            {
                string sql = @"INSERT  [api_mjld_RefundByOrderID]
                                   ([timeStamp]
                                   ,[user]
                                   ,[password]
                                   ,[RefundPart]
                                   ,[mjldorderId]
                                   ,[rtimeStamp]
                                   ,[status]
                                   ,[scredenceno]
                                   ,[fcredenceno]
                                   ,[backCount]
                                   ,[orderid])
                             VALUES
                                   (@timeStamp 
                                   ,@user 
                                   ,@password 
                                   ,@RefundPart 
                                   ,@mjldorderId 
                                   ,@rtimeStamp 
                                   ,@status 
                                   ,@scredenceno 
                                   ,@fcredenceno 
                                   ,@backCount 
                                   ,@orderid);select @@identity;";
                var    cmd = sqlHelper.PrepareTextSqlCommand(sql);
                cmd.AddParam("@timeStamp", m.timeStamp);
                cmd.AddParam("@user", m.user);
                cmd.AddParam("@password", m.password);
                cmd.AddParam("@RefundPart", m.RefundPart);
                cmd.AddParam("@mjldorderId", m.mjldorderId);
                cmd.AddParam("@rtimeStamp", m.rtimeStamp);
                cmd.AddParam("@status", m.status);
                cmd.AddParam("@scredenceno", m.scredenceno);
                cmd.AddParam("@fcredenceno", m.fcredenceno);
                cmd.AddParam("@backCount", m.backCount);
                cmd.AddParam("@orderid", m.orderid);

                object o = cmd.ExecuteScalar();
                return(int.Parse(o.ToString()));
            }
        }
예제 #3
0
        public string RefundByOrderID(ApiService mapiservice, Api_mjld_RefundByOrderID mrefund)
        {
            string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                         "<Body>" +
                         "<timeStamp>" + CommonFunc.ConvertDateTimeInt(DateTime.Now).ToString() + "</timeStamp>" +
                         "<user>" + mrefund.user + "</user>" +
                         "<password>" + mrefund.password + "</password>" +
                         "<RefundPart>" + mrefund.RefundPart + "</RefundPart>" +      //true:允许部分退票,false:不允许部分退票
                         "<outBackId>" + mrefund.orderid + "</outBackId>" +
                         "<orderid>" + mrefund.mjldorderId + "</orderid>" +
                         "</Body>";

            string data     = HttpUtility.UrlEncode(Mjld_TCodeServiceCrypt.Encrypt3DESToBase64(xml, mapiservice.Deskey));
            string postData = string.Format("businessid={1}&content={0}", data, mapiservice.Organization);

            string str = POST(interurl + "RefundByOrderID", postData);

            string bstr = "";

            try
            {
                bstr = Mjld_TCodeServiceCrypt.Decrypt3DESFromBase64(str, mapiservice.Deskey);
            }
            catch
            {
                bstr = "";
            }

            //录入交互日志
            ApiLog mapilog = new ApiLog
            {
                Id            = 0,
                request_type  = "RefundByOrderID",
                Serviceid     = 3,
                Str           = xml.Trim(),
                Subdate       = DateTime.Now,
                ReturnStr     = bstr,
                ReturnSubdate = DateTime.Now,
                Errmsg        = "",
            };
            int ins = new ApiLogData().EditLog(mapilog);

            return(bstr);
        }