protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsDateTime(txtdatetime.Text)) { strErr+="datetime格式错误!\\n"; } if(this.txtloginfo.Text.Trim().Length==0) { strErr+="loginfo不能为空!\\n"; } if(this.txtParticular.Text.Trim().Length==0) { strErr+="Particular不能为空!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } DateTime datetime=DateTime.Parse(this.txtdatetime.Text); string loginfo=this.txtloginfo.Text; string Particular=this.txtParticular.Text; KDMYsoft.Model.Nhiber.S_Log model=new KDMYsoft.Model.Nhiber.S_Log(); model.datetime=datetime; model.loginfo=loginfo; model.Particular=Particular; KDMYsoft.BLL.Nhiber.S_Log bll=new KDMYsoft.BLL.Nhiber.S_Log(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsDateTime(txtdatetime.Text)) { strErr += "datetime格式错误!\\n"; } if (this.txtloginfo.Text.Trim().Length == 0) { strErr += "loginfo不能为空!\\n"; } if (this.txtParticular.Text.Trim().Length == 0) { strErr += "Particular不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } DateTime datetime = DateTime.Parse(this.txtdatetime.Text); string loginfo = this.txtloginfo.Text; string Particular = this.txtParticular.Text; KDMYsoft.Model.Nhiber.S_Log model = new KDMYsoft.Model.Nhiber.S_Log(); model.datetime = datetime; model.loginfo = loginfo; model.Particular = Particular; KDMYsoft.BLL.Nhiber.S_Log bll = new KDMYsoft.BLL.Nhiber.S_Log(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int ID) { KDMYsoft.BLL.Nhiber.S_Log bll = new KDMYsoft.BLL.Nhiber.S_Log(); KDMYsoft.Model.Nhiber.S_Log model = bll.GetModel(ID); this.lblID.Text = model.ID.ToString(); this.txtdatetime.Text = model.datetime.ToString(); this.txtloginfo.Text = model.loginfo; this.txtParticular.Text = model.Particular; }