if (this.txtPersonID.ReadOnly == false) {
if (sMgr.ExistsPerson(this.txtPersonID.Text)) {
this.SendMessage(\õ¼Ѿ\ return; }
person.Password = \ } else {
person = sMgr.GetPerson(this.txtPersonID.Text); }
person.PersonID = this.txtPersonID.Text.Trim();
person.PersonName = this.txtPersonName.Text.Trim(); if (this.txtPassword.Text != \ {
person.Password = this.txtPassword.Text; }
person.Card = this.txtCard.Text;
person.Dept.DeptID = this.lstDeptID.SelectedValue; person.Sex = this.lstSex.SelectedValue; person.Birtyday = this.txtBirthday.Text; person.WorkDate = this.txtWorkDate.Text; person.Tel = this.txtTel.Text;
person.Pay = double.Parse(this.txtPay.Text.Trim()); sMgr.UpdatePerson(person);
this.SendMessage(\Ϣ༭ɹ\ if (!this.txtPersonID.ReadOnly) {
this.ClearTextData(this); } }
3ijԱɾťɾԱϢ ɾҪ£
protected void dgList_DeleteCommand(object source, DataGridCommand EventArgs e)
{
PersonMgr sMgr = new PersonMgr(); sMgr.DelPerson(e.Item.Cells[0].Text); this.initForm(); }
4༭ťԱϢ档ԱϢԵĴļΪ
25
Person_Edit.aspx?PersonID= ģͼ4-11ʾ
ͼ4-11ԱϢ
4.4.5Ŀģ
ҵԱĿĿϢй
1ĿģӦĴļΪProject_List.aspxĿͼ4-12ʾ
ͼ4-12Ŀ
26
2ĿģӦĴļΪProject_Edit.aspxĿͼ4-13ʾ
ͼ4-13Ŀ
СύťҪ£
protected void btnOK_Click(object sender, EventArgs e) {
PersonMgr sMgr = new PersonMgr(); Person person = new Person();
if (this.txtPersonID.ReadOnly == false) {
if (sMgr.ExistsPerson(this.txtPersonID.Text)) {
this.SendMessage(\õ¼Ѿ\ return; }
person.Password = \ } else {
person = sMgr.GetPerson(this.txtPersonID.Text); }
person.PersonID = this.txtPersonID.Text.Trim(); person.PersonName = this.txtPersonName.Text.Trim(); if (this.txtPassword.Text != \ {
person.Password = this.txtPassword.Text; }
27
person.Card = this.txtCard.Text;
person.Dept.DeptID = this.lstDeptID.SelectedValue; person.Sex = this.lstSex.SelectedValue; person.Birtyday = this.txtBirthday.Text; person.WorkDate = this.txtWorkDate.Text; person.Tel = this.txtTel.Text;
person.Pay = double.Parse(this.txtPay.Text.Trim());
sMgr.UpdatePerson(person);
this.SendMessage(\Ϣ༭ɹ\ if (!this.txtPersonID.ReadOnly) {
this.ClearTextData(this); }
}
3༭ĿģӦĴļΪProject_Edit.aspx?ProjectID=༭Ŀͼ4-14ʾ
ͼ4-14༭Ŀ
4ɾťɾĿϢ СɾťҪ£
protected void dgList_DeleteCommand(object source, DataGridCommandEventArgs e) {
ProjectMgr sMgr = new ProjectMgr(); sMgr.DelProject(e.Item.Cells[0].Text); this.initForm(); }
28