Esempio n. 1
0
        private bool m_chkVaild()
        {
            bool IsVaild = false;

            if (objfrm.ctlRegType.SelectedIndex < 0)          //挂号类型
            {
                objfrm.errorProvider1.SetError(objfrm.ctlRegType, "请选择挂号类型!");
                IsVaild = true;
                objfrm.ctlRegType.Focus();
            }
            if (objfrm.ctlPatType.SelectedIndex < 0)
            {
                objfrm.errorProvider1.SetError(objfrm.ctlPatType, "请选择病人类型!");
                if (!IsVaild)
                {
                    objfrm.ctlPatType.Focus();
                }
                IsVaild = true;
            }
            string tmpText = "";

            tmpText = objfrm.m_txtRegFee.Text.Trim();
            if (tmpText == null || tmpText == "")
            {
                objfrm.errorProvider1.SetError(objfrm.m_txtRegFee, "请填写挂号费!");
                if (!IsVaild)
                {
                    objfrm.m_txtRegFee.Focus();
                }
                IsVaild = true;
            }
            else if (!clsMain.IsNumberWithPoint(tmpText))
            {
                objfrm.errorProvider1.SetError(objfrm.m_txtRegFee, "请填写正确金额!");
                if (!IsVaild)
                {
                    objfrm.m_txtRegFee.Focus();
                }
                IsVaild = true;
            }
            tmpText = objfrm.m_txtDiagFee.Text.Trim();
            if (tmpText == null || tmpText == "")
            {
                objfrm.errorProvider1.SetError(objfrm.m_txtDiagFee, "请填写挂号费!");
                if (!IsVaild)
                {
                    objfrm.m_txtDiagFee.Focus();
                }
                IsVaild = true;
            }
            else if (!clsMain.IsNumberWithPoint(tmpText))
            {
                objfrm.errorProvider1.SetError(objfrm.m_txtDiagFee, "请填写正确金额!");
                if (!IsVaild)
                {
                    objfrm.m_txtDiagFee.Focus();
                }
                IsVaild = true;
            }
            if (IsVaild)
            {
                return(true);
            }
            long            lngRes   = 0;
            string          strPatID = objfrm.ctlPatType.SelectItemValue;
            string          strRegID = objfrm.ctlRegType.SelectItemValue;
            clsPatRegFee_VO clsVO;

            lngRes = clsDomain.m_lngFindPatRegFeeByID(strPatID, strRegID, out clsVO);
            if (clsVO != null)
            {
                if (clsVO.m_strPayTypeID != null && clsVO.m_strPayTypeID != "" && IsNew)
                {
                    MessageBox.Show("已经存在此项挂号费用!", "");
                    int i = objfrm.Grid.FindItemByValues(new int[] { 0, 1 }, new string[] { strRegID, strPatID });
                    if (i > -1)
                    {
                        objfrm.Grid.Row = i;
                    }
                    objfrm.Grid.Focus();
                    return(true);
                }
            }
            else             //查询出错
            {
                return(true);
            }
            return(false);
        }