コード例 #1
0
        /// <summary>
        /// 开启和关闭自动评价
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void imgBtnOpenRatingAtuo_Click(object sender, ImageClickEventArgs e)
        {
            RatingBLL objRate = new RatingBLL();

            if (!objRate.CheckRateConfigIsExit(Users.Nick))
            {
                //Response.Write("<script>alert('先保存评价设置,才能开启自动评价!');</script>");
                Label2.Text    = "先保存评价设置,才能开启自动评价!";
                Label2.Visible = true;
                return;
            }
            else if (RatingBLL.isBshop(Users.Nick))
            {
                Label2.Text    = "天猫卖家不能使用自动评价功能!";
                Label2.Visible = true;
                return;
            }
            else
            {
                DataTable tb = objRate.GetRateConfigByNick(Users.Nick);
                if (tb != null && tb.Rows.Count > 0)
                {
                    if (tb.Rows[0]["isAutoRating"].ToString().Equals("1"))
                    {
                        imgBtnOpenRatingAtuo.ImageUrl = "~/images/1close.png";
                        objRate.UpdateAutoRatingStatus(Users.Nick, 0);
                    }
                    else
                    {
                        imgBtnOpenRatingAtuo.ImageUrl = "~/images/2open.png";
                        objRate.UpdateAutoRatingStatus(Users.Nick, 1);
                    }
                }
            }
        }
コード例 #2
0
        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();

            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;
            //            }
            //        }
            //    }
            //}
            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);
            }
            if (rdoAutoRate.Checked)
            {
                rateObj.IsQiangRate       = 1;
                rateObj.QiangRateTimeDay  = Convert.ToInt32(drpFangAn3Day.SelectedValue);
                rateObj.QiangRateTimeHour = Convert.ToInt32(drpFangAn3Hour.SelectedValue);
                rateObj.QiangRateTimeFen  = Convert.ToInt32(drpFangAn3Minute.SelectedValue);
            }
            if (cbBlakList.Checked)
            {
                rateObj.AtuoAddBlackListBadRate = 1;
            }
            if (cbAddBlacklstTuikuan.Checked)
            {
                rateObj.AtuoAddBlackListTuiKuan = 1;
            }
            rateObj.BadRateContent = txtPoolRateContent.Text.Trim();
            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);
                }
            }
            else
            { //更新评价配置策略
                objBll.UpdateRateConfig(rateObj);
                if (string.IsNullOrEmpty(lberror2.Text))
                {
                    lberror2.Text = "评价条件修改成功!";
                    //Response.Write("<script>alert('评价条件修改成功!');</script>");
                    lberror2.ForeColor = Color.Blue;
                }
            }
        }