Exemple #1
0
        protected void btnAuothOpen_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                DataRow orderDate = SellersBLL.GetSelerOrderDate(Users.Nick);
                if (orderDate != null)
                {
                    if (orderDate["OrderVersion"].Equals("体验版"))
                    {
                        Response.Redirect("http://crm.new9channel.com/version/versionTip.aspx");
                        return;
                    }

                    if (AppCusBLL.CheckAppCusIsExit(Users.Nick))
                    {
                        ITopClient           client = TBManager.GetClient();
                        TmcUserCancelRequest req    = new TmcUserCancelRequest();
                        req.Nick = Users.Nick;
                        TmcUserCancelResponse response = client.Execute(req);
                        if (response.IsSuccess)
                        {
                            AppCusBLL.DeleteSellerNifty(Users.Nick);
                            btnAuothOpen.ImageUrl = "~/Images/rate/closed.png";
                        }
                        else
                        {
                            lberror.Text = response.ErrMsg;
                        }
                    }
                    else
                    {
                        ITopClient            client   = TBManager.GetClient();
                        TmcUserPermitRequest  req      = new TmcUserPermitRequest();
                        TmcUserPermitResponse response = client.Execute(req, Users.SessionKey);
                        AppCustomer           appCus   = null;
                        if (response.IsSuccess)
                        {
                            appCus         = new AppCustomer();
                            appCus.Status  = "1";
                            appCus.Nick    = Users.Nick;
                            appCus.Created = DateTime.Now.ToShortDateString();
                            AppCusBLL.AddAppCus(appCus);
                            btnAuothOpen.ImageUrl = "~/Images/rate/2open.png";
                        }
                        else
                        {
                            lberror.Text = response.ErrMsg;
                        }
                    }
                    btnAuothOpen.Width  = Unit.Pixel(80);
                    btnAuothOpen.Height = Unit.Pixel(25);
                }
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI);
            }
        }
Exemple #2
0
 private void CloseMsgService()
 {
     if (AppCusBLL.CheckAppCusIsExit(Users.Nick))
     {
         ITopClient           client = TBManager.GetClient();
         TmcUserCancelRequest req    = new TmcUserCancelRequest();
         req.Nick = Users.Nick;
         TmcUserCancelResponse response = client.Execute(req);
         if (response.IsSuccess)
         {
             AppCusBLL.DeleteSellerNifty(Users.Nick);
         }
     }
 }
Exemple #3
0
 public static void StopNotify()
 {
     if (!RemainderDAL.CheckSellerNofityForUnpay(Users.Nick))
     {
         ITopClient           client = TBManager.GetClient();
         TmcUserCancelRequest req    = new TmcUserCancelRequest();
         req.Nick = Users.Nick;
         TmcUserCancelResponse response = client.Execute(req);
         if (response.IsSuccess)
         {
             AppCusBLL.DeleteSellerNifty(Users.Nick);
         }
     }
 }
Exemple #4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (RadioButtonList1.SelectedValue.Equals("开启"))
     {
         ITopClient           client = TBManager.GetClient();
         TmcUserPermitRequest req    = new TmcUserPermitRequest();
         //req.Topics = "taobao_trade_TradeCreate,taobao_refund_RefundCreate";
         TmcUserPermitResponse response = client.Execute(req, txtSession.Text.Trim());
         if (response.IsSuccess)
         {
             lbMsg2.Text = "开启成功!";
         }
         else
         {
             lbMsg2.Text = response.ErrMsg;
         }
     }
     if (RadioButtonList1.SelectedValue.Equals("关闭"))
     {
         ITopClient           client = TBManager.GetClient();
         TmcUserCancelRequest req    = new TmcUserCancelRequest();
         req.Nick = sellerNick.Text.Trim();
         TmcUserCancelResponse response = client.Execute(req);
         if (response.IsSuccess)
         {
             lbMsg2.Text = "关闭成功!";
         }
         else
         {
             if (string.IsNullOrEmpty(response.ErrMsg))
             {
             }
             else
             {
                 lbMsg2.Text = response.ErrMsg;
             }
         }
     }
 }
        //保存评价配置
        protected void btnSaveRateConfig_Click(object sender, ImageClickEventArgs e)
        {
            //DataRow orderDate = SellersBLL.GetSelerOrderDate(Users.Nick);
            //if (orderDate != null)
            //{
            //    if (orderDate["OrderVersion"].Equals("体验版"))
            //    {
            //        versionControl.Visible = true;
            //        return;
            //    }
            //}
            RateConfig rateObj = new RateConfig();

            rateObj.SellerNick = Users.Nick;
            RatingBLL objBll = new RatingBLL();

            #region 自动评价设置
            //秒评
            if (rdoMiaoPing.Checked)
            {
                rateObj.IsMiaoRate = 1;
                //选择秒评,则自动开启主动通知授权
                ITopClient            client   = TBManager.GetClient();
                TmcUserPermitRequest  req      = new TmcUserPermitRequest();
                TmcUserPermitResponse response = client.Execute(req, Users.SessionKey);
                AppCustomer           appCus   = null;
                if (response.IsSuccess)
                {
                    appCus         = new AppCustomer();
                    appCus.Status  = "1";
                    appCus.Nick    = Users.Nick;
                    appCus.Created = DateTime.Now.ToShortDateString();

                    //检查卖家是否开启自动评价,如果已开启略过,未开启则开启
                    if (!objBll.CheckAppCusIsExit(Users.Nick))
                    {
                        objBll.AddAppCus(appCus);
                    }
                }
                else
                {
                    lberror2.Text = response.ErrMsg;
                    //Response.Write("<script>alert('" + response.ErrMsg + "');</script>");
                    //lberror2.ForeColor = Color.Red;
                }
            }
            else //其它情况则关闭主动通知消息,删除的前提是用户没有开通差评自动拦截
            {
                //检查卖家是否开启自动评价,如果已开启关闭,未开启则略过
                if (objBll.CheckAppCusIsExit(Users.Nick))
                {
                    //检查卖家差评自动拦截开关是否开启
                    if (!objBll.CheckIsAutoCloseOrder(Users.Nick))
                    {
                        ITopClient           client = TBManager.GetClient();
                        TmcUserCancelRequest req    = new TmcUserCancelRequest();
                        req.Nick = Users.Nick;
                        TmcUserCancelResponse response = client.Execute(req);
                        if (response.IsSuccess)
                        {
                            objBll.DeleteSellerNifty(Users.Nick);
                        }
                        else
                        {
                            lberror2.Text = response.ErrMsg;
                            Response.Write("<script>alert('" + response.ErrMsg + "');</script>");
                            //lberror2.ForeColor = Color.Red;
                        }
                    }
                    else
                    {
                        lberror2.Text = "请先关闭差评自动拦截开关!";
                        //lberror2.ForeColor = Color.Red;
                    }
                }
            }
            //买家评价以后评价
            if (rdoBuyerRated.Checked)
            {
                rateObj.IsWaitBuyerRate   = 1;
                rateObj.WaitBuyerTimeDay  = Convert.ToInt32(drpFangAn2Day.SelectedValue);
                rateObj.WaitBuyerTimeHour = Convert.ToInt32(drpFangAn2Hour.SelectedValue);
                rateObj.WaitBuyerTimeFen  = Convert.ToInt32(drpFangAn2Minute.SelectedValue);
                if (rdoFangAn2NotAtuo.Checked)
                {
                    rateObj.BlackBuyerRatedIsRate = 1;
                }
                if (rdoFangAn2AtuoGoodRate.Checked)
                {
                    rateObj.BlackBuyerRatedIsRate = 2;
                }
                if (rdoFangAn2AtuoNureRate.Checked)
                {
                    rateObj.BlackBuyerRatedIsRate = 3;
                }
                if (rdoFangAn2AtuoPoolRate.Checked)
                {
                    rateObj.BlackBuyerRatedIsRate = 4;
                }
                rateObj.BlackBuyerNoRateQiangRateDay  = Convert.ToInt32(drpFangAn2BacklstDay.SelectedValue);
                rateObj.BlackBuyerNoRateQiangRateHour = Convert.ToInt32(drpFangAn2BacklstHour.SelectedValue);
                rateObj.BlackBuyerNoRateQiangRateFen  = Convert.ToInt32(drpFangAn2BacklstMinute.SelectedValue);
                rateObj.BadRateContent = txtPoolRateContent.Text.Trim();
            }
            //在交易完成后多长时间评价
            if (rdoAutoRate.Checked)
            {
                rateObj.IsQiangRate       = 1;
                rateObj.QiangRateTimeDay  = Convert.ToInt32(drpFangAn3Day.SelectedValue);
                rateObj.QiangRateTimeHour = Convert.ToInt32(drpFangAn3Hour.SelectedValue);
                rateObj.QiangRateTimeFen  = Convert.ToInt32(drpFangAn3Minute.SelectedValue);
            }
            #endregion

            #region 中差评设置
            if (cbBlakList.Checked)
            {
                //自动把给我中差评的买家加入黑名单
                rateObj.AtuoAddBlackListBadRate = 1;
            }
            if (cbAddBlacklstTuikuan.Checked)
            {
                //把半年内有退款申请的买家加入黑名单
                rateObj.AtuoAddBlackListTuiKuan = 1;
            }
            #endregion

            //默认为好评
            rateObj.Result = "good";
            //rateObj.Result = "bad";
            if (!string.IsNullOrEmpty(txtRateTemp1.Text.Trim()))
            {
                rateObj.Content1 = txtRateTemp1.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtRateTemp2.Text.Trim()))
            {
                rateObj.Content2 = txtRateTemp2.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtRateTemp3.Text.Trim()))
            {
                rateObj.Content3 = txtRateTemp3.Text.Trim();
            }
            rateObj.ContentChoice = int.Parse(drpContentChoice.SelectedValue);

            //检查评价配置表是否存在卖家
            if (!objBll.CheckRateConfigIsExit(Users.Nick))
            {
                try
                {
                    objBll.AddRateConfig(rateObj);
                    if (string.IsNullOrEmpty(lberror2.Text))
                    {
                        lberror2.Text = "评价条件设置保存成功!";
                        //Response.Write("<script>alert('评价条件设置保存成功,请确保开启自动评价开关!');</script>");
                        //lberror2.ForeColor = Color.Blue;
                    }
                }
                catch (Exception ex)
                {
                    ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI);
                    Response.Write("<script>alert('评价条件修改失败!');</script>");
                }
            }
            else
            { //更新评价配置策略
                objBll.UpdateRateConfig(rateObj);
                if (string.IsNullOrEmpty(lberror2.Text))
                {
                    lberror2.Text = "评价条件修改成功!";
                    //Response.Write("<script>alert('评价条件修改成功!');</script>");
                    // lberror2.ForeColor = Color.Blue;
                }
            }
        }
Exemple #6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var command = context.Request.Form["command"];

            if (!string.IsNullOrEmpty(command))
            {
                switch (command)
                {
                    #region OpenDefense
                case "OpenDefense":
                {
                    DataRow orderDate = SellersBLL.GetSelerOrderDate(Users.Nick);
                    if (orderDate != null)
                    {
                        if (orderDate["OrderVersion"].Equals("体验版"))
                        {
                            context.Response.Write("nopower");        //试用版不能用
                            context.Response.End();
                            return;
                        }
                    }

                    if (!ShieldRulesBLL.CheckCloseOrderConfigIsExit(Users.Nick))
                    {
                        context.Response.Write("noConfig");        //保存拦截条件设置,才能开启差评自动防御!
                        context.Response.End();
                    }
                    else
                    {
                        DataTable tb = ShieldRulesBLL.GeCloseOrderConfigByNick(Users.Nick);
                        if (tb != null && tb.Rows.Count > 0)
                        {
                            if (tb.Rows[0]["isAutoCloseOrder"].ToString().Equals("1"))
                            {
                                //btnOpen.ImageUrl = "~/images/closed.png";
                                ShieldRulesBLL.UpdateAutoCloseOrderStatus(Users.Nick, 0);
                                //关闭订单自动拦截时先判断用户是否设置了自动秒评,否则关闭后就会出现问题
                                if (!ShieldRulesBLL.CheckIsMiaoPingAuto(Users.Nick))
                                {
                                    ITopClient           client = TBManager.GetClient();
                                    TmcUserCancelRequest req    = new TmcUserCancelRequest();
                                    req.Nick = Users.Nick;
                                    TmcUserCancelResponse response = client.Execute(req);
                                    if (response.IsSuccess)
                                    {
                                    }
                                }
                                context.Response.Write("cloedDefens");        //差评自动防御已关闭!
                                context.Response.End();
                            }
                            else
                            {
                                //btnOpen.ImageUrl = "~/images/open.png";
                                ShieldRulesBLL.UpdateAutoCloseOrderStatus(Users.Nick, 1);
                                //检查是否开启了主动通知
                                ITopClient            client   = TBManager.GetClient();
                                TmcUserPermitRequest  req      = new TmcUserPermitRequest();
                                TmcUserPermitResponse response = client.Execute(req, Users.SessionKey);
                                if (response.IsSuccess)
                                {
                                }
                                context.Response.Write("openDefens");        //差评自动防御已开启!
                                context.Response.End();
                            }
                        }
                    }
                }
                break;
                    #endregion

                    #region ClearDate
                case "ClearDate":
                {
                    if (ShieldRulesBLL.UpdateCloseDate(Users.Nick))
                    {
                        context.Response.Write("1");        //定时间段关闭已清除!
                        context.Response.End();
                    }
                }
                break;
                    #endregion

                    #region closeOrder
                case "closeOrder":
                {
                    string  orderNo  = context.Request.Form["orderNo"];
                    string  reason   = context.Request.Form["reason"];
                    TBTrade objTrade = new TBTrade();
                    Trade   trade    = objTrade.CloseOrderByTradeID(Convert.ToInt64(orderNo), reason);
                    if (trade != null)
                    {
                        context.Response.Write("1");        //关闭成功
                        context.Response.End();
                    }
                    if (ShieldRulesBLL.UpdateCloseDate(Users.Nick))
                    {
                        context.Response.Write("0");        //关闭失败
                        context.Response.End();
                    }
                }
                break;
                    #endregion
                }
            }
        }