public ActionResult Index(PatBasicInfor pat)
        {
            PatOperation pto = new PatOperation();

            string PID = Request.Form["门诊号"];

            if (string.IsNullOrEmpty(pat.Name) || string.IsNullOrEmpty(pat.Sex) || string.IsNullOrEmpty(pat.Age) || string.IsNullOrEmpty(pat.Phone))
            {
                ModelState.AddModelError("", "带*的输入项不能为空");
            }
            else
            {
                Regex reg = new Regex("^[0-9]+$");
                Match ma1 = reg.Match(pat.Age);
                Match ma2 = reg.Match(pat.Phone);
                if (ma1.Success && ma2.Success)
                {
                }
                else
                {
                    ModelState.AddModelError("", "手机和年龄必须为数字");
                }
            }
            if (ModelState.IsValid)
            {
                string user;
                user = HttpContext.Request.Cookies["username"].Value.ToString();
                pto.InsertPat(pat, PID, user);
                return(RedirectToAction("Index", "Diagnosis", new { ID = pat.Id }));
            }
            else
            {
                return(View());
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (dgvOperList.SelectedRows.Count > 0)
            {
                PatOperation po = new PatOperation();
                po.OperCode  = dgvOperList.CurrentRow.Cells["OperCode"].Value.ToString();
                po.OperName  = dgvOperList.CurrentRow.Cells["OperName"].Value.ToString();
                po.OperLevel = dgvOperList.CurrentRow.Cells["OperLevel"].Value.ToString();
                po.CutType   = dgvOperList.CurrentRow.Cells["CutType"].Value.ToString();


                DataTable dt = _PatOperationDal.GetPatOperationByCode(MzjldId, po.OperCode);
                if (dt.Rows.Count == 0)
                {
                    int res = _PatOperationDal.InsertPatOperation(po, MzjldId);
                    if (res > 0)
                    {
                        BindDgvSelected();
                    }
                }
                else
                {
                    MessageBox.Show("该手术已添加!");
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 插入病人手术列表
        /// </summary>
        /// <param name="po"></param>
        /// <param name="mzjldId"></param>
        /// <returns></returns>
        public int InsertPatOperation(PatOperation po, int mzjldId)
        {
            string sql = string.Format("insert into  PatOperation(mzjldId,OperCode,OperName,OperLevel,CutType) values('{0}','{1}','{2}','{3}','{4}')  ",
                                       mzjldId, po.OperCode, po.OperName, po.OperLevel, po.CutType);

            return(dBConn.ExecuteNonQuery(sql));
        }
Esempio n. 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (dgvSelected.SelectedRows.Count > 0)
            {
                PatOperation po = new PatOperation();
                int          id = dgvSelected.CurrentRow.Cells["id"].Value.ToInt32();

                int res = _PatOperationDal.DelPatOperation(id);
                if (res > 0)
                {
                    BindDgvSelected();
                }
            }
        }