private void ShowInfo(int AnswerId) { NoName.NetShop.BLL.AnswerModelBll bll = new NoName.NetShop.BLL.AnswerModelBll(); NoName.NetShop.Model.AnswerModel model = bll.GetModel(AnswerId); this.lblQuestionId.Text = model.QuestionId.ToString(); this.lblTitle.Text = model.Title; this.lblBrief.Text = model.Brief; this.lblContent.Text = model.Content; this.lblAnswerTime.Text = model.AnswerTime.ToString(); }
private void ShowInfo(int AnswerId) { NoName.NetShop.BLL.AnswerModelBll bll=new NoName.NetShop.BLL.AnswerModelBll(); NoName.NetShop.Model.AnswerModel model=bll.GetModel(AnswerId); this.lblQuestionId.Text=model.QuestionId.ToString(); this.lblTitle.Text=model.Title; this.lblBrief.Text=model.Brief; this.lblContent.Text=model.Content; this.lblAnswerTime.Text=model.AnswerTime.ToString(); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtQuestionId.Text)) { strErr += "QuestionId不是数字!\\n"; } if (this.txtTitle.Text == "") { strErr += "Title不能为空!\\n"; } if (this.txtBrief.Text == "") { strErr += "Brief不能为空!\\n"; } if (this.txtContent.Text == "") { strErr += "Content不能为空!\\n"; } if (!PageValidate.IsDateTime(txtAnswerTime.Text)) { strErr += "AnswerTime不是时间格式!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int QuestionId = int.Parse(this.txtQuestionId.Text); string Title = this.txtTitle.Text; string Brief = this.txtBrief.Text; string Content = this.txtContent.Text; DateTime AnswerTime = DateTime.Parse(this.txtAnswerTime.Text); NoName.NetShop.Model.AnswerModel model = new NoName.NetShop.Model.AnswerModel(); model.QuestionId = QuestionId; model.Title = Title; model.Brief = Brief; model.Content = Content; model.AnswerTime = AnswerTime; NoName.NetShop.BLL.AnswerModelBll bll = new NoName.NetShop.BLL.AnswerModelBll(); bll.Update(model); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsNumber(txtQuestionId.Text)) { strErr+="QuestionId�������֣�\\n"; } if(this.txtTitle.Text =="") { strErr+="Title����Ϊ�գ�\\n"; } if(this.txtBrief.Text =="") { strErr+="Brief����Ϊ�գ�\\n"; } if(this.txtContent.Text =="") { strErr+="Content����Ϊ�գ�\\n"; } if(!PageValidate.IsDateTime(txtAnswerTime.Text)) { strErr+="AnswerTime����ʱ���ʽ��\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int QuestionId=int.Parse(this.txtQuestionId.Text); string Title=this.txtTitle.Text; string Brief=this.txtBrief.Text; string Content=this.txtContent.Text; DateTime AnswerTime=DateTime.Parse(this.txtAnswerTime.Text); NoName.NetShop.Model.AnswerModel model=new NoName.NetShop.Model.AnswerModel(); model.QuestionId=QuestionId; model.Title=Title; model.Brief=Brief; model.Content=Content; model.AnswerTime=AnswerTime; NoName.NetShop.BLL.AnswerModelBll bll=new NoName.NetShop.BLL.AnswerModelBll(); bll.Add(model); }