Ejemplo n.º 1
0
        protected int CheckValid()
        {
            if (this.cmbNurse.SelectedItem == null)
            {
                this.Err = "»¤ÀíÕ¾ºÅ²»´æÔÚ";
                return(-1);
            }
            if (this.txtBedNo.Text == "")
            {
                this.Err = "´²ºÅΪ¿Õ£¬ÇëÌîд£¡";
                return(-1);
            }
            if (txtBedNo.Enabled)
            {
                if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtBedNo.Text, 6))
                {
                    this.Err = "´²ºÅ¹ý³¤£¬ÇëÖØÐÂÌîд£¡";
                    return(-1);
                }
            }

            if (txtBedNo.Text != "")
            {
                int temp = bed.IsExistBedNo(this.cmbNurse.SelectedItem.ID + txtBedNo.Text);
                if (temp == 0)
                {
                    //ûÓÐ
                }
                else if (temp == 1)
                {
                    this.Err = "ÒѾ­´æÔÚ´²Î»ºÅ " + txtBedNo.Text;
                    txtBedNo.Focus();
                    return(-1);
                }
            }

            if (this.txtWardNo.Text == "")
            {
                this.Err = "²¡·¿ºÅΪ¿Õ£¬ÇëÌîд£¡";
                return(-1);
            }
            if (this.cmdBedGrade.Text == "")
            {
                this.Err = "´²Î»µÈ¼¶Îª¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }
            if (this.cmbBedWeave.Text == "")
            {
                this.Err = "´²Î»±àÖÆΪ¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }
            if (this.cmbBedStatus.Text == "")
            {
                this.Err = "´²Î»×´Ì¬Îª¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }

            if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtPhone.Text, 14))
            {
                this.Err = "´²Î»µç»°×Ϊ14λ,ÇëÖØÐÂÊäÈë";
                return(-1);
            }
            if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtWardNo.Text, 10))
            {
                this.Err = "²¡ÊҺŹý³¤,ÇëÖØÐÂÊäÈë";
                return(-1);
            }
            return(0);
        }
Ejemplo n.º 2
0
        protected int CheckValid()
        {
            if (this.cmbNurse.SelectedItem == null)
            {
                this.Err = "»¤ÀíÕ¾ºÅ²»´æÔÚ";
                return(-1);
            }
            if (this.txtBedNo.Text == "")
            {
                this.Err = "´²ºÅΪ¿Õ£¬ÇëÌîд£¡";
                return(-1);
            }
            if (txtBedNo.Enabled)
            {
                if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtBedNo.Text, 6))
                {
                    this.Err = "´²ºÅ¹ý³¤£¬ÇëÖØÐÂÌîд£¡";
                    return(-1);
                }
            }

            if (txtBedNo.Text != "")
            {
                for (int i = 0; i < int.Parse(tbCount.Text.Trim()) - 1; i++)
                {
                    #region {CE0F5F09-987B-49f4-862C-63930084A18A} wbo 20100915
                    //int bedNo;
                    //bedNo = int.Parse(txtBedNo.Text) + i;
                    //int temp = bed.IsExistBedNo(this.cmbNurse.SelectedItem.ID + bedNo);

                    string zdSourceBedNO = txtBedNo.Text; //ԭʼ´²ºÅ
                    string zdPreTxt      = "";            //ǰ׺
                    string zdBedNO       = "";            //´²Î»±àºÅ
                    zdBedNO = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(zdSourceBedNO);
                    if (zdBedNO.Length != zdSourceBedNO.Length)
                    {
                        MessageBox.Show("°üº¬ÌØÊâ×Ö·û£¬ÇëÖØÐÂÊäÈ룡");
                        return(-1);
                    }
                    if (zdSourceBedNO.Contains("+"))
                    {
                        zdPreTxt = "+";
                        zdBedNO  = zdBedNO.Substring(1);
                    }
                    else if (zdSourceBedNO.Contains("¼Ó"))
                    {
                        zdPreTxt = "¼Ó";
                        zdBedNO  = zdBedNO.Substring(1);
                    }
                    else
                    {
                        //²»´¦Àí
                    }
                    int temp = bed.IsExistBedNo(this.cmbNurse.SelectedItem.ID + zdPreTxt + zdBedNO);
                    #endregion
                    if (temp == 0)
                    {
                        //ûÓÐ
                    }
                    else if (temp == 1)
                    {
                        //{CE0F5F09-987B-49f4-862C-63930084A18A}
                        //this.Err = "ÒѾ­´æÔÚ´²Î»ºÅ " + bedNo + "ÇëÐ޸ģ¡";
                        this.Err = "ÒѾ­´æÔÚ´²Î»ºÅ " + zdPreTxt + zdBedNO + "ÇëÐ޸ģ¡";
                        txtBedNo.Focus();
                        return(-1);
                    }
                }
            }

            if (this.txtWardNo.Text == "")
            {
                this.Err = "²¡·¿ºÅΪ¿Õ£¬ÇëÌîд£¡";
                return(-1);
            }
            if (this.cmdBedGrade.Text == "")
            {
                this.Err = "´²Î»µÈ¼¶Îª¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }
            if (this.cmbBedWeave.Text == "")
            {
                this.Err = "´²Î»±àÖÆΪ¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }
            if (this.cmbBedStatus.Text == "")
            {
                this.Err = "´²Î»×´Ì¬Îª¿Õ£¬ÇëÑ¡Ôñ£¡";
                return(-1);
            }

            if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtPhone.Text, 14))
            {
                this.Err = "´²Î»µç»°×Ϊ14λ,ÇëÖØÐÂÊäÈë";
                return(-1);
            }
            if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.txtWardNo.Text, 10))
            {
                this.Err = "²¡ÊҺŹý³¤,ÇëÖØÐÂÊäÈë";
                return(-1);
            }
            return(0);
        }