Пример #1
0
        public dynamic GetTrade()
        {
            int         tradeId = Fun.Query("id", 0);
            TradeBLL    bll     = new TradeBLL();
            C_TradeInfo t       = bll.GetTrade(tradeId);
            TradeInfo   trade   = new TradeInfo();

            trade.id             = t.trade_id;
            trade.info           = t.receiving_info;
            trade.money          = t.trade_money;
            trade.num            = t.trade_num;
            trade.time           = t.trade_time;
            trade.discountMoney  = t.discount_money;
            trade.discountWay    = t.discount_way;
            trade.status         = t.trade_status;
            trade.statusDescript = t.trade_status == 0 ? "未审核" : "审核通过";
            trade.type           = t.trade_type;
            trade.typeDescript   = t.trade_type == 0 ? "等待支付" : t.trade_type == 1 ? "已支付" : "已取消";
            trade.productId      = t.trade_product;
            trade.productName    = new ProductBLL().GetProduct(t.trade_product).product_name.Trim();
            trade.customerId     = t.trade_customer;
            trade.customerName   = new CustomerBLL().GetCustomer(t.trade_customer).cu_name.Trim();
            trade.payment        = t.payment_type;
            trade.paymentType    = new PaymentBLL().GetPayment(t.payment_type).payment_name.Trim();
            return(trade);
        }
Пример #2
0
 protected void btn_Addgoods_Click(object sender, EventArgs e)
 {
     if (Session["Mid"] == null)
     {
         Response.Redirect("Login.aspx?url=" + Request.RawUrl);
     }
     else
     {
         int Bid        = Convert.ToInt32(Request.QueryString["bid"]);
         int usercount  = Convert.ToInt32(txtCount.Text);
         int checkcount = TradeBLL.CheckBcount(Bid);
         if (checkcount >= usercount)
         {
             int Mid   = Convert.ToInt32(Session["Mid"]);
             int count = Convert.ToInt32(txtCount.Text);
             int c     = goodsBLL.AddGood(Bid, Mid, count);
             if (c > 0)
             {
                 Response.Redirect("Flow.aspx");
             }
             else
             {
                 Response.Write("<script>alert('网络繁忙,请稍后')</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('对不起,库存不足')</script>");
         }
     }
 }
        public TradeController(IConfiguration iConfig)
        {
            this.configuration = iConfig;
            string table_name = this.configuration.GetValue <string>("TradeTableName");

            this.bLL = new TradeBLL(table_name);
        }
Пример #4
0
        public dynamic GetTradeList()
        {
            string           type = Fun.Query("type");
            TradeBLL         bll  = new TradeBLL();
            List <TradeInfo> list = bll.GetTradeList(type);

            return(list);
        }
Пример #5
0
        private void ShowGood()
        {
            int           id = Convert.ToInt32(Session["Mid"]);
            SqlDataReader dr = TradeBLL.SelectTrade(id);

            this.repbuygood.DataSource = dr;
            this.repbuygood.DataBind();
        }
Пример #6
0
        public dynamic GetCustomerTradeList()
        {
            int              customerId = Fun.Query("customerId", 0);
            TradeBLL         bll        = new TradeBLL();
            List <TradeInfo> list       = bll.GetCustomerTradeList(customerId);

            return(list);
        }
Пример #7
0
        private void Showbuybook()
        {
            int           Mid = Convert.ToInt32(Session["Mid"]);
            SqlDataReader dr  = TradeBLL.SelectTrade(Mid);

            this.repgoods.DataSource = dr;
            this.repgoods.DataBind();
            dr.Close();
        }
Пример #8
0
        public dynamic GetTradeSearchList()
        {
            string           type      = Fun.Query("type");
            string           search    = Fun.Query("search");
            string           startTime = Fun.Query("startTime");
            string           endTime   = Fun.Query("endTime");
            TradeBLL         bll       = new TradeBLL();
            List <TradeInfo> list      = bll.GetTradeSearchList(search, startTime, endTime, type);

            return(list);
        }
Пример #9
0
        public dynamic GetCustomerTradeSearchList()
        {
            int              customerId  = Fun.Query("customerId", 0);
            string           productName = Fun.Query("productName");
            string           startTime   = Fun.Query("startTime");
            string           endTime     = Fun.Query("endTime");
            TradeBLL         bll         = new TradeBLL();
            List <TradeInfo> list        = bll.GetCustomerTradeSearchList(customerId, productName, startTime, endTime);

            return(list);
        }
Пример #10
0
        protected void BindData()
        {
            DataTable  dt   = new DataTable();
            DataColumn dc   = null;
            string     nick = Users.Nick;

            dc = dt.Columns.Add("reciverName", Type.GetType("System.String"));
            dc = dt.Columns.Add("cellPhone", Type.GetType("System.String"));
            if (string.IsNullOrEmpty(nick) == true)
            {
                return;
            }
            DataTable trade  = null;
            string    select = drpSType.SelectedValue.ToString();

            switch (select)
            {
            case "sign_notSure":
                trade = TradeBLL.GetTradeData(nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSign":
                trade = TradeBLL.GetTradeDataNosign(nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSucce":
                trade = TradeBLL.GetTradeDataNoSuccess(nick, "taobao_trade_TradeSellerShip");
                break;
            }
            Trade tradeInfo = null;

            if (trade != null && trade.Rows.Count > 0)
            {
                string key = SellersBLL.GetSellerSessionKey(nick);
                foreach (DataRow row in trade.Rows)//轮训订单
                {
                    //获取订单id
                    string tid = row["tid"].ToString();
                    //调用淘宝接口获取订单详细交易信息
                    tradeInfo = TBTrade.GetTradeContact(Convert.ToInt64(tid), key);
                    string  cellPhone   = tradeInfo == null ? "" : tradeInfo.ReceiverMobile;
                    string  reciverName = tradeInfo == null ? "" : tradeInfo.ReceiverName;
                    DataRow drow        = dt.NewRow();
                    drow["reciverName"] = reciverName;
                    drow["cellPhone"]   = cellPhone;
                    dt.Rows.Add(drow);
                }
            }
            tb_member           = dt;
            grdBuyer.DataSource = trade;
            grdBuyer.DataBind();
        }
Пример #11
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            string nick = TextBox4.Text.Trim();

            if (string.IsNullOrEmpty(nick))
            {
                Response.Write("<script language='javascript'>alert('填写卖家名称!');</script>");
                return;
            }
            string startDate = txt_StartTime.Value;
            string endDate   = txt_EndTime.Value;
            string startPay  = TextBox2.Text.Trim();
            string endDPay   = TextBox3.Text.Trim();

            try
            {
                if (!string.IsNullOrEmpty(startPay))
                {
                    Convert.ToInt32(startPay);
                }
                if (!string.IsNullOrEmpty(endDPay))
                {
                    Convert.ToInt32(endDPay);
                }
            }
            catch (Exception ee)
            {
                Response.Write("<script language='javascript'>alert('输入正确格式的金额!');</script>");
                return;
            }
            DataTable trade  = null;
            string    select = drpSType.SelectedValue.ToString();

            switch (select)
            {
            case "sign_notSure":
                trade = TradeBLL.GetTradeData(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSign":
                trade = TradeBLL.GetTradeDataNosign(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSucce":
                trade = TradeBLL.GetTradeDataNoSuccess(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;
            }
            DownloadToExcel(trade);
        }
Пример #12
0
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            LinkButton b  = (sender as LinkButton);
            int        id = Convert.ToInt32(b.CommandArgument);
            int        c  = TradeBLL.DeleteGoods(id);

            if (c > 0)
            {
                ShowGood();
            }
            else
            {
                Response.Write("<script>alert('网络繁忙,请稍后');location.href=('Flow.aspx')</script>");
            }
        }
Пример #13
0
        private void SumPrice()
        {
            int           Mid = Convert.ToInt32(Session["Mid"]);
            SqlDataReader dr  = TradeBLL.SelectTrade(Mid);
            double        sum = 0;

            while (dr.Read())
            {
                sum += Convert.ToDouble(dr["BCount"]) * Convert.ToDouble(dr["BPrice"]);
            }
            txtSumPrice.Value        = sum.ToString();
            this.repgoods.DataSource = dr;
            this.repgoods.DataBind();
            dr.Close();
        }
 private void LoadFlow()
 {
     if (Session["MId"] == null)
     {
         LookFlow.Text        = "您的购物车中有 0 件商品,总计金额 ¥0.00元。";
         LookFlow.PostBackUrl = null;
     }
     else
     {
         SqlDataReader dr = TradeBLL.CheckTradeCount(Convert.ToInt32(Session["MID"]));
         while (dr.Read())
         {
             LookFlow.Text = "您的购物车中有 " + dr["size"].ToString() + " 件商品,总计金额 ¥" + dr["sumprice"].ToString() + "元。";
         }
     }
 }
Пример #15
0
        public dynamic UpdateTradeInfo()//支付成功执行该方法
        {
            int      id         = Fun.Form("id", 0);
            int      type       = Fun.Form("type", -1);
            int      customerId = Fun.Form("customerId", 0);
            int      productId  = Fun.Form("productId", 0);
            TradeBLL bll        = new TradeBLL();

            if (!bll.UpdateTrade(id, type))
            {
                return("失败");
            }
            else if (type == 1)
            {
                new CustomerBLL().AddCustomerProduct(customerId, productId, 1);
            }
            return("成功");
        }
Пример #16
0
        public JsonResult CreateTrade(TradeDTO trade)
        {
            var coin        = TradeCoinBLL.ListAll();
            var type        = OperationBLL.ListAll();
            var cookie_info = CookiesControll.UserAuthenticationInfo().Name;

            trade.Tipo   = type.Where(t => t.Id == trade.Tipo).FirstOrDefault().Tipo;
            trade.UserId = cookie_info;

            if (!string.IsNullOrEmpty(trade.MoedaCompra) && !string.IsNullOrWhiteSpace(trade.MoedaCompra))
            {
                trade.MoedaCompra = coin.Where(c => c.Id == trade.MoedaCompra).FirstOrDefault().Sigla;
            }

            if (!string.IsNullOrEmpty(trade.MoedaVenda) && !string.IsNullOrWhiteSpace(trade.MoedaVenda))
            {
                trade.MoedaVenda = coin.Where(c => c.Id == trade.MoedaVenda).FirstOrDefault().Sigla;
            }

            if (!string.IsNullOrEmpty(trade.MoedaTaxa) && !string.IsNullOrWhiteSpace(trade.MoedaTaxa))
            {
                trade.MoedaTaxa = coin.Where(c => c.Id == trade.MoedaTaxa).FirstOrDefault().Sigla;
            }

            bool inserts_ok = false;

            if (TradeBLL.RegisterUser(trade))
            {
                inserts_ok = true;

                HistoricDTO hist = new HistoricDTO
                {
                    Data      = DateTime.Now.Date,
                    UserId    = cookie_info,
                    Descricao = $"Adicionado uma nova {trade.Tipo}"
                };

                inserts_ok = HistoricBLL.RegisterHistoric(hist);
            }

            var url = Url.Action("Trocas", "Trocas");

            return(Json(new { insert = inserts_ok, url }, JsonRequestBehavior.AllowGet));
        }
Пример #17
0
        public dynamic AddTradeInfo()
        {
            int      customerId    = Fun.Form("customerId", 0);
            int      productId     = Fun.Form("productId", 0);
            int      num           = Fun.Form("num", 0);
            string   totalPrice    = Fun.Form("totalPrice");
            int      payType       = Fun.Form("payType", 0);
            string   discountWay   = Fun.Form("discountWay");
            string   discountMoney = Fun.Form("discountMoney");
            string   receivingInfo = Fun.Form("receivingInfo");
            TradeBLL bll           = new TradeBLL();

            if (!bll.AddTrade(totalPrice.ToDecimal(), customerId, productId, num, discountWay, discountMoney.ToDecimal(), payType, receivingInfo))
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
Пример #18
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            DataTable trade  = null;
            string    select = drpSType.SelectedValue.ToString();

            switch (select)
            {
            case "sign_notSure":
                trade = TradeBLL.GetTradeData(Users.Nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSign":
                trade = TradeBLL.GetTradeDataNosign(Users.Nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSucce":
                trade = TradeBLL.GetTradeDataNoSuccess(Users.Nick, "taobao_trade_TradeSellerShip");
                break;
            }
            DownloadToExcel(trade);
        }
Пример #19
0
        public JsonResult GetTrades(int value, bool increment)
        {
            bool            has  = false;
            List <TradeDTO> temp = new List <TradeDTO>();

            int init = (max_trade * value);

            init = value <= 0 ? 0 : init;
            int end = max_trade;

            temp = TradeBLL.ListAllByIdLimited(init, end, CookiesControll.UserAuthenticationInfo().Name);

            foreach (var item in temp)
            {
                item.ValorVenda  = FillWithZeros(item.ValorVenda);
                item.ValorCompra = FillWithZeros(item.ValorCompra);
                item.ValorTaxa   = FillWithZeros(item.ValorTaxa);
            }

            has = temp.Count > 0 ? true : false;

            return(Json(new { has, temp }, JsonRequestBehavior.AllowGet));
        }
Пример #20
0
        public JsonResult Remove(TradeDTO[] trade)
        {
            bool   deleted = false;
            string text    = "";

            if (TradeBLL.Remove(trade))
            {
                deleted = true;
                text    = trade.Length > 1 ? "Removidos" : "Removido";
                text   += $" {trade.Length} ";
                text   += trade.Length > 1 ? "transações" : "transação";

                HistoricDTO hist = new HistoricDTO
                {
                    Data      = DateTime.Now.Date,
                    UserId    = CookiesControll.UserAuthenticationInfo().Name,
                    Descricao = text
                };

                deleted = HistoricBLL.RegisterHistoric(hist);
            }

            return(Json(new { deleted, url = Url.Action("Trocas", "Trocas") }, JsonRequestBehavior.AllowGet));
        }
Пример #21
0
        public ActionResult Trocas()
        {
            var cookie = CookiesControll.UserAuthenticationInfo();

            if (cookie.UserData == "Client")
            {
                var list = TradeBLL.ListAllByIdLimited(0, max_trade, cookie.Name);

                foreach (var item in list)
                {
                    item.ValorVenda  = FillWithZeros(item.ValorVenda);
                    item.ValorCompra = FillWithZeros(item.ValorCompra);
                    item.ValorTaxa   = FillWithZeros(item.ValorTaxa);
                }

                ViewData["Trocas"]    = list;
                ViewData["Historico"] = HistoricBLL.ListAll(cookie.Name, 0, 7);
                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "Home", new { area = "" }));
            }
        }
Пример #22
0
        public static Dictionary <string, string> pay(WintopPayParam param, TradeRecord tradeRecord, string secondShopNo)
        {
            try
            {
                tradeRecord.shop_type  = "1";
                tradeRecord.order_type = "1";
                tradeRecord.order_no   = param.orderNo;

                tradeRecord.relation_order = "";
                tradeRecord.amount         = param.price;

                Dictionary <string, string> map = new Dictionary <string, string>();

                Dictionary <int, string> data = new Dictionary <int, string>();
                data.Add(2, param.wintopNo);                       //万通卡号
                data.Add(3, "000000");
                data.Add(4, wtPayUtils.ConvertMoney(param.price)); //交易金额
                data.Add(11, param.orderNo);                       //POS终端交易流水
                map.Add("11", data[11]);


                data.Add(25, "00");
                data.Add(41, SysConfigHelper.readerNode("ClientNo"));//终端代码
                map.Add("41", data[41]);
                tradeRecord.termail_no = data[41];

                data.Add(42, SysConfigHelper.readerNode("ShopNo")); //商户代码
                data.Add(48, "TC_ONE|Y00000001|" + secondShopNo);   //data.Add(48, "TC_ONE|Y00000001|"+secondShopNo);
                //data.Add(48, "Y00000001");
                data.Add(49, "156");
                data.Add(62, param.ExpressPwd);//明文,卡号
                data.Add(63, "01");

                byte[] countMacData = EncryptWT.countMacData("0200", EncryptWT.encryptLKL(data, null));

                byte[] mac = PasswordBLL.GetMac(2, countMacData);

                byte[] sendData = EncryptWT.EncryptData("0200", "6000000000", EncryptWT.encryptLKL(data, mac));

                //发送的数据
                string sendStr = BCDUtil.byteArrToString(sendData);
                log.Write("发送支付的数据:" + sendStr);

                //Console.WriteLine();
                //Console.WriteLine(BCDUtil.byteArrToString(sendData));
                AnalysisBaseWT lk     = new AnalysisBaseWT();
                byte[]         result = Client(LakalaIp, LakalaPort, sendData);

                //接收的数据
                string receiveStr = BCDUtil.byteArrToString(result);
                log.Write("接收支付的数据:" + receiveStr);

                Dictionary <string, ResultData> ret = lk.analysis(result);
                string recode = Wanton.handleDataMac(ret); //发送数据
                log.Write("支付返回码:" + recode);
                if ("00".Equals(recode))
                {
                    tradeRecord.lkl_wt_state = "1";
                    tradeRecord.batch_no     = ret["59"].value + "|" + SysBLL.getMMDDHHMMSSTime() + "|" + param.wintopNo;
                }
                else if ("A0".Equals(recode))
                {
                    DeviceState.SendState("333333");
                }
                else
                {
                    tradeRecord.lkl_wt_state = "2";
                }
                map.Add("recode", recode);
                map.Add("sendStr", sendStr);
                map.Add("receiveStr", receiveStr);
                map.Add("ShopNo", param.orderNo + "|" + data[41] + "|" + data[42]);
                map.Add("money", param.price);

                if (ret.ContainsKey("2"))
                {
                    map.Add("2", ret["2"].value);
                }

                map.Add("4", param.price);

                if (ret.ContainsKey("59"))
                {
                    map.Add("59", ret["59"].value);
                    map.Add("cloudOrderNo", ret["59"].value);
                }

                string serialStr = JsonConvert.SerializeObject(map);
                tradeRecord.data_id = serialStr;

                TradeBLL.SendOrderPayRecord(tradeRecord);



                return(map);
            }
            catch (WtException e)
            {
                throw e;
            }

            catch (Exception e)
            {
                throw new WtException(WtExceptionCode.Bus.WT_PAY, e.Message);
            }
        }
Пример #23
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox2.Text))
            {
                Response.Write("<script language='javascript'>alert('请输入发送内容!');</script>");
                return;
            }

            DataTable trade   = null;
            string    sigName = "【" + SellersBLL.GetSignName(Users.Nick) + "】";
            string    select  = drpSType.SelectedValue.ToString();

            switch (select)
            {
            case "sign_notSure":
                trade = TradeBLL.GetTradeData(Users.Nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSign":
                trade = TradeBLL.GetTradeDataNosign(Users.Nick, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSucce":
                trade = TradeBLL.GetTradeDataNoSuccess(Users.Nick, "taobao_trade_TradeSellerShip");
                break;
            }
            if (trade == null || trade.Rows.Count == 0)
            {
                Response.Write("<script language='javascript'>alert('无数据!');</script>");
                return;
            }
            for (int i = 0; i < trade.Rows.Count; i++)
            {
                DataTable ds = BuyerBLL.GetBuyerInfo(trade.Rows[i]["buyer_nick"].ToString(), "all", "all", "all", "", "", "", Users.Nick, "");
                if (ds == null || ds.Rows.Count == 0)
                {
                    continue;
                }
                string cellPhone = ds.Rows[i]["CellPhone"].ToString();

                try
                {
                    //判断手机
                    if (Utility.IsCellPhone(cellPhone))
                    {
                        if (MsgBLL.CheckSellerMsgStatus())
                        {
                            MsgSendHis objHis = new MsgSendHis();
                            objHis.TransNumber = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + cellPhone;//手机号码 2016 yao c
                            objHis.SellerNick  = Users.Nick;
                            //objHis.SellerNick = "澄腾科技";
                            objHis.Buyer_nick = "*****";
                            objHis.CellPhone  = cellPhone;
                            objHis.SendDate   = DateTime.Now;
                            objHis.SendType   = "手工发送";
                            objHis.SendStatus = "0";
                            objHis.Count      = "1";
                            //objHis.MsgContent = "【" + SellersBLL.GetSignName(Users.Nick) + "】" + txtContent.Text.Trim();// +"退订回T";
                            objHis.MsgContent = sigName + TextBox2.Text + " 退订回N";
                            if (!Utility.IsYiDongCellPhoneNo(cellPhone))
                            {
                                objHis.HelpSellerNick = "电信联通";
                            }
                            else
                            {
                                objHis.HelpSellerNick = "移动";
                            }
                            //if (true) test
                            if (SmartBLL.AddMsgSendHis(objHis))
                            {
                                try
                                {
                                    objHis.MsgContent = objHis.MsgContent.Replace(" ", "");
                                    if (objHis.MsgContent.Length <= 70)
                                    {
                                        MsgBLL.UpdateMsgTransUseCount(Users.Nick, 1);
                                    }
                                    else if (objHis.MsgContent.Length > 70 && objHis.MsgContent.Length <= 134)
                                    {
                                        MsgBLL.UpdateMsgTransUseCount(Users.Nick, 2);
                                    }
                                    else if (objHis.MsgContent.Length > 134 && objHis.MsgContent.Length <= 195)
                                    {
                                        MsgBLL.UpdateMsgTransUseCount(Users.Nick, 3);
                                    }
                                    else if (objHis.MsgContent.Length > 195 && objHis.MsgContent.Length <= 260)
                                    {
                                        MsgBLL.UpdateMsgTransUseCount(Users.Nick, 4);
                                    }


                                    if (!Utility.IsYiDongCellPhoneNo(cellPhone))
                                    {
                                        //string sendStatus = Mobile.SendMsgKeTongDX(cellPhone, objHis.MsgContent);

                                        string      sendStatus = Mobile.PostDataToMyServer(cellPhone, objHis.MsgContent.Trim());//20160626 yao c
                                        IDictionary resultDic  = TopUtils.ParseJson(sendStatus);
                                        SmartBLL.UpdateSendStatus(resultDic["status"].ToString(), objHis.TransNumber);
                                    }
                                    else
                                    {
                                        string sendStatus = Mobile.SendMsgHubeiYDPost(cellPhone, objHis.MsgContent);//\r\n\r\n\r\n\r\n0
                                        sendStatus = sendStatus.Replace("\r", "").Replace("\n", "");
                                        if (sendStatus.Equals("0"))
                                        {
                                            sendStatus = "100";
                                        }
                                        SmartBLL.UpdateSendStatus(sendStatus, objHis.TransNumber);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            Response.Write("<script language='javascript'>alert('余额不足!');</script>");
                            return;
                        }
                    }
                }
                catch (Exception ex)
                {
                    continue;
                }
            }
            Response.Write("<script language='javascript'>alert('发送成功!');</script>");
        }
Пример #24
0
        public static Dictionary <string, string> refund(string _2, string _4, string _59, TradeRecord tradeRecord, string secondShopNo)
        {
            string theOrderNo = Wanton.GetOrderNo();
            string termailNo  = SysConfigHelper.readerNode("ClientNo");
            string shopNo     = SysConfigHelper.readerNode("ShopNo");

            tradeRecord.amount         = _4;
            tradeRecord.batch_no       = "" + "|" + SysBLL.getMMDDHHMMSSTime() + "|" + _2;
            tradeRecord.order_no       = theOrderNo;
            tradeRecord.termail_no     = termailNo;
            tradeRecord.lkl_wt_shop_no = shopNo;
            Dictionary <string, string> map = new Dictionary <string, string>();

            Dictionary <int, string> data = new Dictionary <int, string>();

            data.Add(2, _2);
            data.Add(3, "200000");
            data.Add(4, wtPayUtils.ConvertMoney(_4));
            data.Add(11, theOrderNo);
            map.Add("11", data[11]);

            data.Add(22, "051");
            data.Add(25, "00");
            data.Add(41, termailNo);
            map.Add("41", data[41]);

            data.Add(42, shopNo);
            data.Add(48, "TC_ONE|Y00000001|" + secondShopNo);
            //data.Add(48, "Y00000001");
            data.Add(49, "156");
            data.Add(59, _59);
            data.Add(60, "22000003000");
            data.Add(63, "01");

            byte[] countMacData = EncryptWT.countMacData("0200", EncryptWT.encryptLKL(data, null));

            byte[] mac = PasswordBLL.GetMac(2, countMacData);

            byte[] sendData = EncryptWT.EncryptData("0200", "6000000000", EncryptWT.encryptLKL(data, mac));


            //byte[] sendData = EncryptWT.EncryptData("0200", "6000000000", EncryptWT.encryptLKL(data, calculateMac(data, "0200")));
            Console.WriteLine();
            Console.WriteLine(BCDUtil.byteArrToString(sendData));
            AnalysisBaseWT lk = new AnalysisBaseWT();

            byte[] result = Client(LakalaIp, LakalaPort, sendData);

            //接收的数据
            string receiveStr1 = BCDUtil.byteArrToString(result);

            log.Write("tuikuan的数据:" + receiveStr1);

            Dictionary <string, ResultData> ret = lk.analysis(result);


            string recode = Wanton.handleDataMac(ret); //发送数据

            if ("00".Equals(recode))
            {
                tradeRecord.lkl_wt_state = "1";
                tradeRecord.order_state  = "1";
            }
            else
            {
                tradeRecord.lkl_wt_state = "2";
                tradeRecord.order_state  = "0";
            }
            //发送的数据
            string sendStr = BCDUtil.byteArrToString(sendData);
            //接收的数据
            string receiveStr = BCDUtil.byteArrToString(result);

            map.Add("recode", recode);
            map.Add("sendStr", sendStr);
            map.Add("receiveStr", receiveStr);
            map.Add("ShopNo", data[11] + "|" + data[41] + "|" + data[42]);

            map.Add("39", ret["39"].value);

            log.Write("万通卡退款交易返回" + ret["39"].value);


            string serialStr = JsonConvert.SerializeObject(map);

            tradeRecord.data_id = serialStr;
            TradeBLL.SendOrderRefundRecord(tradeRecord);

            return(map);


            //if (result.Length > 0)
            //{
            //    return lk.analysis(result); //发送数据
            //}
            //else
            //{
            //    return null;
            //}
        }
Пример #25
0
        //public static string getOrder()
        //{
        //    int num = Convert.ToInt32(SysConfigHelper.readerNode("orderNo"));
        //    num++;
        //    SysBLL.SetAppConfig("orderNo", num.ToString());
        //    return num.ToString();

        //}

        /// <summary>
        /// 冲正
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, string> correct(WintopPayParam param, TradeRecord tradeRecord, string secondShopNo)
        {
            try
            {
                tradeRecord.order_type = "2";
                string termailNo = SysConfigHelper.readerNode("ClientNo");
                tradeRecord.amount     = param.price;
                tradeRecord.batch_no   = "";
                tradeRecord.order_no   = param.orderNo;
                tradeRecord.termail_no = termailNo;

                tradeRecord.lkl_wt_state = "0";

                tradeRecord.shop_type = "1";


                Dictionary <string, string> map = new Dictionary <string, string>();

                Dictionary <int, string> data = new Dictionary <int, string>();
                data.Add(2, param.wintopNo);
                data.Add(3, "000000");
                data.Add(4, wtPayUtils.ConvertMoney(param.price));
                data.Add(11, param.orderNo);
                map.Add("11", data[11]);


                data.Add(25, "00");
                data.Add(39, "17");
                data.Add(41, termailNo);
                map.Add("41", data[41]);

                tradeRecord.termail_no = data[41];

                data.Add(42, SysConfigHelper.readerNode("ShopNo"));

                data.Add(48, "TC_ONE|Y00000001|" + secondShopNo);
                //data.Add(48, "Y00000001");
                data.Add(49, "156");
                data.Add(63, "01");

                byte[] countMacData = EncryptWT.countMacData("0400", EncryptWT.encryptLKL(data, null));

                byte[] mac = PasswordBLL.GetMac(2, countMacData);

                byte[] sendData = EncryptWT.EncryptData("0400", "6000000000", EncryptWT.encryptLKL(data, mac));

                //发送的数据
                string sendStr = BCDUtil.byteArrToString(sendData);
                log.Write("发送冲正的数据:" + sendStr);

                //byte[] sendData = EncryptWT.EncryptData("0400", "6000000000", EncryptWT.encryptLKL(data, calculateMac(data, "0400")));
                Console.WriteLine(BCDUtil.byteArrToString(sendData));
                AnalysisBaseWT lk     = new AnalysisBaseWT();
                byte[]         result = Client(LakalaIp, LakalaPort, sendData);
                string         recode = Wanton.handleDataMac(lk.analysis(result)); //发送数据
                if ("00".Equals(recode))
                {
                    tradeRecord.lkl_wt_state = "1";
                }
                else
                {
                    tradeRecord.lkl_wt_state = "2";
                }


                //接收的数据
                string receiveStr = BCDUtil.byteArrToString(result);
                log.Write("接收冲正的数据:" + result);
                map.Add("recode", recode);
                map.Add("sendStr", sendStr);
                map.Add("receiveStr", receiveStr);
                map.Add("ShopNo", param.orderNo + "|" + data[41] + "|" + data[42]);
                map.Add("money", param.price);


                string serialStr = JsonConvert.SerializeObject(map);
                tradeRecord.data_id = serialStr;
                TradeBLL.SendOrderPayRecord(tradeRecord);
                return(map);
            }
            catch (Exception e)
            {
                return(new Dictionary <string, string>());
            }
        }
Пример #26
0
        protected void BindData()
        {
            DataTable  dt   = new DataTable();
            DataColumn dc   = null;
            string     nick = TextBox4.Text.Trim();

            string startDate = txt_StartTime.Value;
            string endDate   = txt_EndTime.Value;
            string startPay  = TextBox2.Text.Trim();
            string endDPay   = TextBox3.Text.Trim();

            try
            {
                if (!string.IsNullOrEmpty(startPay))
                {
                    Convert.ToInt32(startPay);
                }
                if (!string.IsNullOrEmpty(endDPay))
                {
                    Convert.ToInt32(endDPay);
                }
            }
            catch (Exception e)
            {
                Response.Write("<script language='javascript'>alert('输入正确格式的金额!');</script>");
                return;
            }

            dc = dt.Columns.Add("reciverName", Type.GetType("System.String"));
            dc = dt.Columns.Add("cellPhone", Type.GetType("System.String"));
            if (string.IsNullOrEmpty(nick) == true)
            {
                return;
            }
            DataTable trade  = null;
            string    select = drpSType.SelectedValue.ToString();

            switch (select)
            {
            case "sign_notSure":
                trade = TradeBLL.GetTradeData(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSign":
                trade = TradeBLL.GetTradeDataNosign(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;

            case "sure_notSucce":
                trade = TradeBLL.GetTradeDataNoSuccess(nick, startDate, endDate, startPay, endDPay, "taobao_trade_TradeSellerShip");
                break;
            }
            //Trade tradeInfo = null;
            //if (trade != null && trade.Rows.Count > 0)
            //{
            //    string key = SellersBLL.GetSellerSessionKey(nick);
            //    foreach (DataRow row in trade.Rows)//轮训订单
            //    {
            //        //获取订单id
            //        string tid = row["tid"].ToString();
            //        //调用淘宝接口获取订单详细交易信息
            //        tradeInfo = TOPCRM.TBTrade.GetTradeContact(Convert.ToInt64(tid), key);
            //        string cellPhone = tradeInfo == null ? "" : tradeInfo.ReceiverMobile;
            //        string reciverName = tradeInfo == null ? "" : tradeInfo.ReceiverName;
            //        DataRow drow = dt.NewRow();
            //        drow["reciverName"] = reciverName;
            //        drow["cellPhone"] = cellPhone;
            //        dt.Rows.Add(drow);

            //    }
            //}
            //tb_member = dt;
            grdBuyer.DataSource = trade;
            grdBuyer.DataBind();
        }