Exemple #1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string        whcode  = this.txtWhCode.Text;
        WarehouseArea objArea = new WarehouseArea();
        int           count   = objArea.QueryAreaByWHCODE(whcode).Tables[0].Rows.Count;

        if (count > 0)
        {
            JScript.Instance.ShowMessage(this, whcode + "还有下属库区,不能删除!");
            return;
        }
        else
        {
            objHouse.Delete(whcode);

            this.txtWHID.Text            = "";
            this.txtWhCode.Text          = objHouse.GetNewCode(this.ddlType.SelectedValue);
            this.txtWhName.Text          = "";
            this.txtShortName.Text       = "";
            this.txtDEFAULTUNIT.Text     = "";
            this.txtUNITNAME.Text        = "";
            this.ddlType.SelectedIndex   = 0;
            this.txtArea.Text            = "0";
            this.txtCapacity.Text        = "0";
            this.ddlActive.SelectedIndex = 0;
            this.txtMemo.Text            = "";
            this.txtWhCode.ReadOnly      = false;
            this.btnDelete.Enabled       = false;
            string path = whcode;
            JScript.Instance.RegisterScript(this, "RefreshParent('" + path + "');");
        }
    }