Ejemplo n.º 1
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            bool b = false;

            if (String.IsNullOrEmpty(childname.Text.Trim()))
            {
                MessageUtil.ShowTips("儿童姓名不能为空!");
                childname.Focus();
                return;
            }

            if (String.IsNullOrEmpty(childgender.Text.Trim()))
            {
                MessageUtil.ShowTips("儿童性别不能为空!");
                childgender.Focus();
                return;
            }
            if (!String.IsNullOrEmpty(telephone.Text.Trim()))
            {
                if (!validation.Checkmobilephone(telephone.Text.Trim()))
                {
                    MessageBox.Show("手机号输入有误,请重输!", "系统提示");
                    telephone.Focus();
                    return;
                }
            }

            TB_CHILDBASE obj = getChildBaseInfoObj();

            if (_womeninfo.cd_id != -1)
            {
                obj.ID = _womeninfo.cd_id;
                b      = jibenbll.Update(obj);

                if (b)
                {
                    MessageBox.Show("保存成功!", "软件提示");
                    //new TbGaoweiBll().saveOrdeleteGaowei(textBoxX12.Text.Trim(), DateTime.Now.ToString("yyyy-MM-dd"));
                    _womeninfo.bindDataNowdayTreeView();
                    _womeninfo.treeView1_MouseDown(sender, new MouseEventArgs(MouseButtons.Left, 1, _womeninfo.treeView1.SelectedNode.Bounds.Location.X, _womeninfo.treeView1.SelectedNode.Bounds.Location.Y, 1));
                }
                else
                {
                    MessageBox.Show("保存失败!", "软件提示");
                }
            }
            else
            {
                //自动生成保健卡号
                obj.HEALTHCARDNO = jibenbll.stateval().ToString();//保健卡号
                b = jibenbll.Add(obj);
                if (b)
                {
                    _womeninfo.cd_id       = (int)obj.ID;
                    this.healthcardno.Text = obj.HEALTHCARDNO;
                    MessageBox.Show("保存成功!", "软件提示");
                    //if (!String.IsNullOrEmpty(textBoxX12.Text.Trim()))
                    //{
                    //    new TbGaoweiBll().saveOrdeleteGaowei(textBoxX12.Text.Trim(), DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
                    //}
                }
                else
                {
                    MessageBox.Show("保存失败!", "软件提示");
                }
            }
            //int[] age = CommonHelper.getAgeBytime(obj.childbirthday, DateTime.Now.ToString("yyyy-MM-dd"));
            _womeninfo.l_age.Text = CommonHelper.getAgeStr(obj.CHILDBIRTHDAY);
        }
Ejemplo n.º 2
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            bool b = false;

            if (globalInfoClass.Zhiwu == "护士")
            {
                if (String.IsNullOrEmpty(childname.Text.Trim()))
                {
                    MessageUtil.ShowTips("儿童姓名不能为空!");
                    childname.Focus();
                    return;
                }

                if (String.IsNullOrEmpty(childgender.Text.Trim()))
                {
                    MessageUtil.ShowTips("儿童性别不能为空!");
                    childgender.Focus();
                    return;
                }
                if (!String.IsNullOrEmpty(telephone.Text.Trim()))
                {
                    if (!validation.Checkmobilephone(telephone.Text.Trim()))
                    {
                        MessageBox.Show("手机号输入有误,请重输!", "系统提示");
                        telephone.Focus();
                        return;
                    }
                }
            }
            else
            {
                if (String.IsNullOrEmpty(childname_doc.Text.Trim()))
                {
                    MessageUtil.ShowTips("儿童姓名不能为空!");
                    childname_doc.Focus();
                    return;
                }

                if (String.IsNullOrEmpty(childgender_doc.Text.Trim()))
                {
                    MessageUtil.ShowTips("儿童性别不能为空!");
                    childgender_doc.Focus();
                    return;
                }
                if (!String.IsNullOrEmpty(telephone_doc.Text.Trim()))
                {
                    if (!validation.Checkmobilephone(telephone_doc.Text.Trim()))
                    {
                        MessageBox.Show("手机号输入有误,请重输!", "系统提示");
                        telephone_doc.Focus();
                        return;
                    }
                }
            }

            TB_CHILDBASE obj = getChildBaseInfoObj();

            //自动生成保健卡号
            obj.HEALTHCARDNO = jibenbll.stateval().ToString();//保健卡号
            b = jibenbll.Add(obj);
            if (b)
            {
                this.healthcardno.Text = obj.HEALTHCARDNO;
                if (MessageBox.Show("保存成功!退出?", "软件提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("保存失败!", "软件提示");
            }
        }
Ejemplo n.º 3
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            bool b = false;

            if (String.IsNullOrEmpty(childname.Text.Trim()))
            {
                MessageUtil.ShowTips("儿童姓名不能为空!");
                childname.Focus();
                return;
            }

            if (String.IsNullOrEmpty(childgender.Text.Trim()))
            {
                MessageUtil.ShowTips("儿童性别不能为空!");
                childgender.Focus();
                return;
            }
            if (String.IsNullOrEmpty(childbuildhospital.Text.Trim()))
            {
                MessageUtil.ShowTips("建册医院不能为空!");
                childbuildhospital.Focus();
                return;
            }
            if (!String.IsNullOrEmpty(telephone.Text.Trim()))
            {
                if (!validation.Checkmobilephone(telephone.Text.Trim()))
                {
                    MessageBox.Show("手机号输入有误,请重输!", "系统提示");
                    telephone.Focus();
                    return;
                }
            }

            TB_CHILDBASE obj = getChildBaseInfoObj();

            if (_jibenobj != null)
            {
                obj.ID           = _jibenobj.ID;
                obj.HEALTHCARDNO = _jibenobj.HEALTHCARDNO;
                obj.GAOWEIYINSU  = _jibenobj.GAOWEIYINSU;
                b = jibenbll.Update(obj);
                if (b)
                {
                    MessageBox.Show("保存成功!", "软件提示");
                    _jibenobj = obj;
                }
                else
                {
                    MessageBox.Show("保存失败!", "软件提示");
                }
            }
            else
            {
                //自动生成保健卡号
                obj.HEALTHCARDNO = jibenbll.stateval().ToString();//保健卡号
                b = jibenbll.Add(obj);
                if (b)
                {
                    _jibenobj = obj;
                    this.healthcardno.Text = obj.HEALTHCARDNO;
                    MessageBox.Show("保存成功!", "软件提示");
                }
                else
                {
                    MessageBox.Show("保存失败!", "软件提示");
                }
            }
        }