//给 接收人 发送邮件 private void SendEmailToReceiver(AjaxServers.SendEmailInfo info) { string url = string.Empty; if (info.ReceiverID == -2) { return; } //邮件接收人的邮箱 string userEmail = BitAuto.YanFa.Crm2009.BLL.UserInfo.Instance.GetUserEmail(info.ReceiverID); string urlHead = BitAuto.Utils.Config.ConfigurationUtil.GetAppSettingValue("TaskProcessUrl"); if (info.DepartName.Contains("呼叫中心")) { url = "<a href='" + urlHead + "/WorkOrder/CCProcess.aspx?OrderID=" + info.OrderID + "'>" + info.OrderID + "</a>"; } else { url = "<a href='" + urlHead + "/WorkOrder/SalesProcess.aspx?OrderID=" + info.OrderID + "'>" + info.OrderID + "</a>"; } //邮件内容 string content = string.Empty; content = "您有一个工单需要处理。<br/>"; content += "工单标题:" + info.Title + "<br/>"; content += "工单记录:" + info.Desc + "<br/>"; content += "最晚处理日期:" + info.LastOperTime + "<br/>"; content += "处理请点击:" + url; if (info.ReceiverName != string.Empty) { BLL.EmailHelper.Instance.SendMailByWorkOrder(info.ReceiverName, info.Title, info.Desc, info.LastOperTime, url, "您有一个工单需要处理", new string[] { userEmail }); BLL.Util.InsertUserLog("【工单处理】发送邮件成功,收件人【" + info.ReceiverName + "】,邮箱【" + userEmail + "】,内容【" + content + "】"); } }
private void CCProcessSubmit(out string msg) { msg = string.Empty; if (!string.IsNullOrEmpty(Requester) && Requester.Trim() == "intelligentplatform") { msg = "process"; } else { judgePermission(out msg); } if (msg == string.Empty) { return; } Web.AjaxServers.ValidateDataFormat vd = new Web.AjaxServers.ValidateDataFormat(); int contentLen = vd.GetLength(RevertContent); if (contentLen > 600) { msg = "回复内容超过300个字!"; return; } //提交 #region 插入工单表 Entities.WorkOrderInfo model_OldWorkOrderInfo = BLL.WorkOrderInfo.Instance.GetWorkOrderInfo(OrderID); Entities.WorkOrderInfo model_NewWorkOrderInfo = bindWorkOrderInfo(BLL.WorkOrderInfo.Instance.GetWorkOrderInfo(OrderID), out msg); if (msg != string.Empty) { return; } model_NewWorkOrderInfo.ModifyUserID = operUserID; model_NewWorkOrderInfo.ModifyTime = operTime; if (RevertContent != string.Empty) { model_NewWorkOrderInfo.IsRevert = true; } BLL.WorkOrderInfo.Instance.Update(model_NewWorkOrderInfo); #endregion #region 插入工单回复表 EditWorkOrderRevert(model_NewWorkOrderInfo, model_OldWorkOrderInfo, out msg); #endregion #region 发送邮件 if (model_NewWorkOrderInfo.ReceiverName != model_OldWorkOrderInfo.ReceiverName && model_NewWorkOrderInfo.ReceiverID != null) { AjaxServers.SendEmailInfo sendInfo = new AjaxServers.SendEmailInfo(); sendInfo.ReceiverID = (int)model_NewWorkOrderInfo.ReceiverID; sendInfo.ReceiverName = model_NewWorkOrderInfo.ReceiverName; sendInfo.LastOperTime = model_NewWorkOrderInfo.LastProcessDate; sendInfo.OrderID = model_NewWorkOrderInfo.OrderID; sendInfo.Title = model_NewWorkOrderInfo.Title; sendInfo.DepartName = model_NewWorkOrderInfo.ReceiverDepartName; sendInfo.Desc = model_NewWorkOrderInfo.Content; SendEmailToReceiver(sendInfo); } #endregion msg = "true"; }
private void SalesProcessSubmit(out string msg) { msg = string.Empty; if (!string.IsNullOrEmpty(Requester) && Requester.Trim() == "intelligentplatform") { msg = "process"; } else { judgeSalesPermission(out msg); } if (msg == "none" || msg == "view" || msg == "over") { return; } if (string.IsNullOrEmpty(OrderID)) { msg = "工单号不能为空!"; return; } if (string.IsNullOrEmpty(RevertContent)) { msg = "回复内容不能为空!"; return; } Web.AjaxServers.ValidateDataFormat vd = new Web.AjaxServers.ValidateDataFormat(); int contentLen = vd.GetLength(RevertContent); if (contentLen > 600) { msg = "回复内容超过300个字!"; return; } #region 更新工单表 Entities.WorkOrderInfo model_WorkOrderInfo = BLL.WorkOrderInfo.Instance.GetWorkOrderInfo(OrderID); string oldReceiverName = model_WorkOrderInfo.ReceiverName; int _receiverID; if (int.TryParse(ReceiverID, out _receiverID)) { //坐席操作,只有在选择接收人,才会覆盖当前操作人,否则不清空 model_WorkOrderInfo.ReceiverID = _receiverID; model_WorkOrderInfo.ReceiverName = ReceiverName; } model_WorkOrderInfo.IsSales = IsSales == "true" ? true : false; if (RevertContent != string.Empty) { model_WorkOrderInfo.IsRevert = true; } if (!string.IsNullOrEmpty(ReceiverName) && !string.IsNullOrEmpty(ReceiverID) && ReceiverID != "-2") { model_WorkOrderInfo.ReceiverDepartName = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetDistrictNameByUserID(int.Parse(ReceiverID)); } model_WorkOrderInfo.ModifyTime = operTime; model_WorkOrderInfo.ModifyUserID = operUserID; model_WorkOrderInfo.WorkOrderStatus = (int)Entities.WorkOrderStatus.Processing; BLL.WorkOrderInfo.Instance.Update(model_WorkOrderInfo); #endregion #region 插入工单回复表(原来的) Entities.WorkOrderRevert model_Revert = new Entities.WorkOrderRevert(); if (string.IsNullOrEmpty(RTWORID)) //没有接通电话时提交回复信息,则插入[WorkOrderRevert]表一条数据 { model_Revert.OrderID = OrderID; model_Revert.RevertContent = RevertContent; if (!string.IsNullOrEmpty(oldReceiverName) || !string.IsNullOrEmpty(ReceiverName)) { model_Revert.ReceiverName = fieldDesc(oldReceiverName, model_WorkOrderInfo.ReceiverName); model_Revert.ReceiverID = model_WorkOrderInfo.ReceiverID.ToString(); } model_Revert.ReceiverDepartName = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetDistrictNameByUserID(operUserID); model_Revert.WorkOrderStatus = "处理中"; model_Revert.CreateTime = operTime; model_Revert.CreateUserID = operUserID; BLL.WorkOrderRevert.Instance.Insert(model_Revert); } else //已经接通电话,并插入[WorkOrderRevert]表一条数据,则更新这条数据 { model_Revert = BLL.WorkOrderRevert.Instance.GetWorkOrderRevert(long.Parse(RTWORID)); model_Revert.RevertContent = RevertContent; if (!string.IsNullOrEmpty(oldReceiverName) || !string.IsNullOrEmpty(ReceiverName)) { model_Revert.ReceiverName = fieldDesc(oldReceiverName, model_WorkOrderInfo.ReceiverName); model_Revert.ReceiverID = model_WorkOrderInfo.ReceiverID.ToString(); } model_Revert.WorkOrderStatus = "处理中"; BLL.WorkOrderRevert.Instance.Update(model_Revert); } #endregion #region 插入工单回复表、工单日志表 //Entities.WorkOrderLog log = new Entities.WorkOrderLog(); //Entities.WorkOrderReceiver receiver = new Entities.WorkOrderReceiver(); //if (string.IsNullOrEmpty(RTWORID)) //没有接通电话时提交回复信息,则插入 日志表、回复表 //{ // log.OrderID = OrderID; // if (!string.IsNullOrEmpty(oldReceiverName) || !string.IsNullOrEmpty(ReceiverName)) // { // log.LogDesc = fieldDesc(oldReceiverName, model_WorkOrderInfo.ReceiverName); // /// model_Revert.WorkOrderStatus = "处理中"; // } // log.CreateTime = operTime; // log.CreateUserID = operUserID; // receiver.RevertContent = RevertContent; // receiver.ReceiverUserID = model_WorkOrderInfo.ReceiverID; // receiver.ReceiverDepartName = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetDistrictNameByUserID(operUserID); // receiver.CreateTime = operTime; // receiver.CreateUserID = operUserID; // int ReceiverRecID = BLL.WorkOrderReceiver.Instance.Insert(receiver); // log.ReceiverRecID = ReceiverRecID; // BLL.WorkOrderLog.Instance.Insert(log); //} //else //{ // receiver = BLL.WorkOrderReceiver.Instance.GetWorkOrderReceiver(int.Parse(RTWORID)); // receiver.RevertContent = RevertContent; // receiver.ReceiverUserID = model_WorkOrderInfo.ReceiverID; // log = BLL.WorkOrderLog.Instance.GetWorkOrderLogByRtRecID(int.Parse(RTWORID)); // if (!string.IsNullOrEmpty(oldReceiverName) || !string.IsNullOrEmpty(ReceiverName)) // { // log .LogDesc= fieldDesc(oldReceiverName, model_WorkOrderInfo.ReceiverName); // //model_Revert.WorkOrderStatus = "处理中"; // } // BLL.WorkOrderLog.Instance.Update(log); // BLL.WorkOrderReceiver.Instance.Update(receiver); //} #endregion #region 发送邮件 if (int.TryParse(ReceiverID, out _receiverID)) { AjaxServers.SendEmailInfo sendInfo = new AjaxServers.SendEmailInfo(); sendInfo.ReceiverID = _receiverID; sendInfo.ReceiverName = ReceiverName; sendInfo.LastOperTime = model_WorkOrderInfo.LastProcessDate; sendInfo.OrderID = model_WorkOrderInfo.OrderID; sendInfo.Title = model_WorkOrderInfo.Title; sendInfo.DepartName = model_WorkOrderInfo.ReceiverDepartName; sendInfo.Desc = model_WorkOrderInfo.Content; SendEmailToReceiver(sendInfo); } #endregion msg = "true"; }