public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsDateTime(txtAddTimes.Text)) { strErr += "回复时间格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.lblId.Text); int Fk_Leaveword_Id = int.Parse(this.ddlFk_Leaveword_Id.SelectedValue); String Contents = this.txtContents.Text; int Fk_Users_Id = int.Parse(this.ddlFk_Users_Id.SelectedValue); DateTime AddTimes = DateTime.Parse(this.txtAddTimes.Text); Maticsoft.Model.Reply model = new Maticsoft.Model.Reply(); model.Id = Id; model.Fk_Leaveword_Id = Fk_Leaveword_Id; model.Contents = Contents; model.Fk_Users_Id = Fk_Users_Id; model.AddTimes = AddTimes; Maticsoft.BLL.Reply bll = new Maticsoft.BLL.Reply(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int Id) { Maticsoft.BLL.Reply bll = new Maticsoft.BLL.Reply(); Maticsoft.Model.Reply model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.ddlFk_Leaveword_Id.SelectedValue = model.Fk_Leaveword_Id.ToString(); this.txtContents.Text = model.Contents; this.ddlFk_Users_Id.SelectedValue = model.Fk_Users_Id.ToString(); this.txtAddTimes.Text = model.AddTimes.ToString(); }
private void ShowInfo(int Id) { Maticsoft.BLL.Reply bll = new Maticsoft.BLL.Reply(); Maticsoft.Model.Reply model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); BLL.Leaveword BLLLeaveword = new BLL.Leaveword(); Model.Leaveword ModelLeaveword = BLLLeaveword.GetModel((int)model.Fk_Leaveword_Id); this.lblFk_Leaveword_Id.Text = ModelLeaveword.Id.ToString(); this.lblContents.Text = model.Contents; BLL.Users BLLUsers = new BLL.Users(); Model.Users ModelUsers = BLLUsers.GetModel((int)model.Fk_Users_Id); this.lblFk_Users_Id.Text = ModelUsers.Name; this.lblAddTimes.Text = model.AddTimes.ToString(); }