Exemple #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile  t     = new Tool.UpFile();
            Model.jieshu admin = new Model.jieshu()
            {
                jieshu_name      = jieshu_name.Text,
                jieshu_title     = jieshu_title.Text,
                jieshu_Directory = jieshu_Directory.Text,
                jieshu_imageurl  = t.upFileName(this.Img, "../img/Book/"),
                jieshu_intro     = jieshu_intro.Text,
                jieshu_press     = jieshu_press.Text,
                jieshu_price     = int.Parse(jieshu_price.Text),
                jieshu_section   = jieshu_section.Text
            };
            _ = BackStages.Add <Model.jieshu> .AddBook(admin) > 0 ? Tool.Tool.Alert("True") : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception exception)
            {
                Response.Redirect("Admin.aspx");
            }
        }
Exemple #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile  t     = new Tool.UpFile();
            Model.jieshu admin = new Model.jieshu()
            {
            };
            _ = BackStages.Add <Model.jieshu> .AddBook(admin) > 0 ? Tool.Tool.Alert("True") : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception)
            {
                Response.Redirect("~/backstage/tuandui/tuandui.aspx");
            }
        }
Exemple #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile t     = new Tool.UpFile();
            Model.zixun admin = new Model.zixun()
            {
                title   = Name.Text,
                name    = Name.Text,
                imgurl  = t.upFileName(this.FileUpload1, "../img/zixun/"),
                content = contexta.Value
            };
            _ = BackStages.Add <Model.zixun> .AddZx(admin) > 0 ? Tool.Tool.Alert("True", "../img/zixun/" + admin.imgurl) : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception)
            {
                Response.Redirect("~/backstage/tuandui/tuandui.aspx");
            }
        }
Exemple #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile   up      = new UpFile();
            Tool.UpFile   t       = new Tool.UpFile();
            Model.product product = new Model.product()
            {
                product_name     = Name.Text,
                product_intro    = intro.Text,
                product_imageurl = up.upFileName(this.Img, "../img/product/"),
                product_content  = content.Text,
                product_price    = int.Parse(price.Text)
            };
            _ = BackStages.Add <Model.product> .AddPro(product) > 0 ? Tool.Tool.Alert("True") : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception exception)
            {
                Process p = new Process();
                //设置要启动的应用程序
                p.StartInfo.FileName = "cmd.exe";
                p.StartInfo.RedirectStandardInput = true;
                //输出信息
                p.StartInfo.RedirectStandardOutput = true;
                // 输出错误
                p.StartInfo.RedirectStandardError = true;
                //不显示程序窗口
                p.StartInfo.CreateNoWindow  = true;
                p.StartInfo.UseShellExecute = false;
                //启动程序
                p.Start();
                p.StandardInput.WriteLine(exception);
                p.StandardInput.AutoFlush = true;
                Console.WriteLine();
                Response.Redirect("product.aspx");
            }
        }
Exemple #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile    t     = new Tool.UpFile();
            Model.fangying admin = new Model.fangying()
            {
                fangying_title    = fangying_title.Text,
                fangying_time     = DateTime.Parse(fangying_time.Text),
                fangying_text     = at.Value,
                fangying_imageurl = t.upFileName(this.Img, "../img/fangying/")
            };
            _ = BackStages.Add <Model.admin> .AddFangying(admin) > 0 ? Tool.Tool.Alert("True") : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception exception)
            {
                Process p = new Process();
                //设置要启动的应用程序
                p.StartInfo.FileName = "cmd.exe";
                p.StartInfo.RedirectStandardInput = true;
                //输出信息
                p.StartInfo.RedirectStandardOutput = true;
                // 输出错误
                p.StartInfo.RedirectStandardError = true;
                //不显示程序窗口
                p.StartInfo.CreateNoWindow  = true;
                p.StartInfo.UseShellExecute = false;
                //启动程序
                p.Start();
                p.StandardInput.WriteLine(exception);
                p.StandardInput.AutoFlush = true;
                Console.WriteLine();
                Response.Redirect("Admin.aspx");
            }
        }
Exemple #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Tool.UpFile t     = new Tool.UpFile();
            Model.admin admin = new admin()
            {
                name  = Name.Text,
                pwd   = pwd.Text,
                root  = int.Parse(root.Text),
                imurl = t.upFileName(this.Img, "../img/admin/")
            };
            _ = BackStages.Add <Model.admin> .AddAdmin(admin) > 0 ? Tool.Tool.Alert("True") : Tool.Tool.Alert("False");

            try
            {
                Response.Redirect(Session["Web_Url"].ToString());
            }
            catch (Exception exception)
            {
                Process p = new Process();
                //设置要启动的应用程序
                p.StartInfo.FileName = "cmd.exe";
                p.StartInfo.RedirectStandardInput = true;
                //输出信息
                p.StartInfo.RedirectStandardOutput = true;
                // 输出错误
                p.StartInfo.RedirectStandardError = true;
                //不显示程序窗口
                p.StartInfo.CreateNoWindow = true;
                //启动程序
                p.Start();
                p.StandardInput.WriteLine(exception);
                p.StandardInput.AutoFlush = true;
                Console.WriteLine();
                Response.Redirect("Admin.aspx");
            }
        }