private Entities.SurveyCategory LoadSingleSurveyCategory(DataRow row) { Entities.SurveyCategory model = new Entities.SurveyCategory(); if (row["SCID"].ToString() != "") { model.SCID = int.Parse(row["SCID"].ToString()); } model.Name = row["Name"].ToString(); if (row["BGID"].ToString() != "") { model.BGID = int.Parse(row["BGID"].ToString()); } if (row["Level"].ToString() != "") { model.Level = int.Parse(row["Level"].ToString()); } if (row["Pid"].ToString() != "") { model.Pid = int.Parse(row["Pid"].ToString()); } if (row["Status"].ToString() != "") { model.Status = int.Parse(row["Status"].ToString()); } if (row["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(row["CreateTime"].ToString()); } if (row["CreateUserID"].ToString() != "") { model.CreateUserID = int.Parse(row["CreateUserID"].ToString()); } return(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Insert(SqlTransaction sqltran, Entities.SurveyCategory model) { SqlParameter[] parameters = { new SqlParameter("@SCID", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 100), new SqlParameter("@BGID", SqlDbType.Int, 4), new SqlParameter("@Level", SqlDbType.Int, 4), new SqlParameter("@Pid", SqlDbType.Int, 4), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@CreateUserID", SqlDbType.Int, 4) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = model.Name; parameters[2].Value = model.BGID; parameters[3].Value = model.Level; parameters[4].Value = model.Pid; parameters[5].Value = model.Status; parameters[6].Value = model.CreateTime; parameters[7].Value = model.CreateUserID; SqlHelper.ExecuteNonQuery(sqltran, CONNECTIONSTRINGS, CommandType.StoredProcedure, P_SURVEYCATEGORY_INSERT, parameters); return((int)parameters[0].Value); }
//取分类 public string GetCategoryFullName(string bussinessType, string BGID, string SCID) { VisitBusinessTypeEnum bt = (VisitBusinessTypeEnum)CommonFunction.ObjectToInteger(bussinessType); if (bt == VisitBusinessTypeEnum.S0_其他系统 || bt == VisitBusinessTypeEnum.None) { int _scid; int.TryParse(SCID, out _scid); Entities.SurveyCategory model = BitAuto.ISDC.CC2012.BLL.SurveyCategory.Instance.GetSurveyCategory(_scid); if (model != null) { return(model.Name); } else { return("其他"); } } else { return(BLL.Util.GetEnumOptText(typeof(VisitBusinessTypeEnum), (int)bt)); } }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Entities.SurveyCategory model) { SqlParameter[] parameters = { new SqlParameter("@SCID", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 100), new SqlParameter("@BGID", SqlDbType.Int, 4), new SqlParameter("@Level", SqlDbType.Int, 4), new SqlParameter("@Pid", SqlDbType.Int, 4), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@CreateUserID", SqlDbType.Int, 4) }; parameters[0].Value = model.SCID; parameters[1].Value = model.Name; parameters[2].Value = model.BGID; parameters[3].Value = model.Level; parameters[4].Value = model.Pid; parameters[5].Value = model.Status; parameters[6].Value = model.CreateTime; parameters[7].Value = model.CreateUserID; return(SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_SURVEYCATEGORY_UPDATE, parameters)); }
/// 新增或者修改分组 /// <summary> /// 新增或者修改分组 /// </summary> /// <param name="msg"></param> private void DisposeBusinessGroup(out string msg) { msg = string.Empty; try { Entities.BusinessGroup model = BLL.Util.BindQuery <Entities.BusinessGroup>(HttpContext.Current); if (model.BGID > 0) { //修改逻辑 Entities.BusinessGroup info = BLL.BusinessGroup.Instance.GetBusinessGroupInfoByBGID(model.BGID); if (info != null) { info.Name = model.Name; info.RegionID = model.RegionID; info.BusinessType = model.BusinessType; //业务包含cc,才有外显号码 if ((CommonFunction.ObjectToInteger(model.BusinessType) & (int)BusinessTypeEnum.CC) == (int)BusinessTypeEnum.CC) { info.CDID = model.CDID; } else { info.CDID = -2; } //修改组数据 BLL.BusinessGroup.Instance.Update(info); //业务包含im时 if ((CommonFunction.ObjectToInteger(model.BusinessType) & (int)BusinessTypeEnum.IM) == (int)BusinessTypeEnum.IM) { //清空业务线数据 BLL.BusinessGroupLineMapping.Instance.Delete(model.BGID); //插入业务线数据 InsertBusinessGroupLineMapping(model.BGID, model.LineIDs); } else { //清空业务线数据 BLL.BusinessGroupLineMapping.Instance.Delete(model.BGID); } msg = "{result:'yes',BGID:'" + model.BGID + "',AreaID:'" + AreaID + "',msg:'保存成功'}"; } else { msg = "{result:'no',BGID:'" + model.BGID + "',AreaID:'" + AreaID + "',msg:'没有找到对应分组信息'}"; } } else { //新增逻辑 model.CreateTime = DateTime.Now; model.Status = 0; //业务包含cc,才有外显号码 if ((CommonFunction.ObjectToInteger(model.BusinessType) & (int)BusinessTypeEnum.CC) != (int)BusinessTypeEnum.CC) { model.CDID = -2; } //插入组数据 int id = BLL.BusinessGroup.Instance.Insert(model); //业务包含im时 if ((CommonFunction.ObjectToInteger(model.BusinessType) & (int)BusinessTypeEnum.IM) == (int)BusinessTypeEnum.IM) { //插入业务线数据 InsertBusinessGroupLineMapping(id, model.LineIDs); } //创建分类 Entities.SurveyCategory categoryModel = new Entities.SurveyCategory(); categoryModel.BGID = id; categoryModel.Status = -3; categoryModel.CreateTime = DateTime.Now; categoryModel.CreateUserID = BLL.Util.GetLoginUserID(); categoryModel.Name = "工单分类"; categoryModel.TypeId = 2; int scId = BLL.SurveyCategory.Instance.Insert(categoryModel); //创建业务线url地址 string webBaseUrl = ConfigurationUtil.GetAppSettingValue("ExitAddress"); webBaseUrl = webBaseUrl + "/WorkOrder/WorkOrderView.aspx?OrderID={0}"; BLL.CallRecord_ORIG_Business.Instance.AddBusinessUrl(id, scId, webBaseUrl); msg = "{result:'yes',BGID:'" + id + "',AreaID:'" + AreaID + "',msg:'保存成功'}"; } } catch (Exception ex) { msg = "{result:'no',BGID:'',AreaID:'',msg:'" + ex.Message + "'}"; } }
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 }
//问卷分类新增 private void surveyCategoryInsert(out string msg) { msg = string.Empty; string validator = string.Empty; string name = string.Empty; int bgid; #region 验证数据格式 if (RequestName == "") { validator += "分类名称不能为空<br/>"; } else { name = RequestName; } if (!int.TryParse(RequestBGID, out bgid)) { validator += "所属分组格式不正确<br/>"; } if (validator != string.Empty) { msg = "{msg:'" + validator + "'操作失败}"; return; } #endregion Entities.SurveyCategory model = new Entities.SurveyCategory(); model.Name = name; model.BGID = bgid; model.Status = 0; model.CreateTime = DateTime.Now; model.CreateUserID = userID; model.Level = -2; model.Pid = -2; model.TypeId = int.Parse(TypeId); int result = 0; try { result = BLL.SurveyCategory.Instance.Insert(model); if (TypeId == "2") { //如果是其他任务的项目,在 CallRecord_ORIG_BusinessURL 添加一个URL string webBaseUrl = ConfigurationUtil.GetAppSettingValue("ExitAddress"); webBaseUrl = webBaseUrl + "/OtherTask/OtherTaskDealView.aspx?OtherTaskID={0}"; BLL.CallRecord_ORIG_Business.Instance.AddBusinessUrl(bgid, result, webBaseUrl); } msg = "{msg:'操作成功'}"; string logStr = string.Empty; logStr = "问卷分类【新增】一条分类名称【" + model.Name + "】所属分组【" + model.BGID + "】的记录"; BLL.Util.InsertUserLog(logStr); } catch (Exception ex) { msg = "{msg:'" + ex.Message + "'}"; } }
private void UpdateSurveyCategoryStatus(out string msg) { msg = string.Empty; int _scid = 0; if (int.TryParse(RequestSCID, out _scid)) { Entities.SurveyCategory model = BLL.SurveyCategory.Instance.GetSurveyCategory(_scid); if (model != null) { int count; if (model.Status == 0) { if (model.TypeId == 1) { //判断该分类在调查问卷或调查项目中使用,则不能删除 Entities.QuerySurveyInfo query_surveyInfo = new Entities.QuerySurveyInfo(); query_surveyInfo.SCID = _scid; DataTable dt_surveyInfo = BLL.SurveyInfo.Instance.GetSurveyInfo(query_surveyInfo, "", 1, 10000, out count); if (dt_surveyInfo.Rows.Count > 0) { msg = "{msg:'该分类在调查问卷中有使用,无法停用'}"; return; } //判断该分类在调查问卷或调查项目中使用,则不能删除 Entities.QuerySurveyProjectInfo query_projectInfo = new Entities.QuerySurveyProjectInfo(); query_projectInfo.SCID = _scid; query_projectInfo.Status = 0; DataTable dt_projectInfo = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(query_projectInfo, "", 1, 10000, out count); if (dt_projectInfo.Rows.Count > 0) { msg = "{msg:'该分类在调查项目中有使用,无法停用'}"; return; } } else if (model.TypeId == 2) { Entities.QueryProjectInfo query = new Entities.QueryProjectInfo(); query.PCatageID = _scid; query.Status = 0; DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, "", 1, 9999, out count); if (dt != null && dt.Rows.Count > 0) { msg = "{msg:'该分类在数据清洗项目中有使用,无法停用'}"; return; } } model.Status = 1; } else if (model.Status == 1) { model.Status = 0; } int result = 0; try { result = BLL.SurveyCategory.Instance.Update(model); msg = "{msg:'success'}"; } catch (Exception ex) { msg = "{msg:'" + ex.Message + "'}"; } } } }
//问卷分类修改(包括编辑和删除) private void surveyCategoryUpdate(out string msg) { msg = string.Empty; int _scid; if (int.TryParse(RequestSCID, out _scid)) { Entities.SurveyCategory model = BLL.SurveyCategory.Instance.GetSurveyCategory(_scid); if (model != null) { string oldName = string.Empty; string newName = string.Empty; if (RequestName != "") { oldName = model.Name; model.Name = RequestName; newName = model.Name; } if (RequestStatus != "") { int count; if (TypeId == "1") { //判断该分类在调查问卷或调查项目中使用,则不能删除 Entities.QuerySurveyInfo query_surveyInfo = new Entities.QuerySurveyInfo(); query_surveyInfo.SCID = _scid; DataTable dt_surveyInfo = BLL.SurveyInfo.Instance.GetSurveyInfo(query_surveyInfo, "", 1, 10000, out count); if (dt_surveyInfo.Rows.Count > 0) { msg = "{msg:'该分类在调查问卷中有使用,无法删除'}"; return; } //判断该分类在调查问卷或调查项目中使用,则不能删除 Entities.QuerySurveyProjectInfo query_projectInfo = new Entities.QuerySurveyProjectInfo(); query_projectInfo.SCID = _scid; query_projectInfo.Status = 0; DataTable dt_projectInfo = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(query_projectInfo, "", 1, 10000, out count); if (dt_projectInfo.Rows.Count > 0) { msg = "{msg:'该分类在调查项目中有使用,无法删除'}"; return; } } else if (TypeId == "2") { Entities.QueryProjectInfo query = new Entities.QueryProjectInfo(); query.PCatageID = _scid; query.Status = 0; DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, "", 1, 9999, out count); if (dt != null && dt.Rows.Count > 0) { msg = "{msg:'该分类在数据清洗项目中有使用,无法删除'}"; return; } } model.Status = int.Parse(RequestStatus); } int result = 0; try { result = BLL.SurveyCategory.Instance.Update(model); if (RequestStatus != "" && TypeId == "2") { //如果是其他任务的删除 BLL.CallRecord_ORIG_Business.Instance.DeleteBusinessUrl((int)model.BGID, (int)model.SCID); } if (result == 1) { msg = "{msg:'操作成功'}"; string logType = string.Empty; if (TypeId == "1") { //插入日志 if (model.Status == -1)//删除 { logType += "问卷分类【删除】主键【" + model.SCID + "】分类名称【" + model.Name + "】问卷"; } else if (oldName != string.Empty && newName != string.Empty) { logType += "问卷分类【修改】主键【" + model.SCID + "】分类名称由【" + oldName + "】修改为【" + newName + "】"; } } else if (TypeId == "2") { //插入日志 if (model.Status == -1)//删除 { logType += "项目分类【删除】主键【" + model.SCID + "】分类名称【" + model.Name + "】问卷"; } else if (oldName != string.Empty && newName != string.Empty) { logType += "项目分类【修改】主键【" + model.SCID + "】分类名称由【" + oldName + "】修改为【" + newName + "】"; } } BLL.Util.InsertUserLog(logType); } else { msg = "{msg:'操作失败'}"; } } catch (Exception ex) { msg = "{msg:'" + ex.Message + "'}"; } } } }
/// <summary> /// 更新一条数据 /// </summary> public int Update(SqlTransaction sqltran, Entities.SurveyCategory model) { return(Dal.SurveyCategory.Instance.Update(sqltran, model)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Entities.SurveyCategory model) { return(Dal.SurveyCategory.Instance.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Insert(Entities.SurveyCategory model) { return(Dal.SurveyCategory.Instance.Insert(model)); }
private void SurveyProjectInfoBind() { int spIid = 0; if (int.TryParse(SPIID, out spIid)) { Entities.QuerySurveyProjectInfo query = new QuerySurveyProjectInfo(); //query.BGIDStr = BLL.UserGroupDataRigth.Instance.GetUserGroupDataRightBgIDStrByUserID(BLL.Util.GetLoginUserID()); query.LoginUserID = BLL.Util.GetLoginUserID(); query.SPIID = spIid; int totalCount = 0; BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(query, "", 1, 1, out totalCount); if (totalCount > 0) { Entities.SurveyProjectInfo info = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(spIid); if (info != null) { spanProjectName.InnerText = info.Name; spanDescription.InnerText = info.Description; DataTable bgBt = BLL.BusinessGroup.Instance.GetBusinessGroupByBGID((int)info.BGID); if (bgBt != null && bgBt.Rows.Count > 0) { spanBGID.InnerText = bgBt.Rows[0]["Name"].ToString(); } Entities.SurveyCategory categoryInfo = BLL.SurveyCategory.Instance.GetSurveyCategory((int)info.SCID); if (categoryInfo != null) { spanBCID.InnerText = categoryInfo.Name; } Entities.SurveyInfo surveyInfo = BLL.SurveyInfo.Instance.GetSurveyInfo((int)info.SIID); spanSIID.InnerText = surveyInfo.Name; spanBusinessGroup.InnerText = info.BusinessGroup; spanBeginTime.InnerText = info.SurveyStartTime.ToString(); spanEndTime.InnerText = info.SurveyEndTime.ToString(); DataTable dt = BLL.SurveyPerson.Instance.GetSurveyPersonBySPIID(info.SPIID); if (dt != null && dt.Rows.Count > 0) { string personNames = string.Empty; for (int i = 0; i < dt.Rows.Count; i++) { int userId = int.Parse(dt.Rows[i]["ExamPersonID"].ToString()); string userName = BitAuto.YanFa.SysRightManager.Common.UserInfo.GerTrueName(userId); if (i > 0) { personNames += ","; } Entities.QuerySurveyAnswer queryAnswer = new QuerySurveyAnswer(); queryAnswer.CreateUserID = userId; queryAnswer.SPIID = spIid; int answerCount = 0; BLL.SurveyAnswer.Instance.GetSurveyAnswer(queryAnswer, "", 1, 1000, out answerCount); if (answerCount > 0) { personNames += "<a href='/SurveyInfo/PersonalSurveyInfoView.aspx?SPIID=" + spIid + "&UserID=" + userId + "' target='_blank'>" + userName + "</a>"; } else { personNames += userName; } } spanPersons.InnerHtml = personNames; spanEstimateNumber.InnerText = dt.Rows.Count.ToString(); } int userCount = BLL.SurveyAnswer.Instance.GetAnswerUserCountBySPIID(spIid); Entities.QuerySurveyQuestion questionQuery = new QuerySurveyQuestion(); questionQuery.AskCategory = 5; questionQuery.SIID = (int)info.SIID; string scoreStr = string.Empty; int questionTotalCount = 0; DataTable dtQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(questionQuery, "", 1, 1000, out questionTotalCount); int row = 0; foreach (DataRow dr in dtQuestion.Rows) { if (row > 0) { scoreStr += ";"; } int sqId = int.Parse(dr["SQID"].ToString()); Entities.QuerySurveyMatrixTitle queryRow = new QuerySurveyMatrixTitle(); queryRow.SQID = sqId; queryRow.Type = 1; int rowCount = 0; BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(queryRow, "", 1, 1000, out rowCount); int colCount = 0; queryRow.Type = 2; BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(queryRow, "", 1, 1000, out colCount); int sumScore = BLL.SurveyQuestion.Instance.GetQuestionForMatrixDropdownSumScore(sqId, spIid); if (userCount > 0) { decimal score = (decimal)sumScore / userCount; scoreStr += (int.Parse(dr["OrderNum"].ToString()) + 1) + "(" + score.ToString("0.00") + ")"; } } spanScore.InnerText = scoreStr; spanFinshTime.InnerText = info.SurveyEndTime.ToString(); spanTrueNumber.InnerText = userCount.ToString(); spanCreateUserName.InnerText = BitAuto.YanFa.SysRightManager.Common.UserInfo.GerTrueName((int)info.CreateUserID); spanCreateTime.InnerText = info.CreateTime.ToString(); row++; } } else { Response.Write("<script>location.href='about:blank'</script>;"); } } }