コード例 #1
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();
        }
コード例 #2
0
ファイル: logtics.aspx.cs プロジェクト: fubendong/--CTCRM
        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);
        }
コード例 #3
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);
        }
コード例 #4
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>");
        }
コード例 #5
0
ファイル: logtics.aspx.cs プロジェクト: fubendong/--CTCRM
        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();
        }