Пример #1
0
 private void DoctorForm_Load(object sender, EventArgs e)
 {
     if (mode == 1)
     {
         propertyGrid1.SelectedObject = AllValue.Mapping <Five, Person>(p);
     }
 }
Пример #2
0
        private void InfoShow_Load(object sender, EventArgs e)
        {
            this.Text = p.b_name;
            label1.Text = p.getbasic();
            var pic = p.b_image;
            if (!string.IsNullOrEmpty(pic))
            {
                //直接返Base64码转成数组
                byte[] imageBytes = Convert.FromBase64String(pic);
                //读入MemoryStream对象
                MemoryStream memoryStream = new MemoryStream(imageBytes, 0, imageBytes.Length);
                memoryStream.Write(imageBytes, 0, imageBytes.Length);
                //转成图片
                Image image = Image.FromStream(memoryStream);
                //memoryStream.Close();//不要加上这一句否则就不对了
                // 将图片放置在 PictureBox 中
                this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
                this.pictureBox1.Image = image;
            }

            if (mode == 2)
            {
                propertyGrid1.Visible = false;
            }
            else if (mode == 3)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Five, Person>(p);
            }
            else if (mode == 4)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Wai, Person>(p);
            }
            else if (mode == 5)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Nei, Person>(p);
            }
            else if (mode == 6)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Other, Person>(p);
            }
            else if (mode == 7)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<SummaryView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "填写总结";
            }else if (mode==8)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<ReCheckView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "填写审查";
            }else if (mode == 1)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<SuperView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "修改";
            }
        }
Пример #3
0
 private void DoctorForm_Load(object sender, EventArgs e)
 {
     this.Text = p.b_name + " 信息修改";
     if (mode == 3)
     {
         Five f = AllValue.Mapping <Five, Person>(p);
         f.f_eye_op  = AllValue.loginUser.m_name;
         f.f_oral_op = AllValue.loginUser.m_name;
         f.f_oto_op  = AllValue.loginUser.m_name;
         propertyGrid1.SelectedObject = f;
     }
     else if (mode == 2)
     {
         propertyGrid1.SelectedObject = AllValue.Mapping <Basic_info, Person>(p);
     }
     else if (mode == 4)
     {
         Wai w = AllValue.Mapping <Wai, Person>(p);
         w.w_advice = AllValue.loginUser.m_name;
         propertyGrid1.SelectedObject = w;
     }
     else if (mode == 5)
     {
         Nei n = AllValue.Mapping <Nei, Person>(p);
         n.n_advice = AllValue.loginUser.m_name;
         propertyGrid1.SelectedObject = n;
     }
     else if (mode == 6)
     {
         Other o = AllValue.Mapping <Other, Person>(p);
         o.o_advice = AllValue.loginUser.m_name;
         propertyGrid1.SelectedObject = o;
     }
     else if (mode == 7)
     {
         Summary s = AllValue.Mapping <Summary, Person>(p);
         s.s_hosi_sign = AllValue.loginUser.m_hospital;
         s.s_sign      = AllValue.loginUser.m_name;
         propertyGrid1.SelectedObject = s;
     }
     else if (mode == 8)
     {
         ReCheck c = AllValue.Mapping <ReCheck, Person>(p);
         c.c_sign = AllValue.loginUser.m_hospital;
         propertyGrid1.SelectedObject = c;
     }
     else if (mode == 1)
     {
         SuperEdit sp = AllValue.Mapping <SuperEdit, Person>(p);
         propertyGrid1.SelectedObject = sp;
     }
 }
Пример #4
0
 private void UserEditForm_Load(object sender, EventArgs e)
 {
     if (mode == 0)
     {
         propertyGrid1.SelectedObject = AllValue.Mapping <Basic, Manager>(m);
     }
     else if (mode == 1)
     {
         Basic newb = new Basic();
         propertyGrid1.SelectedObject = newb;
         propertyGrid1.Enabled        = true;
         button2.Visible = false;
         button1.Visible = true;
     }
 }
Пример #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (mode == 0)
     {
         Manager newm = AllValue.Mapping <Manager, Basic>((Basic)propertyGrid1.SelectedObject);
         newm.m_id = m.m_id;
         try
         {
             AllValue.db.Execute(
                 "UPDATE manager SET m_account=@m_account, m_name=@m_name, m_authority=@m_authority, m_hospital=@m_hospital, m_phone=@m_phone, m_password=@m_password WHERE m_id=@m_id;",
                 newm);
             MessageBox.Show("更新成功,刷新可见");
             this.Close();
         }
         catch (Exception exception)
         {
             Console.WriteLine(exception);
             MessageBox.Show("更新失败");
         }
     }
     else if (mode == 1)
     {
         Manager newManager = AllValue.Mapping <Manager, Basic>((Basic)propertyGrid1.SelectedObject);
         int     exist      = AllValue.db.Query <Manager>("SELECT * FROM manager WHERE m_account=@m_account;", newManager)
                              .ToList().Count;
         if (exist != 0)
         {
             MessageBox.Show("账户已存在");
             return;
         }
         else
         {
             try
             {
                 AllValue.db.Execute(
                     "INSERT INTO manager(m_account, m_name, m_authority, m_hospital, m_phone, m_password) VALUES (@m_account, @m_name, @m_authority, @m_hospital, @m_phone, @m_password)",
                     newManager);
                 MessageBox.Show("添加成功");
                 this.Close();
             }
             catch (Exception exception)
             {
                 Console.WriteLine(exception);
                 MessageBox.Show("添加失败");
             }
         }
     }
 }
Пример #6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (mode == 1)
     {
         Person newp = AllValue.Mapping <Person, Five>((Five)propertyGrid1.SelectedObject);
         newp.b_id = p.b_id;
         Console.WriteLine(newp.f_eyeL);
         try
         {
             AllValue.db.Execute(
                 "UPDATE person SET f_eyeL=@f_eyeL, f_eyeR=@f_eyeR, f_eyeL_correct=@f_eyeL_correct, f_eyeR_correct=@f_eyeR_correct, f_eye_otherill=@f_eye_otherill, f_eye_colorpic=@f_eye_colorpic, f_eye_color=@f_eye_color, f_earL=@f_earL, f_earR=@f_earR, f_earill=@f_earill, f_nosesmell=@f_nosesmell, f_face=@f_face, f_throat=@f_throat, f_orallip=@f_orallip, f_oraltooth=@f_oraltooth, f_other=@f_other, f_eye_op=@f_eye_op, f_oto_op=@f_oto_op, f_oral_op=@f_oral_op WHERE b_id=@b_id",
                 newp);
             MessageBox.Show("更新成功");
             this.Close();
         }
         catch (Exception exception)
         {
             Console.WriteLine(exception);
             MessageBox.Show("更新失败");
         }
     }
 }
Пример #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (mode == 3)
            {
                Person newp = AllValue.Mapping <Person, Five>((Five)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET f_eyeL=@f_eyeL, f_eyeR=@f_eyeR, f_eyeL_correct=@f_eyeL_correct, f_eyeR_correct=@f_eyeR_correct, f_eye_otherill=@f_eye_otherill, f_eye_colorpic=@f_eye_colorpic, f_eye_color=@f_eye_color, f_earL=@f_earL, f_earR=@f_earR, f_earill=@f_earill, f_nosesmell=@f_nosesmell, f_face=@f_face, f_throat=@f_throat, f_orallip=@f_orallip, f_oraltooth=@f_oraltooth, f_other=@f_other, f_eye_op=@f_eye_op, f_oto_op=@f_oto_op, f_oral_op=@f_oral_op WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 2)
            {
                Person newp = AllValue.Mapping <Person, Basic_info>((Basic_info)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET b_name=@b_name, b_sex=@b_sex, b_birth=@b_birth, b_marriage=@b_marriage, b_image=@b_image, b_educated=@b_educated, b_nation=@b_nation, b_occupation=@b_occupation, b_birthplace=@b_birthplace, b_phone=@b_phone, b_email=@b_email, b_address=@b_address, b_anamnesis=@b_anamnesis WHERE b_id=@b_id;",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 4)
            {
                Person newp = AllValue.Mapping <Person, Wai>((Wai)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET w_height=@w_height, w_weight=@w_weight, w_skin=@w_skin, w_lymph=@w_lymph, w_thyroid=@w_thyroid, w_spine=@w_spine, w_arm_and_leg=@w_arm_and_leg, w_arthrosis=@w_arthrosis, w_flatfoot=@w_flatfoot, w_others=@w_others, w_advice=@w_advice WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 5)
            {
                Person newp = AllValue.Mapping <Person, Nei>((Nei)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET n_blood=@n_blood, n_heartrate=@n_heartrate, n_grow=@n_grow, n_nerve=@n_nerve, n_breath=@n_breath, n_heartvessel=@n_heartvessel, n_liver=@n_liver, n_spleen=@n_spleen, n_kidney=@n_kidney, n_others=@n_others, n_advice=@n_advice WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 6)
            {
                Person newp = AllValue.Mapping <Person, Other>((Other)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET o_blood=@o_blood,o_liver=@o_liver,o_piss=@o_piss,o_chest=@o_chest,o_othercheck=@o_othercheck,o_stutter=@o_stutter,o_outlook=@o_outlook,o_advice=@o_advice,o_sign=@o_sign WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 7)
            {
                Person newp = AllValue.Mapping <Person, Summary>((Summary)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET s_conclusion=@s_conclusion,s_sign=@s_sign,s_time=@s_time,s_hospital=@s_hospital,s_hosi_sign=@s_hosi_sign WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 8)
            {
                Person newp = AllValue.Mapping <Person, ReCheck>((ReCheck)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET c_advice=@c_advice,c_sign=@c_sign,c_note=@c_note WHERE b_id=@b_id",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
            else if (mode == 1)
            {
//                SuperEdit sp = new SuperEdit();
//                Type t = sp.GetType();
//                foreach (PropertyInfo pi in t.GetProperties())
//                {
//                    Console.WriteLine(pi.Name);
//                }
                Person newp = AllValue.Mapping <Person, SuperEdit>((SuperEdit)propertyGrid1.SelectedObject);
                newp.b_id = p.b_id;
                try
                {
                    AllValue.db.Execute(
                        "UPDATE person SET b_sex=@b_sex, b_college=@b_college,b_idcard=@b_idcard,b_name=@b_name,b_birth=@b_birth,b_marriage=@b_marriage,b_educated=@b_educated,b_nation=@b_nation,b_occupation=@b_occupation,b_birthplace=@b_birthplace,b_phone=@b_phone,b_email=@b_email,b_address=@b_address,b_anamnesis=@b_anamnesis,f_eyeL=@f_eyeL,f_eyeR=@f_eyeR,f_eyeL_correct=@f_eyeL_correct,f_eyeR_correct=@f_eyeR_correct,f_eye_otherill=@f_eye_otherill,f_eye_colorpic=@f_eye_colorpic,f_eye_color=@f_eye_color,f_earL=@f_earL,f_earR=@f_earR,f_earill=@f_earill,f_nosesmell=@f_nosesmell,f_face=@f_face,f_throat=@f_throat,f_orallip=@f_orallip,f_oraltooth=@f_oraltooth,f_other=@f_other,f_eye_op=@f_eye_op,f_oto_op=@f_oto_op,f_oral_op=@f_oral_op,w_height=@w_height,w_weight=@w_weight,w_skin=@w_skin,w_lymph=@w_lymph,w_thyroid=@w_thyroid,w_spine=@w_spine,w_arm_and_leg=@w_arm_and_leg,w_arthrosis=@w_arthrosis,w_flatfoot=@w_flatfoot,w_others=@w_others,w_advice=@w_advice,n_blood=@n_blood,n_heartrate=@n_heartrate,n_grow=@n_grow,n_nerve=@n_nerve,n_breath=@n_breath,n_heartvessel=@n_heartvessel,n_liver=@n_liver,n_spleen=@n_spleen,n_kidney=@n_kidney,n_others=@n_others,n_advice=@n_advice,o_blood=@o_blood,o_liver=@o_liver,o_piss=@o_piss,o_chest=@o_chest,o_othercheck=@o_othercheck,o_stutter=@o_stutter,o_outlook=@o_outlook,o_advice=@o_advice,s_conclusion=@s_conclusion,s_sign=@s_sign,s_hospital=@s_hospital,s_hosi_sign=@s_hosi_sign,s_time=@s_time,c_advice=@c_advice,c_sign=@c_sign,c_note=@c_note WHERE b_id=@b_id;",
                        newp);
                    MessageBox.Show("更新成功,请手动刷新界面");
                    this.Close();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                    MessageBox.Show("更新失败");
                }
            }
        }