Ejemplo n.º 1
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            AdvInfo ob = new AdvInfo();

            ob.title          = tbtitle.Text;
            ob.imgurl         = tbimgUrl.Text;
            ob.imglink        = tbimgLink.Text;
            ob.flyimagewidth  = int.Parse(tbFlyImageWidth.Text);
            ob.flyimageheight = int.Parse(tbFlyImageHeight.Text);
            ob.addtime        = Convert.ToDateTime(tbAddTime.Text);
            ob.flag           = this.rbFlag.SelectedValue == "1" ? true : false;


            AdvInfoService.InsertAdvInfo(ob);

            try
            {
                string script = "<script>if(confirm('是否继续添加?')){location='" + Request.Url.ToString() + "';}else{location='advInfo_add.aspx';}</script>";
                Response.Write(script);
                Response.End();
            }
            catch
            {
                ShowJs.ShowAndRedirect("添加失败!", "advInfo_add.aspx", this.Page);
            }
        }
Ejemplo n.º 2
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            if (tbName.Text.Trim() != "" && tbPass.Text != "" && tbPass2.Text != "" && tbPass2.Text == tbPass.Text)
            {
                Admin ob = AdminService.GetAdminByUserName(tbName.Text.Trim());


                if (ob == null)
                {
                    ob            = new Admin();
                    ob.username   = tbName.Text.Trim();
                    ob.truename   = tbTruename.Text;
                    ob.password   = AdminService.encry(tbPass.Text.Trim());
                    ob.p_id       = AdminService.Adminid;
                    ob.roleid     = Convert.ToInt32(this.ddlrole.SelectedValue);
                    ob.flag       = rbFlag.SelectedValue == "1" ? true : false;
                    ob.logincount = 0;
                    ob.addtime    = DateTime.Now;
                    ob.lasttime   = DateTime.Now;
                    ob.modi_date  = DateTime.Now;
                    AdminService.InsertAdmin(ob);
                    ShowJs.ShowAndRedirect("添加成功!", "admin_manage.aspx", this.Page);
                }
                else
                {
                    ShowJs.ShowAndBack("此用户名已经存在!", this.Page);
                }
            }
            else
            {
                ShowJs.ShowAndBack("您的输入有误!", this.Page);
            }
        }
Ejemplo n.º 3
0
        protected void sbEdit_ServerClick(object sender, EventArgs e)
        {
            if (Request["id"] != null)
            {
                try
                {
                    AdvInfo ob = AdvInfoService.GetAdvInfoById(int.Parse(Request["id"]));

                    if (ob != null)
                    {
                        ob.title          = tbtitle.Text;
                        ob.imgurl         = tbimgUrl.Text;
                        ob.imglink        = tbimgLink.Text;
                        ob.flyimagewidth  = int.Parse(tbFlyImageWidth.Text);
                        ob.flyimageheight = int.Parse(tbFlyImageHeight.Text);
                        ob.addtime        = Convert.ToDateTime(tbAddTime.Text);
                        ob.flag           = this.rbFlag.SelectedValue == "1" ? true : false;

                        AdvInfoService.UpdateAdvInfo(ob);
                    }
                }
                catch
                {
                    ShowJs.ShowAndRedirect("修改失败!", hdUrl.Value, this.Page);
                }
            }

            ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page);
        }
Ejemplo n.º 4
0
        protected void btSub_Click(object sender, EventArgs e)
        {
            try
            {
                FeedBack m = new FeedBack();

                m.title   = this.tbtitle.Value.Trim();
                m.company = this.tbcompany.Value.Trim();
                m.address = this.tbaddress.Value.Trim();
                // m["zip"] = this.tbzip.Value.Trim();
                m.username = this.tbusername.Value.Trim();
                // m["mobile"] = this.tbmobile.Value.Trim();
                m.phone = this.tbphone.Value.Trim();
                // m["fax"] = this.tbFax.Value.Trim();
                m.email   = this.tbemail.Value.Trim();
                m.content = this.tbcontent.Value;
                m.addtime = DateTime.Now;
                m.flag    = false;
                m.type    = 1;
                FeedBackService.InsertFeedBack(m);
                ShowJs.ShowAndRedirect("感谢您的留言!", Request.Url.ToString(), this.Page);
            }
            catch (Exception)
            {
                ShowJs.ShowAndBack("提交失败!", this.Page);
            }
        }
Ejemplo n.º 5
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            if (!System.IO.File.Exists(path1))
            {
                System.IO.Directory.CreateDirectory(path1);
            }
            if (!System.IO.File.Exists(path2))
            {
                System.IO.Directory.CreateDirectory(path2);
            }
            try
            {
                News ob = new News();
                ob.title = tbTitle.Text.Trim();

                ob.type    = Convert.ToInt32(ddlType.SelectedValue);
                ob.content = txtFull.Text;
                ob.flag    = rbComm.SelectedValue == "1" ? true : false;

                ob.author     = tbAuthor.Text;
                ob.title2     = this.tbTitle2.Text;
                ob.isdiredict = this.rbisdiredict.SelectedValue == "1" ? true : false;

                ob.url = this.tburl.Text.Trim();
                if (this.upFile.HasFile)
                {
                    ob.img = App_ImgPath + UpFile(upFile, path1);
                }
                if (this.upFile1.HasFile)
                {
                    ob.upfile = App_FilePath + UpFile(upFile1, path2);
                }

                if (this.tbfile.Text.Trim() != "" && this.tbfile.Visible == true)
                {
                    ob.upfile = this.tbfile.Text.Trim();
                }

                ob.addtime     = Convert.ToDateTime(this.tbTime.Text);
                ob.adduser     = AdminService.Adminid;
                ob.source      = tbSource.Text;
                ob.istop       = false;
                ob.isdelete    = false;
                ob.hits        = 0;
                ob.comm        = false;
                ob.publish_new = true;
                NewsService.InsertNews(ob);


                string script = "<script>if(confirm('是否继续添加?')){location='" + Request.Url.ToString() + "';}else{location='news_manage.aspx?type=" + Request["type"] + "';}</script>";
                Response.Write(script);
                Response.End();
            }
            catch (Exception)
            {
                ShowJs.ShowAndBack("添加失败!", this.Page);
            }
        }
Ejemplo n.º 6
0
        protected void sbEdit_ServerClick(object sender, EventArgs e)
        {
            if (!System.IO.File.Exists(path1))
            {
                System.IO.Directory.CreateDirectory(path1);
            }
            try
            {
                News ob = NewsService.GetNewsById(int.Parse(Request["edit"]));
                if (ob != null)
                {
                    ob.title = tbTitle.Text.Trim();

                    ob.type    = Convert.ToInt32(ddlType.SelectedValue);
                    ob.content = txtFull.Text;
                    ob.flag    = rbComm.SelectedValue == "1" ? true : false;

                    ob.author     = tbAuthor.Text;
                    ob.title2     = this.tbTitle2.Text;
                    ob.isdiredict = this.rbisdiredict.SelectedValue == "1" ? true : false;

                    ob.url = this.tburl.Text.Trim();
                    if (upFile.HasFile)
                    {
                        if (!string.IsNullOrEmpty(ob.img))
                        {
                            if (File.Exists(path1 + ob.img))
                            {
                                File.Delete(path1 + ob.img);
                            }
                        }
                        ob.img = App_ImgPath + UpFile(upFile, path1);
                    }
                    if (upFile1.HasFile)
                    {
                        if (!string.IsNullOrEmpty(ob.upfile))
                        {
                            File.Delete(path2 + ob.upfile);
                        }
                        ob.upfile = App_FilePath + UpFile(upFile1, path2);
                    }
                    if (this.tbfile.Text.Trim() != "" && this.tbfile.Visible == true)
                    {
                        ob.upfile = this.tbfile.Text.Trim();
                    }
                    ob.source  = tbSource.Text;
                    ob.adduser = AdminService.Adminid;
                    NewsService.UpdateNews(ob);
                }

                ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page);
            }
            catch (Exception)
            {
                ShowJs.ShowAndBack("修改失败!", this.Page);
            }
        }
Ejemplo n.º 7
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            Role ob = new Role();

            ob.rolename = this.tbName.Text.Trim();
            ob.depth    = 0;
            ob.pid      = 0;
            ShowJs.ShowAndRedirect("添加成功!", "role_add.aspx", this.Page);
        }
Ejemplo n.º 8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (tbNewPass.Text == tbNewPass2.Text)
     {
         string mess = "";
         mess = AdminService.SetPsw(AdminService.Adminid, tbOp.Text, tbNewPass.Text);
         ShowJs.ShowAndBack(mess, this.Page);
     }
     else
     {
         ShowJs.ShowAndBack("两次输入密码不一样!", this.Page);
     }
 }
Ejemplo n.º 9
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            NewsType ob = new NewsType();

            ob.typename = tbTitle.Text.Trim();
            ob.p_id     = Request["id"] != null?int.Parse(Request["id"]) : 0;

            ob.issimple = int.Parse(rbIssimple.SelectedValue);
            ob.sort     = int.Parse(tbSord.Text);

            NewsTypeService.InsertNewsType(ob);
            ShowJs.ShowAndRedirect("添加成功!", Request.Url.ToString(), this.Page);
        }
Ejemplo n.º 10
0
 protected void btEdit_Click(object sender, EventArgs e)
 {
     if (Request["edit"] != null)
     {
         Role ob = RoleService.GetRoleById(int.Parse(Request["edit"]));
         if (ob != null)
         {
             ob.rolename = this.tbName.Text.Trim();
             RoleService.UpdateRole(ob);
         }
         ShowJs.ShowAndRedirect("修改成功!", "role_add.aspx", this.Page);
     }
 }
Ejemplo n.º 11
0
        protected void imgBut_Click(object sender, ImageClickEventArgs e)
        {
            string mes = AdminService.checklogin(this.txtUserName.Value, this.txtPassWord.Value, Page.Request.UserHostAddress);

            if (mes == "")
            {
                Response.Redirect("index.aspx");
            }
            else
            {
                ShowJs.ShowAndBack(mes, this.Page);
            }
        }
Ejemplo n.º 12
0
        protected void sbEdit_ServerClick(object sender, EventArgs e)
        {
            NewsType ob = NewsTypeService.GetNewsTypeById(int.Parse(Request["edit"]));


            if (ob != null)
            {
                ob.typename = tbTitle.Text.Trim();
                ob.issimple = int.Parse(rbIssimple.SelectedValue);
                ob.sort     = int.Parse(tbSord.Text);
                NewsTypeService.UpdateNewsType(ob);
            }
            ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page);
        }
Ejemplo n.º 13
0
        protected void Submit1_ServerClick(object sender, EventArgs e)
        {
            if (tbtitle.Text.Trim() != "" && tburl.Text != "" && tbsort.Text != "")
            {
                Link ob = new Link();
                ob.title = this.tbtitle.Text.Trim();
                ob.url   = this.tburl.Text;
                ob.sort  = int.Parse(this.tbsort.Text);
                ob.flag  = this.rbFlag.SelectedValue == "1" ? true : false;
                ob.type  = int.Parse(this.ddltype.SelectedValue);
                LinkService.InsertLink(ob);

                ShowJs.ShowAndRedirect("添加成功!", "link_add.aspx", this.Page);
            }
            else
            {
                ShowJs.ShowAndBack("您的输入有误!", this.Page);
            }
        }
Ejemplo n.º 14
0
        protected void btEdit_Click(object sender, EventArgs e)
        {
            if (Request["edit"] != null)
            {
                Link ob = LinkService.GetLinkById(int.Parse(Request["edit"]));

                if (ob != null)
                {
                    ob.title = this.tbtitle.Text.Trim();
                    ob.url   = this.tburl.Text;
                    ob.sort  = int.Parse(this.tbsort.Text);
                    ob.flag  = this.rbFlag.SelectedValue == "1" ? true : false;
                    ob.type  = int.Parse(this.ddltype.SelectedValue);
                    LinkService.UpdateLink(ob);
                }

                ShowJs.ShowAndRedirect("修改成功!", "link_manage.aspx", this.Page);
            }
        }
Ejemplo n.º 15
0
        protected void btSub_Click(object sender, EventArgs e)
        {
            SettingManager.WebName = this.tsName.Text;
            SettingManager.SetParam("SEO.DefaultTitle", this.tsTitle.Text);
            SettingManager.SetParam("SEO.DefaultMetaDescription", this.tsDescription.Text);
            SettingManager.SetParam("SEO.DefaultMetaKeywords", this.tsKeywords.Text);
            SettingManager.Copyright   = this.tbContent.Text;
            SettingManager.WebUrl      = this.tsSiteUrl.Text;
            SettingManager.Address     = this.tsAddress.Text;
            SettingManager.Fax         = this.tsFax.Text;
            SettingManager.MobilePhone = this.tsPhone.Text;
            SettingManager.TelPhone    = this.tsTel.Text;
            SettingManager.WeiXin      = this.tsWeiXin.Text;
            SettingManager.QQ          = this.tsQQ.Text;



            ShowJs.ShowAndRedirect("设置成功!", Request.Url.ToString(), this.Page);
        }
Ejemplo n.º 16
0
        protected void btEdit_Click(object sender, EventArgs e)
        {
            if (Request["edit"] != null)
            {
                Admin ob = AdminService.GetAdminById(int.Parse(Request["edit"]));
                if (ob != null)
                {
                    ob.truename = tbTruename.Text;
                    ob.flag     = rbFlag.SelectedValue == "1"?true:false;
                    ob.roleid   = int.Parse(this.ddlrole.SelectedValue);
                    if (this.tbRestPass.Text.Trim() != "")
                    {
                        ob.password = AdminService.encry(this.tbRestPass.Text.Trim());
                    }
                    AdminService.UpdateAdmin(ob);
                }

                ShowJs.ShowAndRedirect("修改成功!", "admin_manage.aspx", this.Page);
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // if (!LJH.Rank.IsModuleRank(1501))
            // {
            //     Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>");
            //     Response.End();
            //  }

            if (!IsPostBack)
            {
                if (Request["del"] != null)
                {
                    int id = AdminService.GetAdminPid(int.Parse(Request["del"]));
                    if (id != 0)
                    {
                        AdminService.DeleteByPid(int.Parse(Request["del"]));
                        AdminService.DeleteAdmin(int.Parse(Request["del"]));
                        // LJH.Admin.ExecuteNonQuery("delete tAdmin where p_id=" + Request["del"]);
                        // LJH.Admin.ExecuteNonQuery("delete tAdmin where id=" + Request["del"]);
                        // LJH.Admin.ExecuteNonQuery("delete tLogin_log where admin_id=" + Request["del"]);
                        Response.Redirect("admin_manage.aspx");
                    }
                    else
                    {
                        ShowJs.ShowAndBack("超级管理员不能删除!", this.Page);
                    }
                }
                else if (Request["flag"] != null && Request["id"] != null)
                {
                    AdminService.SetFlag(Request["flag"].ToString() == "1"?true:false, int.Parse(Request["id"]));

                    Response.Redirect("admin_manage.aspx");
                }
                else
                {
                    rtAdmin.DataSource = AdminService.GetAdminByPid(AdminService.Adminid);
                    rtAdmin.DataBind();
                }
            }
        }
Ejemplo n.º 18
0
        protected void btSub_Click(object sender, EventArgs e)
        {
            if (Request["roleid"] != null)
            {
                int roleid = int.Parse(Request["roleid"]);


                checkRank(cblmodule11, roleid);
                checkRank(cblmodule10, roleid);
                checkRank(cblmodule9, roleid);

                checkRank(cblmodule8, roleid);
                checkRank(cblmodule7, roleid);
                checkRank(cblmodule6, roleid);
                checkRank(cblmodule5, roleid);
                checkRank(cblmodule4, roleid);
                checkRank(cblmodule3, roleid);
                checkRank(cblmodule2, roleid);
                checkRank(cblmodule1, roleid);
                ShowJs.ShowAndRedirect("设置成功!", hdback.Value, this.Page);
            }
        }