zoukankan      html  css  js  c++  java
  • 新闻添加cs源码

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    namespace zj123.UI.images.Expro
    {
        public partial class SortEdit: zj123.BLL.AdminPage
        {
               protected void Page_Load(object sender, EventArgs e)
               {
                this.BtDel.Attributes["onclick"] = "window.close()";
                if (!Page.IsPostBack)
                {  
                    BindUpdate();  
                }
            }
          
            public void BindUpdate()
            {
                string action = this.GetRequest("action");
                if (action == "upd")
                {
                    string sql = string.Format("select * from [Expro_NewsType] where column_id='{0}'", this.GetRequest("id"));
                    DataTable dt = this.Db.GetTable(sql);
                    if (dt != null)
                    {
                        this.TbName.Text = Convert.ToString(dt.Rows[0]["column_name"]);
                        this.TbIntro.Text = Convert.ToString(dt.Rows[0]["column_intro"]);
                    }
                }
            }
            protected void BtVerfly_Click(object sender, EventArgs e)
            {
                string action = this.GetRequest("action");
                string name = this.TbName.Text.Trim();
                string intro = this.TbIntro.Text.Trim();
                string parentid = this.GetRequest("parentid");
                parentid = parentid.Length<1?("0"):(parentid);
                string depth = this.GetRequest("depth");
                
             
                string message = "";
                string sql = "";
                switch (action)
                {
                    case "add":
                        message = "添加";
                        int depthint = Convert.ToInt32(depth) + 1;
                     
                        sql = string.Format("insert into Expro_NewsType([column_id],[column_name],[parent_id],[column_depth],[column_intro]) values( '{0}','{1}','{2}',{3},'{4}')", System.Guid.NewGuid().ToString().Replace("-", "").ToUpper().Substring(1, 6), name, parentid, depthint, intro);
                        break;
                    case "upd":
                        message = "修改";
                        sql = string.Format("update [Expro_NewsType] set Column_Name='{0}',Column_Intro='{1}' where [column_ID]='{2}'", name, intro, this.GetRequest("id"));
                        break;
                    default:
                        break;
                }
                if (this.Db.GetState(sql))
                {
                    this.ShowMessage("成功" + message, "window.opener.location.reload()");
                }
                else
                {
                    this.ShowMessage("操作失败请联系管理员!!!","");
                }

            }

            protected void BtDel_Click(object sender, EventArgs e)
            {
               // Response.Write(this.Script());
            }
        }
    }

  • 相关阅读:
    Shell 脚本中调用另一个 Shell 脚本的三种方式
    Shell脚本的三种执行方式
    python selenium中Excel数据维护(二)
    python里面的xlrd模块详解(一)
    selenium处理iframe定位于切换问题解决办法
    Selenium在定位的class含有空格的复合类的解决办法整理
    SqlSugar ORM已经支持读写分离
    ASP.NET Core的Kestrel服务器
    服务是如何加载并运行的, Kestrel、配置与环境
    ASP.NET Core Web服务器 Kestrel和Http.sys 特性详解
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835750.html
Copyright © 2011-2022 走看看