Beispiel #1
0
        private Entities.QS_Result LoadSingleQS_Result(DataRow row)
        {
            Entities.QS_Result model = new Entities.QS_Result();

            if (row["QS_RID"].ToString() != "")
            {
                model.QS_RID = int.Parse(row["QS_RID"].ToString());
            }
            if (row["CallReCordID"].ToString() != "")
            {
                model.CallReCordID = Int64.Parse(row["CallReCordID"].ToString());
            }
            if (row["QS_RTID"].ToString() != "")
            {
                model.QS_RTID = int.Parse(row["QS_RTID"].ToString());
            }
            model.SeatID = row["SeatID"].ToString();
            if (row["ScoreType"].ToString() != "")
            {
                model.ScoreType = int.Parse(row["ScoreType"].ToString());
            }
            if (row["Score"].ToString() != "")
            {
                model.Score = decimal.Parse(row["Score"].ToString());
            }
            if (row["IsQualified"].ToString() != "")
            {
                model.IsQualified = int.Parse(row["IsQualified"].ToString());
            }
            if (row["Status"].ToString() != "")
            {
                model.Status = int.Parse(row["Status"].ToString());
            }
            if (row["StateResult"].ToString() != "")
            {
                model.StateResult = int.Parse(row["StateResult"].ToString());
            }
            if (row["CreateTime"].ToString() != "")
            {
                model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
            }
            if (row["CreateUserID"].ToString() != "")
            {
                model.CreateUserID = int.Parse(row["CreateUserID"].ToString());
            }
            if (row["ModifyTime"].ToString() != "")
            {
                model.ModifyTime = DateTime.Parse(row["ModifyTime"].ToString());
            }
            if (row["ModifyUserID"].ToString() != "")
            {
                model.ModifyUserID = int.Parse(row["ModifyUserID"].ToString());
            }
            if (row["CallID"].ToString() != "")
            {
                model.CallID = Int64.Parse(row["CallID"].ToString());
            }
            model.QualityAppraisal = row["QualityAppraisal"].ToString();
            return(model);
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(QS_RID))
         {
             int intiy = 0;
             if (int.TryParse(QS_RID, out intiy))
             {
                 Entities.QS_Result model = BLL.QS_Result.Instance.GetQS_Result(intiy);
                 if (model != null)
                 {
                     Entities.QS_RulesTable QS_RulesTableModel = BLL.QS_RulesTable.Instance.GetQS_RulesTable(model.QS_RTID);
                     if (QS_RulesTableModel != null)
                     {
                         TableName = QS_RulesTableModel.Name;
                         if (QS_RulesTableModel.ScoreType == 2)
                         {
                             TableName += "(致命项数" + QS_RulesTableModel.DeadItemNum + ",非致命项数" + QS_RulesTableModel.NoDeadItemNum + ")";
                         }
                     }
                     this.QualityStandardViewID.QS_RTID = model.QS_RTID;
                     this.QualityStandardViewID.QS_RID  = model.QS_RID;
                     UCCallRecordView1.QS_RID           = model.QS_RID;
                     UCCallRecordView1.CallID           = model.CallID;
                     QualityStandardViewID.PageFrom     = PageFrom;
                     UCCallRecordView1.tableEndName     = tableEndName;
                 }
                 else
                 {
                     Response.Write(@"<script language='javascript'>javascript:alert('评分成绩不存在!');try {
          window.external.MethodScript('/browsercontrol/closepage');
     } catch (e) {
         window.opener = null; window.open('', '_self'); window.close();
     };</script>");
                 }
             }
             else
             {
                 Response.Write(@"<script language='javascript'>javascript:alert('评分成绩主键数据格式不正确!');try {
          window.external.MethodScript('/browsercontrol/closepage');
     } catch (e) {
         window.opener = null; window.open('', '_self'); window.close();
     };</script>");
             }
         }
         else
         {
             Response.Write(@"<script language='javascript'>javascript:alert('请求参数错误!');try {
          window.external.MethodScript('/browsercontrol/closepage');
     } catch (e) {
         window.opener = null; window.open('', '_self'); window.close();
     };</script>");
         }
     }
 }
Beispiel #3
0
 /// 审核保存
 /// <summary>
 /// 审核保存
 /// </summary>
 /// <param name="userID"></param>
 /// <param name="sInfoData"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 public override int AuditSave(int userID, QS_ResultData sInfoData, QSResultStatus status)
 {
     Entities.QS_Result model = null;
     model              = BLL.QS_Result.Instance.GetQS_Result(Convert.ToInt32(sInfoData.QS_RID));
     model.ModifyTime   = System.DateTime.Now;
     model.ModifyUserID = userID;
     model.ScoreType    = Convert.ToInt32(sInfoData.ScoreType);
     model.Status       = (Int32)status;
     model.StateResult  = 1;
     BLL.QS_Result.Instance.Update(model);
     return(model.QS_RID);
 }
Beispiel #4
0
 /// 维护成绩表
 /// <summary>
 /// 维护成绩表
 /// </summary>
 /// <param name="sInfoData"></param>
 /// <param name="userID"></param>
 /// <param name="QS_RTID"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 private int InsertOrUpdateResult(QS_ResultData sInfoData, int userID, out int QS_RTID, QSResultStatus status, string tableEndName)
 {
     Entities.QS_Result model = null;
     //由于易湃外呼业务签入cc系统,易湃不入库CallRecordInfo表,所以此处改成从CallRecord_ORIG_Business取录音创建坐席 modify by qizq 2014-4-17
     Entities.CallRecord_ORIG_Business callModel = BLL.CallRecord_ORIG_Business.Instance.GetByCallID(Convert.ToInt64(sInfoData.CallID), tableEndName);
     //说明是初次
     if (sInfoData.QS_RID == "0")
     {
         if (status == QSResultStatus.Submitted)
         {
             if (BLL.QS_Result.Instance.HasScored(sInfoData.CallID))
             {
                 // "此话务已评分过分了,不能再次评分!";
                 QS_RTID = 0;
                 return(-9999);
             }
         }
         model = new Entities.QS_Result();
         model.CallReCordID     = Convert.ToInt64(sInfoData.CallID);
         model.CallID           = Convert.ToInt64(sInfoData.CallID);
         model.QS_RTID          = Convert.ToInt32(sInfoData.QS_RTID);
         model.SeatID           = callModel.CreateUserID.ToString();
         model.ScoreType        = Convert.ToInt32(sInfoData.ScoreType);
         model.CreateTime       = System.DateTime.Now;
         model.CreateUserID     = userID;
         model.QualityAppraisal = sInfoData.QualityAppraisal;
         model.Status           = (Int32)status;
         model.QS_RID           = BLL.QS_Result.Instance.Insert(model, tableEndName);
         if (model.QS_RID == -9999)
         {
             // "此话务已评分过分了,不能再次评分!";
             QS_RTID = 0;
             return(-9999);
         }
     }
     //再次保存
     else
     {
         model = BLL.QS_Result.Instance.GetQS_Result(Convert.ToInt32(sInfoData.QS_RID));
         model.QualityAppraisal = sInfoData.QualityAppraisal;
         model.ModifyTime       = System.DateTime.Now;
         model.ModifyUserID     = userID;
         model.ScoreType        = Convert.ToInt32(sInfoData.ScoreType);
         model.Status           = (Int32)status;
         BLL.QS_Result.Instance.Update(model);
     }
     //返回结果
     QS_RTID = model.QS_RTID;
     return(model.QS_RID);
 }
Beispiel #5
0
        /// 增加一条数据
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Insert(Entities.QS_Result model, string tableEndName)
        {
            //校验
            var old = Dal.QS_Result.Instance.GetQS_Result(model.CallReCordID);

            if (old != null)
            {
                // "此话务已评分过分了,不能再次评分!";
                return(-9999);
            }
            else
            {
                return(Dal.QS_Result.Instance.Insert(model, tableEndName));
            }
        }
Beispiel #6
0
        public void Dispose(Entities.QSResultStatus status, Entities.QSApprovalType type, bool IsReject, out string msg)
        {
            msg = string.Empty;
            int rid = 0;

            if (int.TryParse(RequestQS_RID, out rid))
            {
                Entities.QS_Result info = BLL.QS_Result.Instance.GetQS_Result(rid);
                if (info != null)
                {
                    int userId = BLL.Util.GetLoginUserID();
                    info.Status       = (int)status;
                    info.ModifyTime   = DateTime.Now;
                    info.ModifyUserID = userId;

                    Entities.QS_ApprovalHistory model = new QS_ApprovalHistory();
                    model.CreateTime   = DateTime.Now;
                    model.CreateUserID = userId;
                    model.QS_RID       = rid;
                    model.QS_RTID      = info.QS_RTID;
                    model.Remark       = RequestRemark;
                    model.Status       = (int)status;
                    model.ApprovalType = ((int)type).ToString();
                    if (type != QSApprovalType.ScoreAppeal)
                    {
                        if (IsReject)
                        {
                            model.ApprovalResult = 2;
                            info.StateResult     = 2;
                        }
                        else
                        {
                            model.ApprovalResult = 1;
                            info.StateResult     = 1;
                        }
                    }
                    model.Type = "1";
                    BLL.QS_Result.Instance.Update(info);
                    BLL.QS_ApprovalHistory.Instance.Insert(model);
                    msg = "success";
                }
                else
                {
                    msg = "不存在此评分";
                }
            }
        }
Beispiel #7
0
        /// 保存成绩
        /// <summary>
        /// 保存成绩
        /// </summary>
        /// <param name="sInfoData"></param>
        /// <param name="HaveDead"></param>
        /// <param name="QS_RID"></param>
        public override void SaveScoreResult(QS_ResultData sInfoData, bool HaveDead, int QS_RID)
        {
            //取成绩实体
            Entities.QS_Result model = BLL.QS_Result.Instance.GetQS_Result(QS_RID);
            //计算成绩
            decimal?Score;
            int?    IsQualified;

            CalcResult(sInfoData, HaveDead, model.QS_RID, model.QS_RTID, model.ScoreType, out Score, out IsQualified);

            model.Score        = Score;
            model.IsQualified  = IsQualified;
            model.ModifyTime   = DateTime.Now;
            model.ModifyUserID = BLL.Util.GetLoginUserID();
            //保存
            BLL.QS_Result.Instance.Update(model);
        }
Beispiel #8
0
 /// <summary>
 ///  更新一条数据
 /// </summary>
 public int Update(Entities.QS_Result model)
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@QS_RID",           SqlDbType.Int,          4),
         new SqlParameter("@CallReCordID",     SqlDbType.BigInt,       8),
         new SqlParameter("@QS_RTID",          SqlDbType.Int,          4),
         new SqlParameter("@SeatID",           SqlDbType.VarChar,     50),
         new SqlParameter("@ScoreType",        SqlDbType.Int,          4),
         new SqlParameter("@Score",            SqlDbType.Decimal),
         new SqlParameter("@IsQualified",      SqlDbType.Int,          4),
         new SqlParameter("@Status",           SqlDbType.Int,          4),
         new SqlParameter("@StateResult",      SqlDbType.Int,          4),
         new SqlParameter("@CreateTime",       SqlDbType.DateTime),
         new SqlParameter("@CreateUserID",     SqlDbType.Int,          4),
         new SqlParameter("@ModifyTime",       SqlDbType.DateTime),
         new SqlParameter("@ModifyUserID",     SqlDbType.Int,          4),
         new SqlParameter("@QualityAppraisal", SqlDbType.VarChar,   2000),new SqlParameter("@CallID",SqlDbType.BigInt, 8)
     };
     parameters[0].Value  = model.QS_RID;
     parameters[1].Value  = model.CallID;
     parameters[2].Value  = model.QS_RTID;
     parameters[3].Value  = model.SeatID;
     parameters[4].Value  = model.ScoreType;
     parameters[5].Value  = model.Score;
     parameters[6].Value  = model.IsQualified;
     parameters[7].Value  = model.Status;
     parameters[8].Value  = model.StateResult;
     parameters[9].Value  = model.CreateTime;
     parameters[10].Value = model.CreateUserID;
     parameters[11].Value = model.ModifyTime;
     parameters[12].Value = model.ModifyUserID;
     parameters[13].Value = model.QualityAppraisal;
     parameters[14].Value = model.CallID;
     return(SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_QS_RESULT_UPDATE, parameters));
 }
Beispiel #9
0
        private void VerifyData()
        {
            string sysId  = ConfigurationUtil.GetAppSettingValue("ThisSysID");
            int    userId = BLL.Util.GetLoginUserID();

            FirstTrialButton = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.CheckRight("SYS024BUT600102", sysId, userId);
            RecheckButton    = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.CheckRight("SYS024BUT600103", sysId, userId);
            AppealButton     = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.CheckRight("SYS024BUT600106", sysId, userId);

            int rid = 0;

            if (int.TryParse(RequestQS_RID, out rid))
            {
                Entities.QS_Result info = BLL.QS_Result.Instance.GetQS_Result(rid);
                if (info != null)
                {
                    //由于易湃外呼业务签入cc系统,易湃不入库CallRecordInfo表,所以此处改成从CallRecord_ORIG_Business取录音创建坐席 modify by qizq 2014-4-17
                    Entities.CallRecord_ORIG_Business callRecordInfo = BLL.CallRecord_ORIG_Business.Instance.GetByCallID(Convert.ToInt64(info.CallID), tableEndName);
                    //Entities.CallRecordInfo callRecordInfo = BLL.CallRecordInfo.Instance.GetCallRecordInfoByCallID(info.CallID);
                    if (callRecordInfo != null)
                    {
                        //判断单据状态,如果不是待复审,不能复审
                        Entities.QS_RulesTable QS_RulesTableModel = BLL.QS_RulesTable.Instance.GetQS_RulesTable(info.QS_RTID);
                        if (QS_RulesTableModel != null)
                        {
                            TableName = QS_RulesTableModel.Name;
                            if (QS_RulesTableModel.ScoreType == 2)
                            {
                                TableName += "(致命项数" + QS_RulesTableModel.DeadItemNum + ",非致命项数" + QS_RulesTableModel.NoDeadItemNum + ")";
                            }
                        }

                        //如果具有申诉权限,并且当前人不是此录音的创建人员,关闭此页面
                        if (AppealButton && callRecordInfo.CreateUserID != BLL.Util.GetLoginUserID() & !RecheckButton & !AppealButton)
                        {
                            Response.Write(@"<script language='javascript'>alert('您没有权限查看此评分!');try {
                  window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self'); window.close();
            };</script>");
                        }
                        //如果不是本人录音,申诉按钮不显示
                        if (AppealButton && callRecordInfo.CreateUserID != BLL.Util.GetLoginUserID())
                        {
                            AppealButton = false;
                        }
                        this.ucCallRecordView.QS_RID       = info.QS_RID;
                        this.ucCallRecordView.CallID       = info.CallID;
                        this.ucCallRecordView.tableEndName = tableEndName;
                    }
                    Status = info.Status.ToString();
                    switch (Status)
                    {
                    case "20003":
                        Title = "录音质检成绩初审";
                        this.UCScoreTableView.QS_RID  = info.QS_RID;
                        this.UCScoreTableView.QS_RTID = info.QS_RTID;
                        break;

                    case "20004":
                        Title = "录音质检成绩复审";
                        this.ucTableDispose.CallID  = info.CallID;
                        this.ucTableDispose.QS_RID  = info.QS_RID;
                        this.ucTableDispose.QS_RTID = info.QS_RTID;
                        break;

                    default:
                        Title = "录音质检成绩查看";
                        this.UCScoreTableView.QS_RID  = info.QS_RID;
                        this.UCScoreTableView.QS_RTID = info.QS_RTID;
                        break;
                    }
                }
                else
                {
                    Response.Write(@"<script language='javascript'>alert('不存在此评分!');try {
                  window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self',''); window.close();
            };</script>");
                }
            }
            else
            {
                Response.Write(@"<script language='javascript'>alert('参数有误!');try {
                  window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self',''); window.close();
            };</script>");
            }
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int userId = BLL.Util.GetLoginUserID();
                if (!BLL.Util.CheckRight(userId, "SYS024BUT600104"))
                {
                    Response.Write(BLL.Util.GetNotAccessMsgPage("您没有访问该页面的权限"));
                    Response.End();
                }
                if (QS_RTID != 0 && CallID != 0)
                {
                    if (QS_RID <= 0)
                    {
                        QS_RID = BLL.QS_Result.Instance.GetRidByCallidAndRtid(QS_RTID, CallID);
                    }

                    Entities.QS_RulesTable tablemodel = BLL.QS_RulesTable.Instance.GetQS_RulesTable(QS_RTID);
                    //由于易湃外呼业务录音不入CC的CallRecordInfo表,所以取CallRecord_ORIG_Business来判断录音是否存在 modify by qizq 2014-4-17
                    //Entities.CallRecordInfo callmodel = BLL.CallRecordInfo.Instance.GetCallRecordInfoByCallID(CallID);
                    Entities.CallRecord_ORIG_Business callmodel = BLL.CallRecord_ORIG_Business.Instance.GetByCallID(CallID, tableEndName);
                    if (tablemodel != null && callmodel != null)
                    {
                        TableName = tablemodel.Name;
                        if (tablemodel.ScoreType == 2)
                        {
                            TableName += "(致命项数" + tablemodel.DeadItemNum + ",非致命项数" + tablemodel.NoDeadItemNum + ")";
                        }
                        bool flag = true;
                        if (QS_RID != 0)
                        {
                            Entities.QS_Result modelQS_Result = BLL.QS_Result.Instance.GetQS_Result(QS_RID);
                            if (modelQS_Result != null && modelQS_Result.Status == (Int32)Entities.QSResultStatus.WaitScore)
                            {
                            }
                            else
                            {
                                flag = false;
                            }
                        }
                        if (flag)
                        {
                            QualityStandardEditID.QS_RTID  = QS_RTID;
                            QualityStandardEditID.QS_RID   = QS_RID;
                            QualityStandardEditID.CallID   = CallID;
                            UCCallRecordView1.QS_RID       = QS_RID;
                            UCCallRecordView1.CallID       = CallID;
                            UCCallRecordView1.tableEndName = tableEndName;
                        }
                        else
                        {
                            Response.Write(@"<script language='javascript'>javascript:alert('当前评分成绩不是待评分状态!');try {
                 window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self'); window.close();
            };</script>");
                        }
                    }
                    else
                    {
                        Response.Write(@"<script language='javascript'>javascript:alert('评分表不存在或录音不存在!');try {
                 window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self'); window.close();
            };</script>");
                    }
                }
                else
                {
                    Response.Write(@"<script language='javascript'>javascript:alert('页面请求参数不正确!');try {
                 window.external.MethodScript('/browsercontrol/closepage');
            } catch (e) {
                window.opener = null; window.open('', '_self'); window.close();
            };</script>");
                }
            }
        }
Beispiel #11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Entities.QS_Result model)
 {
     return(Dal.QS_Result.Instance.Update(model));
 }
        private void BindData()
        {
            #region 成绩结果
            if (QS_RID != 0)
            {
                Entities.QS_Result model = BLL.QS_Result.Instance.GetQS_Result(QS_RID);
                if (model != null)
                {
                    if (model.ScoreType == 1 || model.ScoreType == 3)
                    {
                        tdScore.InnerText = model.Score.ToString().Replace(".0", "") + "分";
                    }
                    else
                    {
                        tdScore.InnerText = model.IsQualified == 1 ? "合格" : "不合格";
                    }

                    if (model.Status != (int)QSResultStatus.WaitScore)
                    {
                        this.tdScore.Visible = true;
                    }
                }
            }


            #endregion

            #region 录音
            Entities.CallRecord_ORIG          origM     = BLL.CallRecord_ORIG.Instance.GetCallRecord_ORIGByCallID(CallID, tableEndName);
            Entities.CallRecord_ORIG_Business businessM = BLL.CallRecord_ORIG_Business.Instance.GetByCallID(CallID, tableEndName);
            if (origM != null && businessM != null)
            {
                this.spCallID.InnerText    = origM.CallID.ToString();
                this.spLiuShui.InnerHtml   = string.Format("<a href='/KnowledgeLib/Personalization/DownLoadFilePage.aspx?theAction=1&theUrl={1}'>{0}</a>", origM.SessionID, HttpUtility.UrlEncode(origM.AudioURL));
                this.spUserName.InnerText  = BitAuto.YanFa.SysRightManager.Common.UserInfo.GerTrueName((int)businessM.CreateUserID);
                this.spBeginTime.InnerText = origM.EstablishedTime.ToString();
                this.spTimeLong.InnerText  = origM.TallTime.ToString();
                this.spCallType.InnerText  = BitAuto.ISDC.CC2012.BLL.Util.GetCallStatus(origM.CallStatus.Value.ToString());
                FileUrl = origM.AudioURL;

                this.spTaskID.InnerText = businessM.BusinessID;

                //分类名称
                Entities.SurveyCategory ScMode = BLL.SurveyCategory.Instance.GetSurveyCategory((int)businessM.SCID);
                if (ScMode != null)
                {
                    this.spSCName.InnerText = ScMode.Name;
                }
                //链接
                string url = BLL.CallRecord_ORIG_Business.Instance.GetTaskUrl(businessM.BusinessID, businessM.BGID.ToString(), businessM.SCID.ToString());
                url = BLL.CallRecord_ORIG_Business.Instance.GetViewUrl(businessM.BusinessID, url);
                this.spTaskID.InnerHtml = BLL.Util.GenBusinessURLByBGIDAndSCID(businessM.BGID.ToString(), businessM.SCID.ToString(), url, businessM.BusinessID, YPFanXianHBuyCarURL, EPEmbedCCHBuyCar_APPID);
            }

            //满意度加载
            int    ivrscore = BLL.IVRSatisfaction.Instance.GetIVRScoreBYCallID(CallID, tableEndName);
            string strScore = "";
            switch (ivrscore)
            {
            case 0:
                strScore = "未评价";
                break;

            case 1:
                strScore = "满意";
                break;

            case 2:
                strScore = "对问题处理结果不满意";
                break;

            case 3:
                strScore = "对客服代表服务不满意";
                break;

            case 10:
                strScore = "已解决,未评价";
                break;

            case 11:
                strScore = "已解决,满意";
                break;

            case 12:
                strScore = "已解决,对处理结果不满意";
                break;

            case 13:
                strScore = "已解决,对客服代表服务不满意";
                break;

            case 20:
                strScore = "未解决,未评价";
                break;

            case 21:
                strScore = "未解决,满意";
                break;

            case 22:
                strScore = "未解决,对处理结果不满意";
                break;

            case 23:
                strScore = "未解决,对客服代表服务不满意";
                break;

            default:
                break;
            }
            spIVRScore.InnerText = strScore;
            #endregion
        }
Beispiel #13
0
        ///  增加一条数据
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Insert(Entities.QS_Result model, string tableEndName)
        {
            //复制话务数据到质检话务冗余表
            string sql1 = @"INSERT  INTO CallRecord_ORIG_QS
            ( [RecID] , [SessionID] , [CallID] , [ExtensionNum] , [PhoneNum] , [ANI] ,
              [CallStatus] , [SwitchINNum] , [OutBoundType] , [SkillGroup] , [InitiatedTime] , [RingingTime] ,
              [EstablishedTime] , [AgentReleaseTime] , [CustomerReleaseTime] , [AfterWorkBeginTime] , [AfterWorkTime] ,
              [ConsultTime] , [ReconnectCall] , [TallTime] , [AudioURL] , [CreateTime] , [CreateUserID] ,
              [TransferInTime] , [TransferOutTime]
			)
            SELECT [RecID] ,[SessionID] ,[CallID] ,[ExtensionNum] ,[PhoneNum] ,[ANI] ,
                    [CallStatus] ,[SwitchINNum] ,[OutBoundType] ,[SkillGroup] ,[InitiatedTime] ,[RingingTime] ,
                    [EstablishedTime] ,[AgentReleaseTime] ,[CustomerReleaseTime] ,[AfterWorkBeginTime] , [AfterWorkTime] ,
                    [ConsultTime] ,[ReconnectCall] ,[TallTime] ,[AudioURL] , [CreateTime] ,[CreateUserID] ,
                    [TransferInTime] ,[TransferOutTime]
            FROM CallRecord_ORIG" + tableEndName + @"  
            WHERE   CallID = '" + model.CallReCordID + @"'
            AND [RecID] NOT IN (SELECT RecID FROM CallRecord_ORIG_QS)";

            string sql2 = @" INSERT  INTO CallRecord_ORIG_Business_QS
            ( [RecID] ,[CallID] ,[BGID] ,[SCID] ,[BusinessID] ,[CreateUserID] ,[CreateTime] ,[BFTaskID])
            SELECT  [RecID] ,[CallID] ,[BGID] ,[SCID] ,[BusinessID] ,[CreateUserID] ,[CreateTime] ,[BFTaskID]
            FROM    CallRecord_ORIG_Business" + tableEndName + @"  
            WHERE   CallID = '" + model.CallReCordID + @"'
            AND [RecID] NOT IN (SELECT RecID FROM CallRecord_ORIG_Business_QS)";

            string sql3 = @"INSERT  INTO IVRSatisfaction_QS
            ([Oid] ,[CallID] ,[CallRecordID] ,[Score] ,[CreateTime])
            SELECT [Oid] ,[CallID] ,[CallRecordID] ,[Score] ,[CreateTime]
            FROM IVRSatisfaction" + tableEndName + @"  
            WHERE   CallID = '" + model.CallReCordID + @"'
            AND [Oid] NOT IN (SELECT Oid FROM IVRSatisfaction_QS)";

            int j = 0;

            j += SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.Text, sql1);
            j += SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.Text, sql2);
            j += SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.Text, sql3);

            SqlParameter[] parameters =
            {
                new SqlParameter("@QS_RID",           SqlDbType.Int,          4),
                new SqlParameter("@CallReCordID",     SqlDbType.BigInt,       8),
                new SqlParameter("@QS_RTID",          SqlDbType.Int,          4),
                new SqlParameter("@SeatID",           SqlDbType.VarChar,     50),
                new SqlParameter("@ScoreType",        SqlDbType.Int,          4),
                new SqlParameter("@Score",            SqlDbType.Int,          4),
                new SqlParameter("@IsQualified",      SqlDbType.Int,          4),
                new SqlParameter("@Status",           SqlDbType.Int,          4),
                new SqlParameter("@StateResult",      SqlDbType.Int,          4),
                new SqlParameter("@CreateTime",       SqlDbType.DateTime),
                new SqlParameter("@CreateUserID",     SqlDbType.Int,          4),
                new SqlParameter("@ModifyTime",       SqlDbType.DateTime),
                new SqlParameter("@ModifyUserID",     SqlDbType.Int,          4),
                new SqlParameter("@QualityAppraisal", SqlDbType.VarChar,   2000),
                new SqlParameter("@CallID",           SqlDbType.BigInt,       8),
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.CallReCordID;
            parameters[2].Value     = model.QS_RTID;
            parameters[3].Value     = model.SeatID;
            parameters[4].Value     = model.ScoreType;
            parameters[5].Value     = model.Score;
            parameters[6].Value     = model.IsQualified;
            parameters[7].Value     = model.Status;
            parameters[8].Value     = model.StateResult;
            parameters[9].Value     = model.CreateTime;
            parameters[10].Value    = model.CreateUserID;
            parameters[11].Value    = model.ModifyTime;
            parameters[12].Value    = model.ModifyUserID;
            parameters[13].Value    = model.QualityAppraisal;
            parameters[14].Value    = model.CallID;

            SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_QS_RESULT_INSERT, parameters);
            int id = (int)parameters[0].Value;

            return(id);
        }