Exemplo n.º 1
0
        private void InitWebControl()
        {
            SOSOshop.BLL.SysParameter            sp  = new SOSOshop.BLL.SysParameter();
            YXShop.BLL.SystemInfo.ArticleChannel bll = new YXShop.BLL.SystemInfo.ArticleChannel();
            string channelid = ChangeHope.WebPage.PageRequest.GetQueryString("channelid");

            bll.GetDropList(this.ddlChannel, ""); if (channelid != "")
            {
                try { this.ddlChannel.SelectedValue = channelid; }catch {}
            }
            bll = null;
            this.txtArea.Attributes.Add("readonly", "readonly");
            this.txtArea.Attributes.Add("onclick", "selectFile('Area',new Array(" + this.txtAreaValue.ClientID + "," + this.txtArea.ClientID + "),310,450,'" + sp.DummyPaht + "');");
            ChangeHope.WebPage.WebControl.Validate(this.txtTitle, "资讯标题,2~50个字符", "isnull_2_50", "必填", "该项为必填");
            ChangeHope.WebPage.WebControl.Validate(this.txtSubTitle, "副标题,选填项目", "no", "", "");
            ChangeHope.WebPage.WebControl.Validate(this.txtKeyWord, "关键字,多个关键字用逗号(,)隔开,该关键字将会直接关联相关的其他内容", "isnull", "必填", "该项为必填");
            ChangeHope.WebPage.WebControl.Validate(this.txtCopyFrom, "如果该文章属于转载,则需要填写转载的地址", "no", "", "");
            ChangeHope.WebPage.WebControl.Validate(this.txtLinkUrl, "如果该文章是直接指向某个链接地址,则填写链接地址", "no", "", "");
            ChangeHope.WebPage.WebControl.Validate(this.txtAuthor, "如果有作者的信息,则需要填写作者信息", "no", "", "");
            ChangeHope.WebPage.WebControl.Validate(this.txtIntroduction, "简介内容,对于该篇文章的简介内容", "no", "", "");
            ChangeHope.WebPage.WebControl.Validate(this.txtArea, "该文章属于哪个分站的内容,不填写则不属于任何分站,只属于该主站内容", "no", "", "");
            this.Form.Attributes.Add("onsubmit", "return CheckForm();");

            if (!sp.IsCloseStation)
            {
                this.txtArea.Enabled = false;
            }
        }
Exemplo n.º 2
0
        private void GetFileList1()
        {
            /*
             * 修改人:ym
             * 修改时间:2009-8-26
             * 修改内容:添加
             */
            SOSOshop.BLL.SysParameter    sp   = new SOSOshop.BLL.SysParameter();
            ChangeHope.Common.FileHelper file = new ChangeHope.Common.FileHelper();

            StringBuilder filelist = new StringBuilder();

            file.rootUrl = Server.MapPath("~/" + sp.WebSiteTemplatePath);
            file.listFiles(file.rootUrl, 0);

            filelist.AppendLine("<script type=\"text/javascript\">");
            filelist.AppendLine("d = new dTree('d');");
            filelist.AppendLine("d.add(0,-1,'请选择模版');");
            filelist.AppendLine(file.fileTree.ToString());
            filelist.AppendLine("document.write(d);");
            filelist.AppendLine("$(\"fileLists\").style.visibility=\"hidden\";");
            filelist.AppendLine("</script>");
            this.ltlFileList.Text = filelist.ToString();
            file = null;
        }
 private void InitWebControl()
 {
     SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
     this.txtArea.Attributes.Add("readonly", "readonly");
     this.txtArea.Attributes.Add("onclick", "selectFile('Area',new Array(" + this.hfAread.ClientID + "," + this.txtArea.ClientID + "),310,450,'" + sp.DummyPaht + "');");
     ChangeHope.WebPage.WebControl.Validate(this.txtSiteName, "输入链接网站的名称", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtSiteUrl, "输入网站的链接地址", "ishttpurl", "必填", "该项为必填项,注意链接地址格式");
     ChangeHope.WebPage.WebControl.Validate(this.txtSiteLevel, "请选择链接的优先级,数字越大优先级别越高", "isint", "必填", "该项必须为数字类型");
     ChangeHope.WebPage.WebControl.Validate(this.txtSiteClickCount, "输入数字将作为图片广告的宽", "isint", "必填", "该项必须为数字类型");
     this.Form.Attributes.Add("onsubmit", "return CheckForm()");
 }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SOSOshop.BLL.AdministrorManager.CheckAdmin();
         SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
         WebName  = sp.WebSiteName;
         WebTitle = sp.WebSiteTitle;
         if (Request.QueryString["ClearCache"] != null)//清除缓存
         {
             SOSOshop.BLL.DbBase db1 = new SOSOshop.BLL.DbBase(); db1.ClearCache();
             Response.Redirect("admin_index.aspx"); Response.End();
         }
         ChangeHope.DataBase.SQLServerHelper.connectionString = new SOSOshop.BLL.Db()._db.ConnectionString;
     }
 }
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            SOSOshop.BLL.SysParameter           sp       = new SOSOshop.BLL.SysParameter();
            ChangeHope.WebPage.Table            table    = new ChangeHope.WebPage.Table();
            YXShop.BLL.Accessories.Top_Searches data     = new YXShop.BLL.Accessories.Top_Searches();
            ChangeHope.DataBase.DataByPage      dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("10%", "序号");
            table.AddHeadCol("40%", "关键词");
            table.AddHeadCol("15%", "排序");
            table.AddHeadCol("20%", "状态");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol("No." + No);
                    table.AddCol("<a href=\"" + dataPage.DataReader["linkad"].ToString() + "\">" + dataPage.DataReader["name"].ToString() + "</a>");
                    table.AddCol(string.Format("<input id='sort{0}' value='{1}' size='5' onblur='Sort({0},{1})'/>", dataPage.DataReader["id"].ToString(), dataPage.DataReader["sort"].ToString()));
                    table.AddCol(string.Format("<img src='../images/{0}.gif'/>", dataPage.DataReader["isshow"].ToString()));
                    table.AddCol(string.Format("<a href=topsearchesseting_edit.aspx?id={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;

            dataPage.Dispose();
            dataPage = null;
            return(view);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            SOSOshop.BLL.SysParameter      sp       = new SOSOshop.BLL.SysParameter();
            ChangeHope.WebPage.Table       table    = new ChangeHope.WebPage.Table();
            SOSOshop.BLL.Role              data     = new SOSOshop.BLL.Role();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("10%", "序号");
            table.AddHeadCol("25%", "角色名");
            table.AddHeadCol("40%", "描述");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol("No." + No);
                    table.AddCol(dataPage.DataReader["name"].ToString());
                    table.AddCol(dataPage.DataReader["description"].ToString());
                    table.AddCol(string.Format("<a href=role_edit.aspx?id={0}>编辑</a> <a href='role_setmember.aspx?id={0}'>设置成员</a> <a href='popedom_manage.aspx?id={0}'>权限管理</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;

            dataPage.Dispose();
            dataPage = null;
            return(view);
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //#if DEBUG
                //                    //测试编译状态不用登陆
                //                    string pwd = ChangeHope.Common.DEncryptHelper.Encrypt("101administrator", 1);
                //                    bool loginResult = false;
                //                    YXShop.BLL.Admin.Administrators administrators = new YXShop.BLL.Admin.Administrators();
                //                    loginResult = AdminLogin("admin", pwd);
                //                    if (loginResult)
                //                    {
                //                         Response.Redirect("admin_index.aspx", true);
                //                    }
                //#endif

                if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != string.Empty && ChangeHope.WebPage.PageRequest.GetFormString("id") != string.Empty)
                {
                    string types = Request.Form["Option"].Trim();
                    string StrID = ChangeHope.WebPage.PageRequest.GetFormString("id");
                    if (types == "sendAdminLoginCheckCode")
                    {
                        string userLoginName = ChangeHope.WebPage.PageRequest.GetFormString("toUID");
                        string userLoginPwd  = ChangeHope.WebPage.PageRequest.GetFormString("toPWD");
                        userLoginPwd = ChangeHope.Common.DEncryptHelper.Encrypt(userLoginPwd, 1);
                        SOSOshop.BLL.Administrators   bll   = new SOSOshop.BLL.Administrators();
                        SOSOshop.Model.Administrators model = bll.GetModelByAdminName(userLoginName);
                        string message = "";
                        //无数据
                        if (model == null)
                        {
                            message = "用户名错误!";
                        }
                        //密码错误
                        else if (!model.PassWord.ToLower().Equals(userLoginPwd.ToLower()))
                        {
                            message = "密码错误!";
                        }
                        //帐号被冻结
                        else if (model.State.Equals(1))
                        {
                            message = "您输入的账户以被冻结!";
                        }
                        //帐号已经过期
                        else if (model.ManageEndTime < DateTime.Now)
                        {
                            message = "你的帐户已经过期!";
                        }
                        else
                        {
                            string DstMobile = Convert.ToString(new SOSOshop.BLL.Db().ExecuteScalar("select LoginAuthenticationOfficePhone from yxs_administrators where adminid = " + model.AdminId)).Trim();
                            if (DstMobile.Trim() == "")
                            {
                                message = "no";
                            }
                            else
                            {
                                //设置Cookies 2分钟
                                string     checkCode = ChangeHope.Common.DEncryptHelper.GetRandWord(5);
                                HttpCookie cookie    = new HttpCookie("CheckCode", checkCode);
                                cookie.Expires = DateTime.Now.AddMinutes(-1000);
                                Response.Cookies.Add(cookie);
                                cookie         = new HttpCookie("CheckCode", checkCode);
                                cookie.Expires = DateTime.Now.AddMinutes(2);
                                Response.Cookies.Add(cookie);
                                //发送短信
                                ChangeHope.WebPage.Sms sms = new ChangeHope.WebPage.Sms();
                                string SmsMsg = model.Name + ",101后台管理员," + "需要登陆后台,请告知验证码:" + checkCode + "\r\n"; if (SmsMsg.Length > 120)
                                {
                                    SmsMsg = SmsMsg.Substring(0, 120);
                                }
                                string from    = "登陆后台的验证码";
                                string to      = model.Name;
                                bool   Success = false;
                                Success = (sms.Send(DstMobile, SmsMsg, from, to));
                                if (ChangeHope.WebPage.PageRequest.GetFormInt("add") != -1)
                                {
                                    sms.SaveDataBase(DstMobile, SmsMsg, from, to, Success);
                                }
                                else
                                {
                                    sms.UpdateDataBase(int.Parse(StrID), DstMobile, SmsMsg, from, to, Success);
                                }
                                if (Success)
                                {
                                    message = "ok";
                                    string adminname = Convert.ToString(new SOSOshop.BLL.Db().ExecuteScalar("select name from yxs_administrators where OfficePhone = '" + DstMobile + "'"));
                                    message += "," + from + "已经发送给" + (adminname.Trim() != "" ? adminname : DstMobile);
                                    ArrayList smsRecord = new ArrayList();
                                    if (Session["smsRecord"] != null)
                                    {
                                        smsRecord = Session["smsRecord"] as ArrayList;
                                    }
                                    if (smsRecord != null)
                                    {
                                        smsRecord.Add(checkCode);
                                    }
                                    Session["smsRecord"] = smsRecord;
                                }
                                else
                                {
                                    message = "短信发送失败!";
                                }
                            }
                        }
                        Response.Write(message);
                    }
                    Response.End();
                    return;
                }

                SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
                WebName = sp.WebSiteName;
                if (SOSOshop.BLL.AdministrorManager.Get() != null)
                {
                    ChangeHope.WebPage.Script.Alert("提示:您已经登陆成功,转向后台管理页面");
                    ChangeHope.WebPage.Script.ParentPageRedirect(sp.DummyPaht + "admin/admin_index.aspx");
                    return;
                }
            }
        }
Exemplo n.º 8
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
     #region
     //是否允许注册新用户
     if (!sp.IsRegistered)
     {
         ChangeHope.WebPage.Script.AlertAndGoBack("温馨提示:目前不允许新用户注册!");
     }
     else
     {
         if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != string.Empty)
         {
             context.Response.Clear();
             string types = context.Request.Form["Option"].Trim();
             if (types == "NewRegisteredMembers" && context.Session["DoNotTipForNewRegisteredMembers"] == null)
             {
                 if (context.Request.Form["DoNotTip"] != null && context.Request.Form["DoNotTip"] == "Yes")
                 {
                     context.Session["DoNotTipForNewRegisteredMembers"] = true;
                     context.Response.End();
                     return;
                 }
                 string          json = "";//获取这两天刚注册的未导入CRM的会员
                 SOSOshop.BLL.Db db   = new SOSOshop.BLL.Db();
                 DataSet         ds   = db.ExecuteDataSet("SELECT a.UID,a.UserId,a.Email,b.TrueName,b.MobilePhone,a.RegisterIP FROM yxs_memberaccount AS a INNER JOIN yxs_memberinfo AS b ON a.UID=b.UID WHERE datediff(DAY,RegisterDate,GETDATE())<=2 AND Member_Class=1 AND State=0 AND CRMID=0");
                 if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                 {
                     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                     {
                         DataRow dr = ds.Tables[0].Rows[i];
                         json += "{id:" + dr["UID"] + ",name:\"" + Convert.ToString(dr["UserId"]).Replace("\"", "") +
                                 "\",email:\"" + Convert.ToString(dr["Email"]).Replace("\"", "") +
                                 "\",truename:\"" + Convert.ToString(dr["TrueName"]).Replace("\"", "") +
                                 "\",mobilephone:\"" + Convert.ToString(dr["MobilePhone"]).Replace("\"", "") +
                                 "\",location:\"" + ChangeHope.WebPage.PageRequest.GetIPLocation(Convert.ToString(dr["RegisterIP"])).Replace("\"", "") + "\"},";
                     }
                     if (json != "")
                     {
                         json = json.Substring(0, json.Length - 1);
                     }
                     json = "{result:[" + json + "]}";
                 }
                 context.Response.Write(json);
                 context.Response.End();
                 return;
             }
             else if (types == "NewRegisteredMembersDebug")
             {
                 string json = "";
                 for (int i = 1; i < 10; i++)
                 {
                     json += "{id:" + i + ",name:\"会员名" + i + "\"},";
                 }
                 if (json != "")
                 {
                     json = json.Substring(0, json.Length - 1);
                 }
                 json = "{result:[" + json + "]}";
                 context.Response.Write(json);
                 context.Response.End();
                 return;
             }
         }
     }
     #endregion
 }
        /// <summary>
        /// 保存
        /// </summary>
        protected void Save()
        {
            YXShop.BLL.Accessories.Hailhellowlink   bll   = new YXShop.BLL.Accessories.Hailhellowlink();
            YXShop.Model.Accessories.Hailhellowlink model = new YXShop.Model.Accessories.Hailhellowlink();
            SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
            model.SiteName = this.txtSiteName.Text.Trim();
            model.SiteUrl  = this.txtSiteUrl.Text.Trim();
            if (this.txtSiteLogo.Text.Trim() != null && this.txtSiteLogo.Text.Trim() != "" && !this.fuSmallImages.HasFile)
            {
                model.SiteLogo = this.txtSiteLogo.Text.Trim();
            }
            else
            {
                //获取图片
                ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                uf.ExtensionLim  = ".gif,.jpg,.jpeg,.dmp";
                uf.FileLengthLim = sp.ImageSize;
                uf.PostedFile    = this.fuSmallImages;
                uf.SavePath      = "/yxuploadfile/brand";
                if (uf.Upload())
                {
                    if (uf.HaveLoad)
                    {
                        model.SiteLogo = uf.FilePath;
                    }
                    else
                    {
                        if (ViewState["SiteImages"] != null)
                        {
                            model.SiteLogo = ViewState["SiteImages"].ToString();
                        }
                        else
                        {
                            model.SiteLogo = string.Empty;
                        }
                    }
                }
                else
                {
                    this.ltlMsg.Text     = "操作失败," + uf.Message + "";
                    this.pnlMsg.Visible  = true;
                    this.pnlMsg.CssClass = "actionErr";
                    return;
                }
            }
            //model.SiteLogo = this.txtSiteLogo.Text.Trim();
            model.SiteLevel      = Convert.ToInt32(this.txtSiteLevel.Text.Trim());
            model.SiteContent    = this.txtSiteContent.Text.Trim();
            model.SiteLinkType   = Convert.ToInt32(this.rablistLinkType.SelectedValue);
            model.SiteState      = Convert.ToInt32(this.rablistSiteState.SelectedValue);
            model.SiteClickCount = this.txtSiteClickCount.Text == string.Empty ? 0 : Convert.ToInt32(this.txtSiteClickCount.Text.Trim());
            model.Aread          = this.hfAread.Value != string.Empty ? this.hfAread.Value : "0";



            if (ViewState["ID"] != null)
            {
                model.ID         = Convert.ToInt32(ViewState["ID"].ToString());
                model.PutoutID   = Convert.ToInt32(ViewState["PutoutID"]);
                model.PutoutTyID = Convert.ToInt32(ViewState["PutoutTyID"]);
                model.UpdateDate = DateTime.Now;
                model.CreateDate = Convert.ToDateTime(ViewState["CreateDate"].ToString());
                bll.Amend(model);
                this.ltlMsg.Text = "操作成功,已保存该信息";
                this.BandInfo(model.ID);//刷新
                this.pnlMsg.Visible  = true;
                this.pnlMsg.CssClass = "actionOk";
            }
            else
            {
                //添加时的类型
                model.PutoutTyID = 0;
                SOSOshop.Model.AdminInfo adminModel = (SOSOshop.Model.AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                //管理员ID
                model.PutoutID   = adminModel.AdminId;
                model.CreateDate = DateTime.Now;
                model.UpdateDate = DateTime.Now;
                bll.Add(model);
                this.ltlMsg.Text     = "操作成功,已添加该信息";
                this.pnlMsg.Visible  = true;
                this.pnlMsg.CssClass = "actionOk";
            }
        }