yangle
2023-03-03 c2a9a460e38c7c196fe98a94e29e6330eac3626f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Pub_Class;
 
namespace OAM
{
    public partial class frmUserset : Form
    {
 
        public string UserName;
 
        public frmUserset()
        {
            InitializeComponent();
        }
 
        private void cmdOK_Click(object sender, EventArgs e)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            if (txtUserName.Text== DBUtility.ClsPub.CurUserName)
            {
                oCn.RunProc("Update  gy_czygl set " +
                    "OtherName='" + txtOtherName.Text.Trim() + "'" +
                    ",UnderWrite='" + txtUnderWrite.Text.Trim() + "'" +
                    ",Sex='" + cmbSex.Text.Trim() + "'" +
                    ",Age='" + txtAge.Text.Trim() + "'" +
                    ",RelName='" + txtRelName.Text.Trim() + "'" +
                    ",Animal='" + cmbAnimal.Text.Trim() + "'" +
                    ",Blood='" + cmbBlood.Text.Trim() + "'" +
                    ",BirthdayMonth='" + cmbBirthdayMonth.Text.Trim() + "'" +
                    ",BirthdayDay='" + cmbBirthdayDay.Text.Trim() + "'" +
                    ",PhoneCom='" + txtPhoneCom.Text.Trim() + "'" +
                    ",PhoneComSub='" + txtPhoneComSub.Text.Trim() + "'" +
                    ",MovePhone='" + txtMovePhone.Text.Trim() + "'" +
                    ",MovePhoneSub='" + txtMovePhoneSub.Text.Trim() + "'" +
                    ",EMail='" + txtEMail.Text.Trim() + "'" +
                    ",Address='" + txtAddress.Text.Trim() + "'" +
                    ",PhoneHome ='" + txtPhoneHome.Text.Trim() + "'" +
                    ",Remark= '" + txtRemark.Text.Trim() + "' Where czymc='" + Pub_Class.ClsPub.CurUserName + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                MessageBox.Show("×ÊÁÏÐ޸ijɹ¦");
            }
            else
            {
               
            }
           
        }
 
        public void Display()
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                //²éѯ±í
                DataSet Ds;
                Ds = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + UserName + "'", "gy_czygl");
                if (Ds.Tables[0].Rows.Count == 0)
                {
                    return;
                }
                //¸³Öµ
                txtUserName.Text = Ds.Tables[0].Rows[0]["czymc"].ToString().Trim();
                txtOtherName.Text  = Ds.Tables[0].Rows[0]["OtherName"].ToString().Trim();
                txtUnderWrite.Text = Ds.Tables[0].Rows[0]["UnderWrite"].ToString().Trim();
                cmbSex.Text = Ds.Tables[0].Rows[0]["Sex"].ToString().Trim();
                txtAge.Text = Ds.Tables[0].Rows[0]["Age"].ToString().Trim();
                txtRelName.Text = Ds.Tables[0].Rows[0]["RelName"].ToString().Trim();
                cmbAnimal.Text = Ds.Tables[0].Rows[0]["Animal"].ToString().Trim();
                cmbBlood.Text = Ds.Tables[0].Rows[0]["Blood"].ToString().Trim();
                cmbBirthdayMonth.Text = Ds.Tables[0].Rows[0]["BirthdayMonth"].ToString().Trim();
                cmbBirthdayDay.Text = Ds.Tables[0].Rows[0]["BirthdayDay"].ToString().Trim();
                txtPhoneCom.Text = Ds.Tables[0].Rows[0]["PhoneCom"].ToString().Trim();
                txtPhoneComSub.Text = Ds.Tables[0].Rows[0]["PhoneComSub"].ToString().Trim();
                txtMovePhone.Text = Ds.Tables[0].Rows[0]["MovePhone"].ToString().Trim();
                txtMovePhoneSub.Text = Ds.Tables[0].Rows[0]["MovePhoneSub"].ToString().Trim();
                txtEMail.Text = Ds.Tables[0].Rows[0]["EMail"].ToString().Trim();
                txtAddress.Text = Ds.Tables[0].Rows[0]["Address"].ToString().Trim();
                txtPhoneHome.Text = Ds.Tables[0].Rows[0]["PhoneHome"].ToString().Trim();
                txtRemark.Text = Ds.Tables[0].Rows[0]["Remark"].ToString().Trim();
                return;
            }
            catch (Exception e)
            {
                return;
            }
        
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            Display();
        }
 
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}