⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managedocumenttype.aspx.cs

📁 ASP.NET多线程编程(二),ASP.NET多线程编程(二) .
💻 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;
using Zeroone.FileSystem;

public partial class Admin_ManageDocumentType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string typeName = Request.QueryString["name"];
            string dataProviderAction = string.IsNullOrEmpty(Request.QueryString["action"]) ? "insert" : Request.QueryString["action"];
            string path = Request.QueryString["path"];

            if (dataProviderAction.ToLower() == "update")
            {
                TypeInfo typeInfo = TypeController.GetType(path, typeName);
                tbTypeName.Text = typeInfo.Name;
                tbDescription.Text = typeInfo.Description;
                btnNew.Text = "更新";

                btnDelete.Visible = true;
            }
        }

    }
    protected void btnNew_Click(object sender, EventArgs e)
    {

        string typeName = Request.QueryString["name"];
        string dataProviderAction = string.IsNullOrEmpty(Request.QueryString["action"]) ? "insert" : Request.QueryString["action"];
        string path = Request.QueryString["path"];

        if (dataProviderAction.ToLower() == "update")
        {
            TypeInfo typeInfo = TypeController.GetType(path, typeName);
            typeInfo.Name = tbTypeName.Text;
            typeInfo.Description = tbTypeName.Text;
            TypeController.UpdateType(typeInfo);
        }
        else if (dataProviderAction.ToLower() == "insert")
        {
            TypeInfo type = new TypeInfo();
            type.Name = this.tbTypeName.Text;
            type.Path = path;
            type.Description = tbDescription.Text;
            TypeController.CreateType(type);
        }
        Response.Redirect(path.Substring(1) + "DocumentTypes.aspx");
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string typeName = Request.QueryString["name"];
        string path = Request.QueryString["path"];
        TypeController.DeleteType(path, typeName);
        Response.Redirect(path.Substring(1) + "DocumentTypes.aspx");
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        string path = Request.QueryString["path"];
        Response.Redirect(path.Substring(1) + "DocumentTypes.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -