コード例 #1
0
ファイル: frmDensitySet.cs プロジェクト: zhenghua75/CMSM2
        private void txtCurDensity_GotFocus(object sender, EventArgs e)
        {
            this.cmbGoodsName.Focus();
            string strGoodsName = cmbGoodsName.Text.Trim();
            string strGoodsType = cmbGoodsType.Text.Trim();
            string strDeptName  = cmbDeptName.Text.Trim();

            if (strGoodsName == "" || strGoodsType == "" || strDeptName == "")
            {
                MessageBox.Show("部门及物料参数不全,请检查参数!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }

            err = null;
            CMSMStruct.DensityStruct dens = cs.GetCurDensity(strGoodsName, strGoodsType, strDeptName, out err);
            if (err != null)
            {
                MessageBox.Show("获取当前密度出错,请检查当前密度信息,再重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                return;
            }
            if (dens == null)
            {
                this.txtCurDensity.Text = "尚未设置";
            }
            else
            {
                this.txtCurDensity.Text = dens.strDensity;
            }
            this.cmbGoodsName.Enabled = false;
            this.cmbGoodsType.Enabled = false;
        }