private void ShowInfo() { Maticsoft.BLL.tb_User bll = new Maticsoft.BLL.tb_User(); Maticsoft.Model.tb_User model = bll.GetModel(); this.lblUserID.Text = model.UserID; this.lblPassword.Text = model.Password; this.lblWorkType.Text = model.WorkType; this.lblCreateTime.Text = model.CreateTime; this.lblChangeTime.Text = model.ChangeTime; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtUserID.Text.Trim().Length == 0) { strErr += "UserID不能为空!\\n"; } if (this.txtPassword.Text.Trim().Length == 0) { strErr += "Password不能为空!\\n"; } if (this.txtWorkType.Text.Trim().Length == 0) { strErr += "WorkType不能为空!\\n"; } if (this.txtCreateTime.Text.Trim().Length == 0) { strErr += "CreateTime不能为空!\\n"; } if (this.txtChangeTime.Text.Trim().Length == 0) { strErr += "ChangeTime不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string UserID = this.txtUserID.Text; string Password = this.txtPassword.Text; string WorkType = this.txtWorkType.Text; string CreateTime = this.txtCreateTime.Text; string ChangeTime = this.txtChangeTime.Text; Maticsoft.Model.tb_User model = new Maticsoft.Model.tb_User(); model.UserID = UserID; model.Password = Password; model.WorkType = WorkType; model.CreateTime = CreateTime; model.ChangeTime = ChangeTime; Maticsoft.BLL.tb_User bll = new Maticsoft.BLL.tb_User(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }