/// <summary> /// 初始化短信充值列表 /// </summary> private void InitRecharge() { int pageSize = 20; int pageIndex = EyouSoft.Common.Utils.GetInt(Request.QueryString["Page"]); int recordCount = 0; string companyName = EyouSoft.Common.Utils.InputText(Request.QueryString["cn"]); int status = EyouSoft.Common.Utils.GetInt(Request.QueryString["status"], -1); EyouSoft.BLL.SMSStructure.Account bll = new EyouSoft.BLL.SMSStructure.Account(); IList <EyouSoft.Model.SMSStructure.PayMoneyInfo> items = bll.GetPayMoneys(pageSize, pageIndex, ref recordCount, 0, companyName, null, null, null, null, null, null, status, null); bll = null; if (items != null && items.Count > 0) { this.rptRecharges.DataSource = items; this.rptRecharges.DataBind(); this.phNotFound.Visible = false; this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), string.Format("pConfig.pageSize={0};pConfig.pageIndex={1};pConfig.recordCount={2};", pageSize, pageIndex, recordCount), true); } else { this.phNotFound.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目, true); return; } //获取账户余额 EyouSoft.BLL.SMSStructure.Account accountBll = new EyouSoft.BLL.SMSStructure.Account(); litRemainMoney.Text = accountBll.GetAccountMoney(CurrentUserCompanyID).ToString("F2"); }
/// <summary> /// 审核 /// </summary> private void Cashier() { string pid = EyouSoft.Common.Utils.InputText(Request.QueryString["pid"]); string status = EyouSoft.Common.Utils.InputText(Request.QueryString["status"]); decimal amount = EyouSoft.Common.Utils.GetDecimal(Request.QueryString["amount"], 0); string webmasterRealname = EyouSoft.Common.Utils.InputText(Request.QueryString["wn"]); if (string.IsNullOrEmpty(pid)) { ResponseClearAndWrite("0"); } if (string.IsNullOrEmpty(webmasterRealname)) { ResponseClearAndWrite("-1"); } if (amount < 0) { ResponseClearAndWrite("-2"); } EyouSoft.BLL.SMSStructure.Account bll = new EyouSoft.BLL.SMSStructure.Account(); EyouSoft.Model.SMSStructure.PayMoneyInfo info = new EyouSoft.Model.SMSStructure.PayMoneyInfo(); EyouSoft.SSOComponent.Entity.MasterUserInfo loginUserInfo = Utils.GetWebmaster(); info.CheckOperatorName = webmasterRealname; info.CheckTime = DateTime.Now; info.CheckUserName = loginUserInfo.Username; info.ID = pid; info.IsChecked = status == "true" ? 1 : 2; info.UseMoney = amount; if (info.IsChecked != 1) { info.UseMoney = 0; } if (bll.CheckPayMoney(info)) { ResponseClearAndWrite("1"); } else { ResponseClearAndWrite("-3"); } }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目, true); return; } EyouSoft.BLL.SMSStructure.Account accountBll = new EyouSoft.BLL.SMSStructure.Account(); string method = Utils.GetFormValue("method"); if (method == "recharge") { #region 充值 bool isTrue = false; EyouSoft.Model.SMSStructure.PayMoneyInfo Model = new EyouSoft.Model.SMSStructure.PayMoneyInfo(); Model.CompanyID = SiteUserInfo.CompanyID; Model.CompanyName = SiteUserInfo.CompanyName; Model.IsChecked = 0; Model.OperatorTime = DateTime.Now; Model.PayTime = Utils.GetDateTime(Utils.InputText(txtRechargeDate.Value), DateTime.Now); Model.PayMoney = Utils.GetDecimal(Utils.InputText(txtRechargeMoney.Value)); Model.OperatorName = SiteUserInfo.ContactInfo.ContactName; Model.OperatorID = SiteUserInfo.ID; Model.OperatorMobile = SiteUserInfo.ContactInfo.ContactMobile; Model.OperatorTel = SiteUserInfo.ContactInfo.ContactTel; isTrue = accountBll.InsertPayMoney(Model); Utils.ResponseMeg(isTrue, isTrue?"充值成功,请等待审核":"充值失败"); return; #endregion } //初始化信息 txtCompanyName.Value = SiteUserInfo.CompanyName; //客户名称 txtUserName.Value = SiteUserInfo.ContactInfo.ContactName; //充值人 txtRechargeDate.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); //充值时间 }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目, true); return; } //当前操作 string method = Utils.GetFormValue("method"); //验证或发送 if (method == "valid" || method == "send") { #region 发送短信 #region 获取发送手机号并验证 List <EyouSoft.Model.SMSStructure.AcceptMobileInfo> moibleList = new List <EyouSoft.Model.SMSStructure.AcceptMobileInfo>(); string[] moibleArr = Utils.InputText(Utils.GetFormValue("txtMobiles")).Split(',', ','); StringBuilder errBuilder = new StringBuilder(); string resultMess = string.Empty; bool result = false; foreach (string mobile in moibleArr) { if (!Utils.IsMobile(mobile))//验证手机格式如果不正确则输出错误手机号 { errBuilder.AppendFormat("{0},", mobile); } else { EyouSoft.Model.SMSStructure.AcceptMobileInfo mobileInfo = new EyouSoft.Model.SMSStructure.AcceptMobileInfo(); mobileInfo.IsEncrypt = false; mobileInfo.Mobile = mobile; moibleList.Add(mobileInfo); } } resultMess = errBuilder.ToString(); EyouSoft.BLL.SMSStructure.SendMessage sendBll = new EyouSoft.BLL.SMSStructure.SendMessage(); string smsContent = Utils.InputText(Utils.GetFormValue("textContent")); string forbidWords = sendBll.IsIncludeKeyWord(smsContent);//获取禁止发送的词 if (!String.IsNullOrEmpty(forbidWords)) { resultMess += "短信包含禁止发送的关键词:" + forbidWords; } #endregion //如果验证手机格式都通过则发送 if (resultMess == "") { #region 构造短息信息实体 //发送实体 EyouSoft.Model.SMSStructure.SendMessageInfo sendMessageInfo = new EyouSoft.Model.SMSStructure.SendMessageInfo(); //发信人公司ID sendMessageInfo.CompanyId = CurrentUserCompanyID; //发信人公司名 sendMessageInfo.CompanyName = SiteUserInfo.CompanyName; //发送通道 sendMessageInfo.SendChannel = new EyouSoft.Model.SMSStructure.SMSChannelList()[Utils.GetInt(Utils.GetFormValue(this.selChannel.UniqueID))]; //发送类型 sendMessageInfo.SendType = (EyouSoft.Model.SMSStructure.SendType)Utils.GetInt(Utils.GetFormValue("selSendType")); //发送时间 sendMessageInfo.SendTime = DateTime.Now; if (sendMessageInfo.SendType == EyouSoft.Model.SMSStructure.SendType.定时发送) { sendMessageInfo.SendTime = Utils.GetDateTime(Utils.GetFormValue("txtSendTime")); } //短信内容 sendMessageInfo.SMSContent = smsContent; //号码集合 sendMessageInfo.Mobiles = moibleList; //发送ID sendMessageInfo.UserId = SiteUserInfo.ID; //发信人姓名(如果勾选了发信人) if (Utils.GetFormValue("chkSender") == "hasSender") { sendMessageInfo.UserFullName = Utils.GetFormValue("txtSender"); } #endregion //初始化发送bll if (method == "valid") { #region 发送短信之前验证 //发送短信之前验证,返回验证结果实体 EyouSoft.Model.SMSStructure.SendResultInfo resultInfoBefore = sendBll.ValidateSend(sendMessageInfo); if (resultInfoBefore != null) { result = resultInfoBefore.IsSucceed; if (resultInfoBefore.IsSucceed == true) { //验证成功返回帐户余额以及此次所要发送的短信条数 resultMess = string.Format("1@您的账户当前余额为:{0},此次消费金额为:{1},将共发送短信{2}条!是否确定发送短信?" , resultInfoBefore.AccountMoney.ToString("C2") , resultInfoBefore.CountFee.ToString("C2") , (resultInfoBefore.WaitSendMobileCount + resultInfoBefore.WaitSendPHSCount).ToString()); } else if (resultInfoBefore.ErrorMessage.IndexOf("余额不足") > -1) { //余额不足 resultMess = "@0" + resultInfoBefore.ErrorMessage; } else { //其他错误 resultMess = "@2" + resultInfoBefore.ErrorMessage; } } #endregion } else { #region 执行发送 //执行发送,返回发送结果实体 EyouSoft.Model.SMSStructure.SendResultInfo resultInfo = sendBll.Send(sendMessageInfo); if (resultInfo != null) { result = resultInfo.IsSucceed; if (resultInfo.IsSucceed == true) { //发送成功 decimal costFee = sendMessageInfo.SendType == EyouSoft.Model.SMSStructure.SendType.直接发送 ? resultInfo.SendFee : resultInfo.CountFee; resultMess = "ok@您本次共发送短信" + sendMessageInfo.SMSContentSendComplete.Length + "个字" + (!string.IsNullOrEmpty(sendMessageInfo.UserFullName) ? "(包含发信人)" : "") + "!发送移动、联通共" + resultInfo.MobileSendNumberCount + "个号码、发送小灵通共" + resultInfo.PHSSendNumberCount + "个号码、实际共消费金额为:" + costFee.ToString("C2") + "、实际发送短信" + (resultInfo.MobileSendCount + resultInfo.PHSSendCount) + "条"; } else if (resultInfo.ErrorMessage.IndexOf("余额不足") > -1) { //余额不足 resultMess = "0@" + resultInfo.ErrorMessage; } else { //其他错误 resultMess = "2@" + resultInfo.ErrorMessage; } } #endregion } } else { //手机格式未通过输出消息 resultMess = "0@" + resultMess; result = false; } Utils.ResponseMeg(result, resultMess); #endregion } else { #region 初次加载 //获取账户余额,如果少于等于0则显示充值按钮和短信提示信息 //用户账户Bll EyouSoft.BLL.SMSStructure.Account accountBll = new EyouSoft.BLL.SMSStructure.Account(); decimal accountMoney = accountBll.GetAccountMoney(CurrentUserCompanyID); if (accountMoney <= 0) { showPay = "style='display:none'"; remainNum.Text = "你的短信剩余条数为0!"; remainNum.Visible = true; showPay = "style='display:none'"; } InitSendChannel(); #endregion } }
/// <summary> /// 创建子系统,返回1成功,其他失败 /// </summary> /// <param name="sysInfo">系统实体</param> /// <returns>返回1成功,其他失败</returns> public int CreateSys(Model.SysStructure.MSysInfo sysInfo) { #region data validate if (sysInfo == null) { return(0); } if (sysInfo.Domains == null || sysInfo.Domains.Count < 1) { return(-1); } if (sysInfo.AdminInfo == null || string.IsNullOrEmpty(sysInfo.AdminInfo.UserName)) { return(-2); } #region 打印单据配置验证 if (sysInfo.Setting != null && sysInfo.Setting.PrintDocument != null && sysInfo.Setting.PrintDocument.Count > 0)//打印单据配置验证 { IDictionary <EyouSoft.Model.EnumType.CompanyStructure.PrintTemplateType, int> dic = new Dictionary <EyouSoft.Model.EnumType.CompanyStructure.PrintTemplateType, int>(); foreach (var item in sysInfo.Setting.PrintDocument) { if (dic.ContainsKey(item.PrintTemplateType)) { dic[item.PrintTemplateType]++; } else { dic.Add(item.PrintTemplateType, 1); } } bool isRepeat = false; foreach (var item in dic) { if (item.Value > 1) { isRepeat = true; break; } } if (isRepeat) { return(-3); } } #endregion if (sysInfo.ModuleIds == null && sysInfo.ModuleIds.Length < 1) { sysInfo.ModuleIds = new int[] { -1 }; } if (sysInfo.PartIds == null || sysInfo.PartIds.Length < 1) { sysInfo.PartIds = new int[] { -1 }; } if (sysInfo.PermissionIds == null || sysInfo.PermissionIds.Length < 1) { sysInfo.PermissionIds = new int[] { -1 }; } if (sysInfo.Domains != null && sysInfo.Domains.Count > 0) { foreach (var domain in sysInfo.Domains) { domain.Domain = domain.Domain.Replace("http://", ""); } } #endregion int dalExceptionCode = dal.CreateSys(sysInfo); if (dalExceptionCode == 1) { EyouSoft.BLL.SMSStructure.Account smsbll = new EyouSoft.BLL.SMSStructure.Account(); smsbll.SetAccountBaseInfo(sysInfo.CompanyInfo.Id); smsbll = null; } return(dalExceptionCode); }