/// <summary> /// 提交软件反馈 /// </summary> /// <param name="ChangeAuth"></param> /// <returns></returns> public ActionResult SubmitFeedback(FeedbackOperateDTO dto) { bool result = true; ResultData <int> feedbackresult = new ResultData <int>(); UserLoginDTO user = (UserLoginDTO)Session["UserLoginInfo"]; dto.FeedbackDate = DateTime.Now; dto.FeedbackStaus = 0; dto.UserID = user.UserID; try { feedbackresult = SystemProvider.AddFeedback(dto); if (feedbackresult.SubmitResult) { List <MasterData.DTO.Common.AdminDTO> lstadmin = UserApplyProvider.GetAdminInfo(new MasterData.DTO.Common.AdminSearchDTO { RoleIdList = new List <int> { 99 } }); EmailHelper.SendMessage("问题反馈", WebConfiger.ProblemFeedbackMessage, lstadmin.Select(g => g.Email).Distinct().ToList(), null, null); } } catch (Exception ex) { feedbackresult.SubmitResult = false; feedbackresult.Message = ex.Message; result = false; } if (Request.Files.Count > 0 && result == true) { HttpPostedFileBase Filedata = Request.Files[0]; string FileName = Guid.NewGuid().ToString(); //保存的文件名 string FileExtenSrcName = Filedata.FileName.Substring(Filedata.FileName.LastIndexOf("\\") + 1); //原文件名带扩展名 string FileSrcName = FileExtenSrcName.Substring(0, FileExtenSrcName.LastIndexOf(".")); //原文件名不带扩展名 string FilePath = null; string FileExtenName = Path.GetExtension(Filedata.FileName); // 文件扩展名 string strSaveDir = this.Server.MapPath("~/Attachments/Feedback"); //存储目录 if (!System.IO.Directory.Exists(strSaveDir)) { System.IO.Directory.CreateDirectory(strSaveDir); } FilePath = strSaveDir + "\\" + FileName; Filedata.SaveAs(FilePath); List <AttachFileOperateDTO> attachlist = new List <AttachFileOperateDTO>(); AttachFileOperateDTO attach = new AttachFileOperateDTO(); attach.BelongModulePrimaryKey = feedbackresult.Object.ToString(); attach.AttachFileID = Guid.NewGuid(); attach.AttachFileSrcName = FileSrcName; attach.BelongModule = 1; attach.AttachFileExtentionName = FileExtenName; attach.AttachFileName = FileName; attach.CreateTime = DateTime.Now; attach.CreateUser = user.FullName; attachlist.Add(attach); ResultData <object> attachresult = new ResultData <object>(); attachresult = HomeProvider.AddAttachFileList(attachlist); if (!attachresult.SubmitResult) { result = false; } } return(Json(result)); }
/// <summary> /// 用户申请 /// </summary> /// <param name="uam"></param> /// <returns></returns> public ActionResult Apply(UserApplyModel uam) { ResultData <object> result = new ResultData <object>(); short shtStatuscode = -1; if (HomeProvider.CheckPhoneNumber(uam.UserApplyTelNumber, ref shtStatuscode)) { result.SubmitResult = false; result.Message = "手机号已存在,不可重复申请!"; return(Json(result)); } uam.ApplyAuth = uam.ApplyAuth.Where(p => p.IsChecked).ToList(); uam.UserApplyTime = DateTime.Now; uam.AuditStatus = 0; if (UserApplyProvider.AuthApply(uam)) { List <MasterData.DTO.Common.AdminDTO> lstadmin = UserApplyProvider.GetAdminInfo(new MasterData.DTO.Common.AdminSearchDTO { RoleIdList = new List <int> { 1 } }); // 发送短信通知系统管理员 string UserApplyShortMessage = String.Format(WebConfiger.UserApplyShortMessage, uam.UserApplyName, uam.DistributorNamestr); if (string.IsNullOrEmpty(uam.DistributorNamestr)) { UserApplyShortMessage = UserApplyShortMessage.Replace("经销商:", ""); } MobileMessage.SendMessage(lstadmin.Select(g => g.PhoneNumber).ToList(), UserApplyShortMessage); //记录短信日志 var useridlist = lstadmin.Select(g => g.UserID).ToList(); if (useridlist.Count > 0) { List <MessageOperateDTO> msgdtolist = new List <MessageOperateDTO>(); foreach (var uid in useridlist) { msgdtolist.Add(new MessageOperateDTO { UserID = uid, SendTime = DateTime.Now, MessageType = 1 }); } TCSOFT.DMS.WebMain.Models.Provider.CommonProvider.AddMessageStat(msgdtolist); } // 发送邮件通知系统管理员 string UserApplyEmailMessage = String.Format(WebConfiger.UserApplyEmailMessage, uam.UserApplyName, uam.DistributorNamestr); if (string.IsNullOrEmpty(uam.DistributorNamestr)) { UserApplyEmailMessage = UserApplyEmailMessage.Replace("经销商:", ""); } EmailHelper.SendMessage("新用户申请", UserApplyEmailMessage, lstadmin.Select(g => g.Email).ToList(), null, null); result.SubmitResult = true; result.Message = "申请成功!"; } else { result.SubmitResult = false; result.Message = "申请失败!"; } return(Json(result)); }