Exemple #1
0
    protected void editClass_Click(object sender, EventArgs e)
    {
        string cid           = DropDownListClass.Text.Trim();
        string classNameTemp = className.Text.Trim();

        if (!String.IsNullOrEmpty(classNameTemp as string))
        {
            strValue[0] = classNameTemp;
            strValue[1] = classUrl.Text;
            strValue[2] = tk.Text;
            strValue[3] = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");
            xc.insertMyLog(xc.adminID, "admin", "修改分类:" + classNameTemp);
            string returnStr = db.InsertUpdateDB("NewsTree", "@TreeName,@TreeUrl,@taobaoKe,@PostDate", strValue, "Tid=" + cid + " and TreeType='" + typeClss + "'");

            string strSql = "select Tid from newsTree where Tid=" + cid;
            strSql += " union select Tid from newsTree where idLayerStr like '%|" + cid + "|%'";
            DataTable dt = db.getDataTable(strSql);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                xClass.treeNameUpdate(xc.SafeNum(dt.Rows[i]["Tid"].ToString().Trim()));
            }
            dt.Dispose();

            xc.divError("", returnStr, 350, 150, "ClassList.aspx?tClass=" + typeClss, "goto");
        }
        else
        {
            xc.divError("", "请填写分类名称!", 350, 150, "ClassList.aspx?tClass=" + typeClss, "goto");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin("|adminExe|");

        if (!IsPostBack)
        {
            string    strSqlread = "select UserID,UserName,UserAdmin from AdminUser where userID='" + xc.SafeSql(Request["id"].Trim()) + "'";
            DataTable dtRead     = db.getDataTable(strSqlread);
            if (dtRead.Rows.Count > 0 && xc.SafeSql(Request["id"].Trim()) != xc.adminID)
            {
                if (dtRead.Rows[0]["UserAdmin"].ToString().Trim().Equals("xabaraCOM"))
                {
                    xc.divError("", dtRead.Rows[0]["UserID"].ToString().Trim() + " 已是超级管理员,不需设置相应权限!", 380, 150, "userList.aspx", "goto");
                }
                string userAdminStr = dtRead.Rows[0]["UserAdmin"].ToString();

                uid.Text = dtRead.Rows[0]["UserName"].ToString() + "[" + dtRead.Rows[0]["UserID"].ToString() + "]";
                DataTable dt;

                dt = db.getDataTable("select * from classAdmin order by listID ASC ");
                if (dt.Rows.Count > 0)
                {
                    string ifType  = string.Empty;
                    string bgColor = string.Empty;
                    selectPopedomHtm.Text = "<table border='0' align='left' class='tableAdminLine'><tr>";
                    for (int p = 0; p < dt.Rows.Count; p++)
                    {
                        if (!ifType.Equals(dt.Rows[p]["listClass"].ToString().Trim()) && p > 0)  //控制回车
                        {
                            selectPopedomHtm.Text += "</tr><tr>";
                        }
                        ifType = dt.Rows[p]["listClass"].ToString().Trim();

                        string selectValue = dt.Rows[p]["classCode"].ToString().Trim();
                        string selectBool  = string.Empty;
                        if (userAdminStr.IndexOf(@"|" + selectValue + "|") >= 0)
                        {
                            selectBool = @" checked='checked'";
                        }

                        selectPopedomHtm.Text += "<td style='background-color:#f5fdfe;'><input name='adminPopedomSelect' type='checkbox' id='adminPopedomSelect' value='" + selectValue + "'" + selectBool + " />" + dt.Rows[p]["className"].ToString().Trim() + "</td>";
                    }
                    selectPopedomHtm.Text += "</tr></table>";
                }
                dt.Dispose();
            }
            else
            {
                xc.divError("", "您的操作有误!", 350, 150, "userList.aspx", "goto");
            }
            dtRead.Dispose();
        }
    }
Exemple #3
0
    protected void del_Click(object sender, EventArgs e)
    {
        string ids = Request["batDel"];

        if (!string.IsNullOrEmpty(ids as string))
        {
            string returnStr = db.DelDB("taobaoKe", "id", ids, "", false, "");
            Response.Redirect(Server.UrlDecode(xc.errorUrlTwo), true);
        }
        else
        {
            xc.divError("", "请先选择后再操作!", 350, 150, Server.UrlDecode(xc.errorUrlTwo) + "#foot", "goto");
        }
    }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        xc.CheckAdminLogin("|adminDel|");

        if (!xc.adminID.Equals(xc.SafeSql(Request["id"].Trim()).ToString()))
        {
            string returnValue = new dbDataFunction().DelDB("AdminUser", "UserId", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, string.Empty);

            xc.insertMyLog(xc.adminID, "admin", "删除管理员");

            xc.divError("", returnValue, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不会吧,删除自己呀!", 350, 150, "userList.aspx", "goto");
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adminDel|");

        if (!xc.adminID.Equals(xc.SafeSql(Request["id"].Trim()).ToString()))
        {
            string returnValue = new dbDataFunction().DelDB("AdminUser", "UserId", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, string.Empty);

            xc.insertMyLog(xc.adminID, "admin", "删除管理员");

            xc.divError("", returnValue, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不会吧,删除自己呀!", 350, 150, "userList.aspx", "goto");
        }
    }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adminPW|");

        string idTemp = xc.SafeNum(Request["id"].Trim()).ToString();
        string dimStr = "@UserPW";
        string[] strValue = new string[1];
        string strVlaueTemp = xc.GetRnd("abc", 1) + xc.GetRnd("abc123", 7).ToLower();
        strValue[0] = xc.GetMd5(strVlaueTemp).ToString();

        if (new dbDataFunction().InsertUpdateDB("AdminUser", dimStr, strValue, "Uid=" + idTemp + " and UserId<>'" + xc.adminID + "'").Equals("更新成功"))
        {
            xc.insertMyLog(xc.adminID, "admin", "管理员密码初始化");
            xc.divError("", "新密码:" + strVlaueTemp, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不能给自己密码初始化或操作错误!", 350, 150, "userList.aspx", "goto");
        }
    }
Exemple #7
0
    protected void waterImgButton_Click(object sender, EventArgs e)
    {
        if (waterImgFileUpload.HasFile)    //本地上传
        {
            string uploadFloderImg = "/images/";
            if (!Directory.Exists(Server.MapPath(uploadFloderImg))) //判断上传目录是否存在
            {
                Directory.CreateDirectory(Server.MapPath(uploadFloderImg));
            }

            string fileName = waterImgFileUpload.PostedFile.FileName.ToLower();
            if (fileName == string.Empty || fileName == null)
            {
                xc.divError("", "请选择文件后再上传!", 350, 150, "", "");
            }

            string fileExe    = fileName.Substring(fileName.LastIndexOf(".") + 1);                                   //取后缀名
            long   UploadSize = xc.SafeNum(XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgSize")); //上传大小
            if (!fileExe.Equals("png"))                                                                              //判断该扩展名是否合法
            {
                xc.divError("", "请选择一张png格式的透明背景水印图!", 350, 150, "", "");
            }

            if (waterImgFileUpload.PostedFile.ContentLength > UploadSize) // 判断上传文件大小是否超过最大值
            {
                xc.divError("", "目前支持大小:" + Convert.ToString(UploadSize / 1048576) + "MB<br />当前大小为:" + Convert.ToString(waterImgFileUpload.PostedFile.ContentLength / 1048576) + "MB", 350, 150, "", "");
            }

            string UploadTemp = HttpContext.Current.Server.MapPath(@uploadFloderImg + "WaterMark.png");
            waterImgFileUpload.PostedFile.SaveAs(UploadTemp); //保存水印图片
            xc.divError("", "更换水印文件成功!", 350, 150, "", "");
        }
        else
        {
            xc.divError("", "请选择文件后再上传!", 350, 150, "", "");
        }
    }
Exemple #8
0
    protected void addAdmin_Click(object sender, EventArgs e)
    {
        string adminIDTemp = xc.SafeSql(adminID.Text.Trim().ToLower());
        string strSql      = "select * from AdminUser where userID='" + adminIDTemp + "'";

        if (db.getDataTable(strSql).Rows.Count > 0)
        {
            xc.divError("", "已存在该管理员!", 350, 150, "", "");
        }
        else
        {
            string dimStr = "@UserId,@UserName,@UserPW,@SessionError,@loginFlag,@LoginNum,@RegDate,@LoginDate,@LoginIP,@classID";

            string[] strValue = new string[10];
            strValue[0] = adminIDTemp;
            strValue[1] = adminName.Text.Trim();
            strValue[2] = xc.GetMd5(adminPW.Text.Trim());
            strValue[3] = "xabara.com";
            strValue[4] = "1";
            strValue[5] = "0";
            strValue[6] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            strValue[7] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            strValue[8] = xc.GetIP().ToString();
            strValue[9] = adminClass.Text;

            if (db.InsertUpdateDB("AdminUser", dimStr, strValue, string.Empty).Equals("发布成功"))
            {
                xc.insertMyLog(xc.adminID, "admin", "添加管理员:" + adminIDTemp);
                xc.divError("", "添加管理员成功,需对 " + adminName.Text.Trim() + " 进行权限设置后才可以正常登陆!", 500, 200, "userPopedom.aspx?id=" + adminIDTemp, "goto");
            }
            else
            {
                xc.divError("", "添加管理员失败!", 350, 150, "", "");
            }
        }
    }
Exemple #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adminPW|");

        string idTemp = xc.SafeNum(Request["id"].Trim()).ToString();
        string dimStr = "@UserPW";

        string[] strValue     = new string[1];
        string   strVlaueTemp = xc.GetRnd("abc", 1) + xc.GetRnd("abc123", 7).ToLower();

        strValue[0] = xc.GetMd5(strVlaueTemp).ToString();

        if (new dbDataFunction().InsertUpdateDB("AdminUser", dimStr, strValue, "Uid=" + idTemp + " and UserId<>'" + xc.adminID + "'").Equals("更新成功"))
        {
            xc.insertMyLog(xc.adminID, "admin", "管理员密码初始化");
            xc.divError("", "新密码:" + strVlaueTemp, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不能给自己密码初始化或操作错误!", 350, 150, "userList.aspx", "goto");
        }
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        xc.CheckAdminLogin("|adsDel|");

        dbDataFunction db = new dbDataFunction();
        string returnValue = string.Empty;

        long idTemp = xc.SafeNum(Request["id"].Trim());

        returnValue = db.DelDB("ads", "aID", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, "adImg");

        xc.insertMyLog(xc.adminID, "admin", "删除广告");

        xc.divError("", returnValue, 350, 150, Server.UrlDecode(xc.errorUrlTwo), "goto");
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adsDel|");

        dbDataFunction db          = new dbDataFunction();
        string         returnValue = string.Empty;

        long idTemp = xc.SafeNum(Request["id"].Trim());

        returnValue = db.DelDB("ads", "aID", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, "adImg");

        xc.insertMyLog(xc.adminID, "admin", "删除广告");

        xc.divError("", returnValue, 350, 150, Server.UrlDecode(xc.errorUrlTwo), "goto");
    }
Exemple #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        XabaraClass xClass = new XabaraClass();

        if (!IsPostBack)
        {
            string uidTemp = xc.adminID;

            Uid.Text = uidTemp;

            xClass.NewsTypeData("department", adminClass);

            string    strSql = "select * from AdminUser where userID='" + uidTemp + "'";
            DataTable dt     = db.getDataTable(strSql);

            if (dt.Rows.Count > 0)
            {
                adminName.Text = dt.Rows[0]["UserName"].ToString().Trim();

                int    cID     = Convert.ToInt32(dt.Rows[0]["classID"].ToString().Trim());
                string cidName = xClass.getClass(cID, string.Empty, string.Empty);
                if (string.IsNullOrEmpty(cidName as string))
                {
                    if (cID > 0)
                    {
                        cidName = "原分类已被删除,请重新选择!";
                        this.adminClass.Items.Add(new ListItem("== 请选择 ==", ""));
                        this.adminClass.Items.FindByValue(string.Empty).Selected = true;
                    }
                    else
                    {
                        this.adminClass.Items.Add(new ListItem("超级管理员", "0"));
                        this.adminClass.Items.FindByValue(cID.ToString()).Selected = true;
                    }
                }
                else
                {
                    this.adminClass.Items.FindByValue(cID.ToString()).Selected = true;
                }

                classLab.Text = cidName;
                if (dt.Rows[0]["UserAdmin"].ToString().Trim().Equals("xabaraCOM") && !string.IsNullOrEmpty(xc.SafeSql(Request["uid"]) as string))
                {
                    adminClass.Visible          = true;
                    adminClassValidator.Visible = true;
                }

                oldPWHidden.Value = dt.Rows[0]["UserPW"].ToString().Trim();
                adminMail.Text    = dt.Rows[0]["userEmail"].ToString().Trim();
                adminTel.Text     = dt.Rows[0]["userTel"].ToString().Trim();
                adminMobile.Text  = dt.Rows[0]["userMobile"].ToString().Trim();
                adminQQ.Text      = dt.Rows[0]["userQQ"].ToString().Trim();
            }
            else
            {
                xc.divError("", "您的操作有误!", 350, 150, "userList.aspx", "goto");
            }
            dt.Dispose();

            FormCheck fCheck = new FormCheck();
            adminNameRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("chinese", 0, 0, false);
            adminNameRegularExpressionValidator.ErrorMessage         = fCheck.RegExpressionValidator("chinese", 0, 0, true);
            adminPWRegularExpressionValidator.ValidationExpression   = fCheck.RegExpressionValidator("passWord", 0, 0, false);
            adminPWRegularExpressionValidator.ErrorMessage           = fCheck.RegExpressionValidator("passWord", 0, 0, true);
            mailRegularExpressionValidator.ValidationExpression      = fCheck.RegExpressionValidator("email", 0, 0, false);
            mailRegularExpressionValidator.ErrorMessage           = fCheck.RegExpressionValidator("email", 0, 0, true);
            telRegularExpressionValidator.ValidationExpression    = fCheck.RegExpressionValidator("phone", 0, 0, false);
            telRegularExpressionValidator.ErrorMessage            = fCheck.RegExpressionValidator("phone", 0, 0, true);
            mobileRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("mobile", 0, 0, false);
            mobileRegularExpressionValidator.ErrorMessage         = fCheck.RegExpressionValidator("mobile", 0, 0, true);
            qqRegularExpressionValidator.ValidationExpression     = fCheck.RegExpressionValidator("qq", 0, 0, false);
            qqRegularExpressionValidator.ErrorMessage             = fCheck.RegExpressionValidator("qq", 0, 0, true);
        }
    }
Exemple #13
0
    protected void addClass_Click(object sender, EventArgs e)
    {
        string classNameTemp = className.Text.Trim();
        string oldClassID    = DropDownListClass.Text.Trim();

        Session.Add(typeClss, oldClassID); //缓存
        string strSql = "select * from NewsTree where TreeID=" + oldClassID + " and TreeName='" + classNameTemp + "' and TreeType='" + typeClss + "'";

        if (db.getDataTable(strSql).Rows.Count > 0)
        {
            xc.divError("", "已存在该分类!", 350, 150, "ClassAdd.aspx?tClass=" + typeClss, "goto");
        }
        else
        {
            string dimStr = "@TreeID,@ListID,@TidNums,@TreeName,@TreeType,@treeAdmin,@treeDel,@PostDate,@AdminIP,@AdminID,@TreeUrl,@taobaoKe";

            string[] strValue = new string[12];
            strValue[0] = oldClassID;

            if (string.IsNullOrEmpty(classList.Text))
            {
                strValue[1] = "0";
            }
            else
            {
                strValue[1] = classList.Text;
            }

            strValue[2]  = "0";
            strValue[3]  = classNameTemp;
            strValue[4]  = typeClss;
            strValue[5]  = "0";
            strValue[6]  = "0";
            strValue[7]  = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd HH:mm:ss");
            strValue[8]  = xc.GetIP();
            strValue[9]  = xc.adminID;
            strValue[10] = classUrl.Text;
            strValue[11] = tk.Text;

            if (db.InsertUpdateDB("NewsTree", dimStr, strValue, string.Empty).Equals("发布成功"))
            {
                if (Convert.ToInt32(oldClassID) > 0) //更新子分类数
                {
                    string    strSqlSelect = "select TreeID,TidNums,idLayerStr from NewsTree where Tid=" + oldClassID + " and TreeType='" + typeClss + "'";
                    DataTable dt           = db.getDataTable(strSqlSelect);
                    int       tidNums      = Convert.ToInt32(dt.Rows[0]["TidNums"]) + 1;
                    strValue[0] = tidNums.ToString();
                    db.InsertUpdateDB("NewsTree", "@TidNums", strValue, "Tid=" + oldClassID + " and TreeType='" + typeClss + "'");

                    int tidTemp = Convert.ToInt32(dt.Rows[0]["TreeID"]);    //更新关联字符串
                    if (tidTemp < 1)
                    {
                        strValue[0] = "|";
                    }
                    else
                    {
                        strValue[0] = dt.Rows[0]["idLayerStr"].ToString();
                    }
                    strValue[0] = strValue[0].Trim() + oldClassID.ToString() + "|";
                    db.InsertUpdateDB("NewsTree", "@idLayerStr", strValue, "TreeID=" + oldClassID + " and TreeName='" + classNameTemp + "' and TreeType='" + typeClss + "'");

                    dt.Dispose();
                }

                xc.insertMyLog(xc.adminID, "admin", Server.UrlDecode(titleClass.Text + ":" + classNameTemp));

                xc.divError("", Server.UrlDecode(titleClass.Text) + "成功!", 350, 150, "ClassAdd.aspx?tClass=" + typeClss + "&title=" + titleClass.Text, "goto");
            }
            else
            {
                xc.divError("", Server.UrlDecode(titleClass.Text) + "失败!", 350, 150, "ClassAdd.aspx?tClass=" + typeClss + "&title=" + titleClass.Text, "goto");
            }
        }
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin("|adsEdit|");

        if (!IsPostBack)
        {
            FormCheck fCheck = new FormCheck();
            pdateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false);
            pdateRegExpree.ErrorMessage         = fCheck.RegExpressionValidator("dateTime", 0, 0, true);
            eDateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false);
            eDateRegExpree.ErrorMessage         = fCheck.RegExpressionValidator("dateTime", 0, 0, true);
            httpRegExpree.ValidationExpression  = fCheck.RegExpressionValidator("urlHttp", 0, 0, false);
            httpRegExpree.ErrorMessage          = fCheck.RegExpressionValidator("urlHttp", 0, 0, true);
            wRegExpree.ValidationExpression     = fCheck.RegExpressionValidator("number", 0, 0, false);
            wRegExpree.ErrorMessage             = "宽度" + fCheck.RegExpressionValidator("number", 0, 0, true);
            hRegExpree.ValidationExpression     = fCheck.RegExpressionValidator("number", 0, 0, false);
            hRegExpree.ErrorMessage             = "高度" + fCheck.RegExpressionValidator("number", 0, 0, true);

            XabaraClass xClass = new XabaraClass();
            xClass.NewsTypeData("ads", adClass);

            string img = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgType");
            this.adImg.Items.Add(new ListItem(img, "Img"));
            string flash = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadFlashType");
            this.adImg.Items.Add(new ListItem(flash, "Flash"));
            this.adImg.Items.Add(new ListItem("广告代码", "Code"));

            DataTable dt = db.getDataTable("select * from ads where aID=" + xc.SafeNum(Request["id"]).ToString());
            if (dt.Rows.Count > 0)
            {
                this.adClass.Items.FindByValue(dt.Rows[0]["classID"].ToString().Trim()).Selected = true;
                string fileName = dt.Rows[0]["adImg"].ToString().Trim();
                upImg.Value = fileName;
                if (!string.IsNullOrEmpty(fileName as string))
                {
                    string fileExe = fileName.Substring(fileName.Length - 3);
                    if (img.IndexOf(fileExe) > -1)
                    {
                        this.adImg.Items.FindByValue("Img").Selected = true;
                    }
                    else
                    {
                        this.adImg.Items.FindByValue("Flash").Selected = true;
                    }
                }
                else
                {
                    this.adImg.Items.FindByValue("Code").Selected = true;
                }

                adW.Text       = dt.Rows[0]["adW"].ToString().Trim();
                adH.Text       = dt.Rows[0]["adH"].ToString().Trim();
                adHttp.Text    = dt.Rows[0]["adHttp"].ToString().Trim();
                adCode.Text    = dt.Rows[0]["adCode"].ToString().Trim();
                pDate.Text     = Convert.ToDateTime(dt.Rows[0]["starDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                eDate.Text     = Convert.ToDateTime(dt.Rows[0]["stopDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                adCodeImg.Text = dt.Rows[0]["adCode"].ToString().Trim();
            }
            else
            {
                xc.divError("", "您的操作有误!", 350, 150, "default.aspx", "goto");
            }
            dt.Dispose();
        }
    }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = " 管理系统";

        string errorStr = Request.QueryString["errorTitle"];

        if (!string.IsNullOrEmpty(errorStr as string))
        {
            xc.divError(string.Empty, Server.UrlDecode(errorStr), 400, 150, "?errorUrl=" + Server.UrlEncode(Request.QueryString["errorUrl"]), "top");
        }
        else
        {
            if (!String.IsNullOrEmpty(Session["AdminRndNums"] as string)) //基本session验证免登陆
            {
                Response.Redirect("admin.aspx", true);
            }
        }

        if (!IsPostBack)
        {
            ClientName.Text = Request.Url.Host;
            WebVer.Text     = "管理系统&nbsp;" + xc.XabaraVer.ToString().Trim();

            if (Request.Cookies["XabaraAdmin"] != null)
            {
                UID.Text = Request.Cookies["XabaraAdmin"]["AdminID"].Trim();
            }

            clintIE.Text    = xc.clientBrower(1);
            clintIEver.Text = xc.clientBrower(2);

            if (xc.clientBrower(1).ToLower().Equals("ie"))               //判断浏览器
            {
                if (Convert.ToDouble(xc.clientBrower(2).ToString()) < 8) //判断浏览器版本
                {
                    ieError.Text = @"<strong>版本提示:</strong>为了更好的体验本管理系统,我们建议您升级 <a href='http://www.microsoft.com/china/windows/internet-explorer/default.aspx' target='_blank' style='color:red;font-weight:bold;'>Internet Explorer</a> 新版浏览器!";
                }
            }

            //string clientIP = xc.GetIP();
            //ipStr.Text = "<span style=\"color:red;\">" + clientIP + "</span>&nbsp;" + xc.GetIpWhere(clientIP);
            //ip限制
            //string ips = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "ip");
            //if (!string.IsNullOrEmpty(ips as string))
            //{
            //    if (ips.IndexOf(clientIP) < 0)
            //    {
            //        ipStr.Text += " <span class=\"redF\">您的IP不允许登录!</span>";
            //        imgLogin.Enabled = false;
            //        UID.Enabled = false;
            //        PW.Enabled = false;
            //        RndNum.Enabled = false;
            //    }
            //}

            //FormCheck fCheck = new FormCheck();
            //UIDRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("userID", 3, 20, false);
            //UIDRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("userID", 3, 20, true);
            //PWRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("passWord", 8, 20, false);
            //PWRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("passWord", 8, 20, true);
            //RndNumReg.ValidationExpression = fCheck.RegExpressionValidator("rndNums", 0, 0, false);
            //RndNumReg.ErrorMessage = fCheck.RegExpressionValidator("rndNums", 0, 0, true);

            //RndNum.Attributes.Add("onfocus", "MM_showHideLayers('rndgetValidate', '', 'show')");
        }
    }
Exemple #16
0
    protected void addMoney_Click(object sender, EventArgs e)
    {
        dbDataFunction db = new dbDataFunction();

        string imgFile       = adImg.Text.Trim();
        string uploadFileStr = string.Empty;

        if (!imgFile.Equals("Code"))
        {
            uploadFileStr = xc.UploadFile(imgUpload, imgFile, false);
        }
        string url     = adHttp.Text;
        string newFile = string.Empty;

        if (uploadFileStr.Equals("上传成功"))   //上传文件判断
        {
            newFile = Session["NewFile"].ToString().Trim();
        }

        string strDim = "@classID,@adW,@adH,@adImg,@adHttp,@adCode,@starDate,@stopDate,@postDate,@postIP,@adminID";

        string[] strValue = new string[11];

        strValue[0] = adClass.Text;
        strValue[1] = adW.Text;
        strValue[2] = adH.Text;
        strValue[3] = newFile;
        strValue[4] = url;
        if (string.IsNullOrEmpty(adCode.Text as string))
        {
            if (imgFile.Equals("Img"))
            {
                if (!string.IsNullOrEmpty(url as string))
                {
                    strValue[5] = "<a href=\"" + url + "\" target=\"_blank\"><img src=\"http://" + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webDomains") + xc.UploadFolder + newFile.Substring(5, 8) + "/" + newFile + "\" style=\"boder:0px;width:" + adW.Text + "px;height:" + adH.Text + "px\" /></a>";
                }
                else
                {
                    strValue[5] = "<img src=\"" + xc.UploadFolder + newFile.Substring(5, 8) + "/" + newFile + "\"  style=\"boder:0px;width:" + adW.Text + "px;height:" + adH.Text + "px\" />";
                }
            }
            else
            {
                strValue[5] = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" height=\"" + adH.Text + "\" width=\"" + adW.Text + "\"><param name=\"quality\" value=\"high\" /><param name=\"movie\" value=\"" + xc.UploadFolder + newFile.Substring(5, 8) + "/" + newFile + "\" /><embed height=\"" + adH.Text + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" src=\"" + xc.UploadFolder + newFile.Substring(5, 8) + "/" + newFile + "\" type=\"application/x-shockwave-flash\" width=\"" + adW.Text + "\"></embed></object>";
            }
        }
        else
        {
            strValue[5] = adCode.Text;
        }
        strValue[6]  = pDate.Text;
        strValue[7]  = eDate.Text;
        strValue[8]  = DateTime.Now.ToString();
        strValue[9]  = xc.GetIP();
        strValue[10] = xc.adminID;

        if (!string.IsNullOrEmpty(newFile as string) || !string.IsNullOrEmpty(adCode.Text as string))
        {
            xc.insertMyLog(xc.adminID, "admin", "发布广告");
            xc.divError("", db.InsertUpdateDB("ads", strDim, strValue, string.Empty), 350, 150, "default.aspx", "goto");
        }
        else
        {
            xc.divError("", "请上传广告图片或直接粘贴广告代码!", 350, 150, "add.aspx", "goto");
        }
    }