Exemple #1
0
    protected void Change()
    {
        DataSet dsTemp = objArea.QueryAllArea();
        int     i      = 0;
        string  areatype;

        this.lblCurrentNode.Text = tvWarehouse.SelectedNode.Text;
        HtmlGenericControl frame = (HtmlGenericControl)form1.FindControl("frame");

        if (tvWarehouse.SelectedNode.Depth == 0)
        {
            this.hdnWarehouseCode.Value = tvWarehouse.SelectedNode.Value;
            this.hdnAreaCode.Value      = "";
            this.hdnShelfCode.Value     = "";
            this.btnNewArea.Enabled     = true;
            this.btnNewShelf.Enabled    = false;
            this.btnNewCell.Enabled     = false;

            frame.Attributes.Add("src", "WarehouseEditPage.aspx?WH_CODE=" + tvWarehouse.SelectedNode.Value + "&time=" + DateTime.Now.ToString());
        }
        if (tvWarehouse.SelectedNode.Depth == 1)
        {
            i        = int.Parse(objArea.QueryAreaByCode(tvWarehouse.SelectedNode.Value).Tables[0].Rows[0]["AREATYPE"].ToString());
            areatype = dsTemp.Tables[0].Rows[i]["AREATYPE"].ToString();
            this.hdnWarehouseCode.Value = tvWarehouse.SelectedNode.Parent.Value;
            this.hdnAreaCode.Value      = tvWarehouse.SelectedNode.Value;
            this.hdnAreaType.Value      = areatype;
            this.hdnShelfCode.Value     = "";
            this.btnNewArea.Enabled     = false;
            this.btnNewShelf.Enabled    = true;
            this.btnNewCell.Enabled     = false;
            frame.Attributes.Add("src", "WarehouseAreaEditPage.aspx?AREA_ID=" + tvWarehouse.SelectedNode.ToolTip + "&time=" + DateTime.Now.ToString());
        }
        if (tvWarehouse.SelectedNode.Depth == 2)
        {
            i        = int.Parse(objArea.QueryAreaByCode(tvWarehouse.SelectedNode.Parent.Value).Tables[0].Rows[0]["AREATYPE"].ToString());
            areatype = dsTemp.Tables[0].Rows[i]["AREATYPE"].ToString();
            this.hdnWarehouseCode.Value = tvWarehouse.SelectedNode.Parent.Parent.Value;
            this.hdnAreaCode.Value      = tvWarehouse.SelectedNode.Parent.Value;
            this.hdnShelfCode.Value     = tvWarehouse.SelectedNode.Value;
            this.hdnAreaType.Value      = areatype;
            this.btnNewArea.Enabled     = false;
            this.btnNewShelf.Enabled    = false;
            this.btnNewCell.Enabled     = true;
            frame.Attributes.Add("src", "WarehouseShelfEditPage.aspx?SHELF_ID=" + tvWarehouse.SelectedNode.ToolTip + "&time=" + DateTime.Now.ToString());
        }
        else if (tvWarehouse.SelectedNode.Depth == 3)
        {
            i        = int.Parse(objArea.QueryAreaByCode(tvWarehouse.SelectedNode.Parent.Parent.Value).Tables[0].Rows[0]["AREATYPE"].ToString());
            areatype = dsTemp.Tables[0].Rows[i]["AREATYPE"].ToString();
            this.hdnWarehouseCode.Value = tvWarehouse.SelectedNode.Parent.Parent.Parent.Value;
            this.hdnAreaCode.Value      = tvWarehouse.SelectedNode.Parent.Parent.Value;
            this.hdnShelfCode.Value     = tvWarehouse.SelectedNode.Parent.Value;
            this.hdnAreaType.Value      = areatype;
            this.btnNewArea.Enabled     = false;
            this.btnNewShelf.Enabled    = false;
            this.btnNewCell.Enabled     = false;
            frame.Attributes.Add("src", "WarehouseCellEditPage.aspx?CELL_ID=" + tvWarehouse.SelectedNode.ToolTip + "&time=" + DateTime.Now.ToString());
        }
    }