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();
|
}
|
}
|
}
|