public NativeConfig(int site_payment_id) { Model.site_payment model = new BLL.site_payment().GetModel(site_payment_id); //站点支付方式 if (model != null) { Model.payment payModel = new BLL.payment().GetModel(model.payment_id); //支付平台 Model.sites siteModel = new BLL.sites().GetModel(model.site_id); //站点配置 Model.sysconfig sysConfig = new BLL.sysconfig().loadConfig(); //系统配置 partner = model.key1; //商户号(必须配置) key = model.key2; //商户支付密钥,参考开户邮件设置(必须配置) appid = model.key3; //绑定支付的APPID(必须配置) //回调处理地址 if (!string.IsNullOrEmpty(siteModel.domain.Trim()) && siteModel.is_default == 0) //如果有自定义域名且不是默认站点 { notify_url = "http://" + siteModel.domain + payModel.notify_url; } else if (siteModel.is_default == 0) //不是默认站点也没有绑定域名 { notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.notify_url; } else //否则使用当前域名 { notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.notify_url; } } }
public JsApiConfig(int site_payment_id) { Model.site_payment model = new BLL.site_payment().GetModel(site_payment_id); //站点支付方式 if (model != null) { Model.payment payModel = new BLL.payment().GetModel(model.payment_id); //支付平台 Model.sites siteModel = new BLL.sites().GetModel(model.site_id); //站点配置 Model.sysconfig sysConfig = new BLL.sysconfig().loadConfig(); //系统配置 partner = model.key1; //商户号(必须配置) key = model.key2; //商户支付密钥,参考开户邮件设置(必须配置) appid = model.key3; //绑定支付的APPID(必须配置) appsecret = model.key4; //公众帐号secert(仅JSAPI支付的时候需要配置) //获取用户的OPENID回调地址及登录后的回调地址 if (!string.IsNullOrEmpty(siteModel.domain.Trim()) && siteModel.is_default == 0) //如果有自定义域名且不是默认站点 { redirect_url = "http://" + siteModel.domain + payModel.return_url; //获取用户的OPENID回调地址 notify_url = "http://" + siteModel.domain + payModel.notify_url; //登录后的回调地址 } else if (siteModel.is_default == 0) //不是默认站点也没有绑定域名 { redirect_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.notify_url; } else //否则使用当前域名 { redirect_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.notify_url; } } }
/// <summary> /// 获取OAuth配置信息 /// </summary> public static oauth_config get_config(int site_oauth_id) { //读取接口配置信息 Model.site_oauth model = new BLL.site_oauth().GetModel(site_oauth_id); if (model != null) { Model.siteconfig sysConfig = new BLL.siteconfig().loadConfig(); //系统配置 Model.sites siteModel = new BLL.sites().GetModel(model.site_id); //站点配置 Model.oauth_app appModel = new BLL.oauth_app().GetModel(model.oauth_id); //OAuth应用 //赋值 oauth_config config = new oauth_config(); config.oauth_id = model.id; config.oauth_name = appModel.api_path.Trim(); config.oauth_app_id = model.app_id.Trim(); config.oauth_app_key = model.app_key.Trim(); config.site_path = siteModel.build_path; if (!string.IsNullOrEmpty(siteModel.domain.Trim()) && siteModel.is_default == 0) //如果有自定义域名且不是默认站点 { config.return_uri = "http://" + siteModel.domain + "/api/oauth/return_url.aspx"; } else if (siteModel.is_default == 0) //不是默认站点也没有绑定域名 { config.return_uri = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + "/api/oauth/return_url.aspx"; } else //否则使用当前域名 { config.return_uri = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + "api/oauth/return_url.aspx"; } return(config); } return(null); }
public void ProcessRequest(HttpContext context) { JC.Model.sites msite = new Model.sites(); JC.Model.posts mpost = new Model.posts(); JC.BLL.sites bsites = new BLL.sites(); JC.BLL.posts bposts = new BLL.posts(); var tbs = "msgs"; key = obj["siteKey"].ToString(); context.Response.ContentType = "text/plain"; var name = context.Request.Form["name"]; var mobile = context.Request.Form["mobile"]; var info = context.Request.Form["info"]; var ua = context.Request.Form["ua"]; var date = DateTime.Now.ToString(); var res = ""; msite = bsites.GetList()[0]; try { var mailFrom = msite.mail; var mailPwd = JC.Common.DESEncrypt.Decrypt(msite.mailpwd, key);//破解密码 var smtpServer = msite.mailsmtp; var smtpPort = msite.mailport; var mailToList = new List <string>(); var tit = "客户" + name + ",手机" + mobile + ",发过来的咨询邮件--" + msite.title; var bod = @"<p>用户名称:<b>" + name + "</b></p>"; bod += "<p>用户手机:<b>" + mobile + ":</b></p>"; bod += "<p>UA:<b>" + ua + ":</b></p>"; bod += @"<hr />"; bod += @"<p>咨询内容:<b>" + info + "</b></p>"; bod += @"<p style='text-align:right'>" + date + "</p>"; JC.Common.Common.MultiSendEmail(smtpServer, smtpPort, mailFrom, mailPwd, mailToList, null, null, tit, bod, null, true); //插入数据库 mpost.postby = name; mpost.postdate = DateTime.Now; mpost.modifydate = DateTime.Now; mpost.content = info; mpost.ext1 = mobile; mpost.enable = 0; mpost.read = 0; mpost.ext = tbs;//VIP code bposts.Add(mpost); res = "{status:\"1\",msg:\"邮件发送成功!\"}"; } catch (Exception) { res = "{status:\"0\",msg:\"邮件发送失败!\"}"; throw; } context.Response.Write(res); }
private void RptBind() { BLL.sites bll = new BLL.sites(); DataSet ds = bll.GetList(0, "is_lock=0", "sort_id asc,id desc"); this.rptList.DataSource = ds; this.rptList.DataBind(); }
private string GetLinkDomain() { Model.site_channel channelModel = new BLL.site_channel().GetModel(this.channel_id); Model.sites siteModel = new BLL.sites().GetModel(channelModel.site_id); if (siteModel == null || string.IsNullOrEmpty(siteModel.domain)) { return(sysConfig.weburl); } return(siteModel.domain); }
private void SiteBind() { BLL.sites bll = new BLL.sites(); DataTable dt = bll.GetList(0, "is_lock=0", "sort_id asc,id desc").Tables[0]; this.ddlSiteId.Items.Clear(); this.ddlSiteId.Items.Add(new ListItem("请选择站点...", "")); foreach (DataRow dr in dt.Rows) { this.ddlSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString())); } }
private bool DoEdit(int _id) { bool result = false; BLL.sites bll = new BLL.sites(); Model.sites model = bll.GetModel(_id); model.parent_id = int.Parse(ddlParentId.SelectedValue); model.title = txtTitle.Text.Trim(); model.build_path = txtBuildPath.Text.Trim(); model.domain = txtDomain.Text.Trim(); model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99); if (cbIsDefault.Checked == true) { model.is_default = 1; } else { model.is_default = 0; } if (cbIsLock.Checked == true) { model.is_lock = 0; } else { model.is_lock = 0; } model.site_type = int.Parse(rblSiteType.SelectedValue); model.name = txtName.Text.Trim(); model.logo = txtLogo.Text.Trim(); model.company = txtCompany.Text.Trim(); model.address = txtAddress.Text.Trim(); model.tel = txtTel.Text.Trim(); model.fax = txtFax.Text.Trim(); model.email = txtEmail.Text.Trim(); model.crod = txtCrod.Text.Trim(); model.seo_title = txtSeoTitle.Text.Trim(); model.seo_keyword = txtSeoKeyword.Text.Trim(); model.seo_description = Utils.DropHTML(txtSeoDescription.Text); model.copyright = txtCopyright.Text.Trim(); if (bll.Update(model)) { CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN); //更新一下域名缓存 AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志 result = true; } return(result); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.sites bll = new BLL.sites(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("site_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { Model.sites model = new Model.sites(); BLL.sites bll = new BLL.sites(); model.title = txtTitle.Text.Trim(); model.build_path = txtBuildPath.Text.Trim(); model.domain = txtDomain.Text.Trim(); model.sort_id = ConvertTool.ToInt(txtSortId.Text.Trim(), 99); if (cbIsDefault.Checked == true) { model.is_default = 1; } else { model.is_default = 0; } if (cbIsLock.Checked == true) { model.is_lock = 0; } else { model.is_lock = 0; } model.name = txtName.Text.Trim(); model.logo = txtLogo.Text.Trim(); model.company = txtCompany.Text.Trim(); model.address = txtAddress.Text.Trim(); model.tel = txtTel.Text.Trim(); model.fax = txtFax.Text.Trim(); model.email = txtEmail.Text.Trim(); model.crod = txtCrod.Text.Trim(); model.seo_title = txtSeoTitle.Text.Trim(); model.seo_keyword = txtSeoKeyword.Text.Trim(); model.seo_description = Utils.DropHTML(txtSeoDescription.Text); model.copyright = txtCopyright.Text.Trim(); if (bll.Add(model) > 0) { //更新一下域名缓存 CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN); AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加站点:" + model.title); //记录日志 return(true); } return(false); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.sites bll = new BLL.sites(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateSort(id, sortId); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存站点排序"); //记录日志 JscriptMsg("保存排序成功!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree"); }
private void TreeBind() { BLL.sites bll = new BLL.sites(); DataTable dt = bll.GetList(0, "", "sort_id asc,id desc").Tables[0]; this.ddlSitePath.Items.Clear(); this.ddlSitePath.Items.Add(new ListItem("生成模板到", "")); foreach (DataRow dr in dt.Rows) { if (string.IsNullOrEmpty(dr["templet_path"].ToString())) { this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString(), dr["build_path"].ToString())); } else { this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString() + "(当前模板:" + dr["templet_path"].ToString() + ")", dr["build_path"].ToString())); } } }
private void ShowInfo(int _id) { BLL.sites bll = new BLL.sites(); Model.sites model = bll.GetModel(_id); txtTitle.Text = model.title; txtBuildPath.Text = model.build_path; txtBuildPath.Attributes.Add("ajaxurl", "../../tools/admin_ajax.ashx?action=site_path_validate&old_build_path=" + Utils.UrlEncode(model.build_path)); txtBuildPath.Focus(); //设置焦点,防止JS无法提交 txtDomain.Text = model.domain; txtSortId.Text = model.sort_id.ToString(); if (model.is_default == 1) { cbIsDefault.Checked = true; } else { cbIsDefault.Checked = false; } if (model.is_lock == 0) { cbIsLock.Checked = true; } else { cbIsLock.Checked = false; } ddlParentId.SelectedValue = model.parent_id.ToString(); rblSiteType.SelectedValue = model.site_type.ToString(); txtName.Text = model.name; txtLogo.Text = model.logo; txtCompany.Text = model.company; txtAddress.Text = model.address; txtTel.Text = model.tel; txtFax.Text = model.fax; txtEmail.Text = model.email; txtCrod.Text = model.crod; txtSeoTitle.Text = model.seo_title; txtSeoKeyword.Text = model.seo_keyword; txtSeoDescription.Text = model.seo_description; txtCopyright.Text = model.copyright; }
public Config(int site_payment_id) { Model.site_payment model = new BLL.site_payment().GetModel(site_payment_id); //站点支付方式 if (model != null) { Model.payment payModel = new BLL.payment().GetModel(model.payment_id); //支付平台 Model.sites siteModel = new BLL.sites().GetModel(model.site_id); //站点配置 Model.siteconfig sysConfig = new BLL.siteconfig().loadConfig(); //系统配置 //收款支付宝账号 seller_email = model.key1; //合作身份者ID,以2088开头由16位纯数字组成的字符串 partner = model.key2; //如果签名方式设置为“MD5”时,请设置该参数 key = model.key3; //商户的私钥,如果签名方式设置为“0001”时,请设置该参数 private_key = @""; //支付宝的公钥,如果签名方式设置为“0001”时,请设置该参数 public_key = @""; //回调处理地址 if (!string.IsNullOrEmpty(siteModel.domain.Trim()) && siteModel.is_default == 0) //如果有自定义域名且不是默认站点 { return_url = "http://" + siteModel.domain + payModel.return_url; notify_url = "http://" + siteModel.domain + payModel.notify_url; } else if (siteModel.is_default == 0) //不是默认站点也没有绑定域名 { return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.notify_url; } else //否则使用当前域名 { return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.notify_url; } //字符编码格式 目前支持 utf-8 input_charset = "utf-8"; //签名方式,选择项:0001(RSA)、MD5 sign_type = "MD5";//无线的产品中,签名方式为rsa时,sign_type需赋值为0001而不是RSA } }
private void SiteBind(int _id) { string strWhere = string.Empty; if (_id > 0) { strWhere = "is_lock=0 and parent_id=0 and id<>" + _id; } else { strWhere = "is_lock=0 and parent_id=0"; } BLL.sites bll = new BLL.sites(); DataTable dt = bll.GetList(0, strWhere, "sort_id asc,id desc").Tables[0]; this.ddlParentId.Items.Clear(); this.ddlParentId.Items.Add(new ListItem("不基于其它站点", "0")); foreach (DataRow dr in dt.Rows) { this.ddlParentId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString())); } }
public Config(int site_payment_id) { Model.site_payment model = new BLL.site_payment().GetModel(site_payment_id); //站点支付方式 if (model != null) { Model.payment payModel = new BLL.payment().GetModel(model.payment_id); //支付平台 Model.sites siteModel = new BLL.sites().GetModel(model.site_id); //站点配置 Model.sysconfig sysConfig = new BLL.sysconfig().loadConfig(); //系统配置 //签约支付宝账号或卖家支付宝帐户 email = model.key1; //合作身份者ID,以2088开头由16位纯数字组成的字符串 partner = model.key2; //交易安全检验码,由数字和字母组成的32位字符串 key = model.key3; //回调处理地址 if (!string.IsNullOrEmpty(siteModel.domain.Trim()) && siteModel.is_default == 0) //如果有自定义域名且不是默认站点 { return_url = "http://" + siteModel.domain + payModel.return_url; notify_url = "http://" + siteModel.domain + payModel.notify_url; } else if (siteModel.is_default == 0) //不是默认站点也没有绑定域名 { return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + siteModel.build_path.ToLower() + payModel.notify_url; } else //否则使用当前域名 { return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.return_url; notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + sysConfig.webpath + payModel.notify_url; } //字符编码格式 目前支持 gbk 或 utf-8 input_charset = "utf-8"; //签名方式 不需修改 sign_type = "MD5"; } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.sites bll = new BLL.sites(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { //检查该分类下是否还有频道 int channelCount = new BLL.site_channel().GetCount("site_id=" + id); if (channelCount > 0) { errorCount += 1; continue; } Model.sites model = bll.GetModel(id); //删除成功后对应的目录及文件 if (bll.Delete(id)) { sucCount += 1; FileHelp.DeleteDirectory(sysConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + model.build_path); FileHelp.DeleteDirectory(sysConfig.webpath + DTKeys.DIRECTORY_REWRITE_HTML + "/" + model.build_path); } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除站点成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree"); }
private void site_path_validate(HttpContext context) { string build_path = DTRequest.GetString("param"); string old_build_path = DTRequest.GetString("old_build_path"); if (string.IsNullOrEmpty(build_path)) { context.Response.Write("{ \"info\":\"该目录名不可为空!\", \"status\":\"n\" }"); return; } if (build_path.ToLower() == old_build_path.ToLower()) { context.Response.Write("{ \"info\":\"该目录名可使用\", \"status\":\"y\" }"); return; } BLL.sites bll = new BLL.sites(); if (bll.Exists(build_path)) { context.Response.Write("{ \"info\":\"该目录名已被占用,请更换!\", \"status\":\"n\" }"); return; } context.Response.Write("{ \"info\":\"该目录名可使用\", \"status\":\"y\" }"); return; }