private void ShowInfo(string HuoJiaHao, string CengHao, string LieHao, string XuHao) { Maticsoft.BLL.tb_KuWeiDetail bll = new Maticsoft.BLL.tb_KuWeiDetail(); Maticsoft.Model.tb_KuWeiDetail model = bll.GetModel(HuoJiaHao, CengHao, LieHao, XuHao); this.lblHuoJiaHao.Text = model.HuoJiaHao; this.lblCengHao.Text = model.CengHao; this.lblLieHao.Text = model.LieHao; this.lblXuHao.Text = model.XuHao; this.lblRuKuTime.Text = model.RuKuTime; this.lblCaoZuoYuan.Text = model.CaoZuoYuan; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtHuoJiaHao.Text.Trim().Length == 0) { strErr += "HuoJiaHao不能为空!\\n"; } if (this.txtCengHao.Text.Trim().Length == 0) { strErr += "CengHao不能为空!\\n"; } if (this.txtLieHao.Text.Trim().Length == 0) { strErr += "LieHao不能为空!\\n"; } if (this.txtXuHao.Text.Trim().Length == 0) { strErr += "XuHao不能为空!\\n"; } if (this.txtRuKuTime.Text.Trim().Length == 0) { strErr += "RuKuTime不能为空!\\n"; } if (this.txtCaoZuoYuan.Text.Trim().Length == 0) { strErr += "CaoZuoYuan不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string HuoJiaHao = this.txtHuoJiaHao.Text; string CengHao = this.txtCengHao.Text; string LieHao = this.txtLieHao.Text; string XuHao = this.txtXuHao.Text; string RuKuTime = this.txtRuKuTime.Text; string CaoZuoYuan = this.txtCaoZuoYuan.Text; Maticsoft.Model.tb_KuWeiDetail model = new Maticsoft.Model.tb_KuWeiDetail(); model.HuoJiaHao = HuoJiaHao; model.CengHao = CengHao; model.LieHao = LieHao; model.XuHao = XuHao; model.RuKuTime = RuKuTime; model.CaoZuoYuan = CaoZuoYuan; Maticsoft.BLL.tb_KuWeiDetail bll = new Maticsoft.BLL.tb_KuWeiDetail(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }