Пример #1
0
 protected void btnUpdateSelected_Click(object sender, EventArgs e)
 {
     if (this.tvWarehouse.SelectedNode != null)
     {
         if (tvWarehouse.SelectedNode.Depth == 0)
         {
             dsHouse = objHouse.QueryWarehouseByCode(tvWarehouse.SelectedNode.Value);
             if (dsHouse.Tables[0].Rows.Count == 1)
             {
                 tvWarehouse.SelectedNode.Text = dsHouse.Tables[0].Rows[0]["WH_NAME"].ToString();
             }
         }
         else if (tvWarehouse.SelectedNode.Depth == 1)
         {
             dsArea = objArea.QueryAreaByCode(tvWarehouse.SelectedNode.Value);
             if (dsArea.Tables[0].Rows.Count == 1)
             {
                 tvWarehouse.SelectedNode.Text = "库区:" + dsArea.Tables[0].Rows[0]["AREANAME"].ToString();
             }
         }
         else if (tvWarehouse.SelectedNode.Depth == 2)
         {
             dsShelf = objShelf.QueryShelfByID(Convert.ToInt32(tvWarehouse.SelectedNode.ToolTip));
             if (dsShelf.Tables[0].Rows.Count == 1)
             {
                 tvWarehouse.SelectedNode.Text = "货架:" + dsShelf.Tables[0].Rows[0]["SHELFNAME"].ToString();
             }
         }
         else if (tvWarehouse.SelectedNode.Depth == 3)
         {
             dsCell = objCell.QueryWarehouseCell("CELLCODE='" + tvWarehouse.SelectedNode.Value + "'");
             if (dsCell.Tables[0].Rows.Count == 1)
             {
                 if (dsCell.Tables[0].Rows[0]["UNITNAME"].ToString() == "条")
                 {
                     tvWarehouse.SelectedNode.Text = "货位(条):<font color='##1E7ACE'>" + dsCell.Tables[0].Rows[0]["CELLNAME"].ToString() + "</font>";
                 }
                 else
                 {
                     tvWarehouse.SelectedNode.Text = string.Format("货位({0}):{1}", dsCell.Tables[0].Rows[0]["UNITNAME"].ToString(), dsCell.Tables[0].Rows[0]["CELLNAME"].ToString());
                 }
             }
         }
     }
 }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["SHELF_ID"] != null)
            {
                dsShelf = objShelf.QueryShelfByID(Convert.ToInt32(Request.QueryString["SHELF_ID"]));
                this.txtShelfID.Text         = dsShelf.Tables[0].Rows[0]["SHELF_ID"].ToString();
                this.txtWhCode.Text          = dsShelf.Tables[0].Rows[0]["WH_CODE"].ToString();
                this.txtAreaCode.Text        = dsShelf.Tables[0].Rows[0]["AREACODE"].ToString();
                this.txtShelfCode.Text       = dsShelf.Tables[0].Rows[0]["SHELFCODE"].ToString();
                this.txtShelfName.Text       = dsShelf.Tables[0].Rows[0]["SHELFNAME"].ToString();
                this.ddlActive.SelectedValue = dsShelf.Tables[0].Rows[0]["ISACTIVE"].ToString();
                this.txtAreaType.Text        = dsShelf.Tables[0].Rows[0]["AREATYPE"].ToString();
                this.txtCellRows.Text        = dsShelf.Tables[0].Rows[0]["CELLROWS"].ToString();
                this.txtCellCols.Text        = dsShelf.Tables[0].Rows[0]["CELLCOLS"].ToString();
                this.txtImgX.Text            = dsShelf.Tables[0].Rows[0]["IMG_X"].ToString();
                this.txtImgY.Text            = dsShelf.Tables[0].Rows[0]["IMG_Y"].ToString();
                this.txtMemo.Text            = dsShelf.Tables[0].Rows[0]["MEMO"].ToString();

                this.txtShelfCode.ReadOnly = true;
                this.btnDelete.Enabled     = true;
            }
            else if (Request.QueryString["WHCODE"] != null && Request.QueryString["AREACODE"] != null)
            {
                this.txtWhCode.Text    = Request.QueryString["WHCODE"];
                this.txtAreaCode.Text  = Request.QueryString["AREACODE"];
                this.txtAreaType.Text  = Request.QueryString["AREATYPE"];
                this.txtCellRows.Text  = "3";
                this.txtCellCols.Text  = "40";
                this.txtImgX.Text      = "0.00";
                this.txtImgY.Text      = "0.00";
                this.txtShelfCode.Text = objShelf.GetNewShelfCode(Request.QueryString["AREACODE"]);
            }
        }
    }