protected void Page_Load(object sender, EventArgs e)
 {
     string collectionId = Request["cid"];
     if (string.IsNullOrEmpty(collectionId))
     {
         RedirectToUrl("Default.aspx");
     }
     Guid id = new Guid(collectionId);
     ItemCollectionFacade facade = new ItemCollectionFacade();
     hlnkAdd.Text = "添加 - " + facade.GetItemById(id).Name;
     hlnkAdd.NavigateUrl = "CollectionEdit.aspx?t=a&cid=" + collectionId;
     BindCollection(id);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        string collectionId = Request["cid"];

        if (string.IsNullOrEmpty(collectionId))
        {
            RedirectToUrl("Default.aspx");
        }
        Guid id = new Guid(collectionId);
        ItemCollectionFacade facade = new ItemCollectionFacade();

        hlnkAdd.Text        = "添加 - " + facade.GetItemById(id).Name;
        hlnkAdd.NavigateUrl = "CollectionEdit.aspx?t=a&cid=" + collectionId;
        BindCollection(id);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string type         = Request["t"];
            string collectionId = Request["cid"];
            string url          = "CollectionManagement.aspx?cid=" + collectionId;

            Guid cid = new Guid(collectionId);
            ItemCollectionFacade facade     = new ItemCollectionFacade();
            ItemCollectionInfo   collection = facade.GetItemById(cid) as ItemCollectionInfo;
            if (collection == null)
            {
                JavascriptAlertAndRedirect("参数错误 - 未找到集合!", url);
                return;
            }
            else
            {
                hlnkCancel.NavigateUrl = url;
            }

            switch (type.ToLower())
            {
            case "a":
                ClearText();
                lbtnSave.Text = "添加";
                break;

            case "e":
                string id = Request["id"];
                BindItem(id, url);
                lbtnSave.Text = "修改";
                break;

            default:
                JavascriptAlertAndRedirect("参数错误 - 缺少类型!", url);
                break;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string type = Request["t"];
            string collectionId = Request["cid"];
            string url = "CollectionManagement.aspx?cid=" + collectionId;

            Guid cid = new Guid(collectionId);
            ItemCollectionFacade facade = new ItemCollectionFacade();
            ItemCollectionInfo collection = facade.GetItemById(cid) as ItemCollectionInfo;
            if (collection == null)
            {
                JavascriptAlertAndRedirect("参数错误 - 未找到集合!", url);
                return;
            }
            else
            {
                hlnkCancel.NavigateUrl = url;
            }

            switch (type.ToLower())
            {
                case "a":
                    ClearText();
                    lbtnSave.Text = "添加";
                    break;
                case "e":
                    string id = Request["id"];
                    BindItem(id, url);
                    lbtnSave.Text = "修改";
                    break;
                default:
                    JavascriptAlertAndRedirect("参数错误 - 缺少类型!", url);
                    break;
            }
        }
    }