コード例 #1
0
ファイル: Show.aspx.cs プロジェクト: Sophomore84/-3
 private void ShowInfo(string BianMa)
 {
     Maticsoft.BLL.tb_WuPinDetail   bll   = new Maticsoft.BLL.tb_WuPinDetail();
     Maticsoft.Model.tb_WuPinDetail model = bll.GetModel(BianMa);
     this.lblBianMa.Text    = model.BianMa;
     this.lblMingCheng.Text = model.MingCheng;
     this.lblGuiGe.Text     = model.GuiGe;
     this.lblXingHao.Text   = model.XingHao;
     this.lblHeTongHao.Text = model.HeTongHao;
 }
コード例 #2
0
ファイル: Add.aspx.cs プロジェクト: Sophomore84/-3
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtBianMa.Text.Trim().Length == 0)
            {
                strErr += "BianMa不能为空!\\n";
            }
            if (this.txtMingCheng.Text.Trim().Length == 0)
            {
                strErr += "MingCheng不能为空!\\n";
            }
            if (this.txtGuiGe.Text.Trim().Length == 0)
            {
                strErr += "GuiGe不能为空!\\n";
            }
            if (this.txtXingHao.Text.Trim().Length == 0)
            {
                strErr += "XingHao不能为空!\\n";
            }
            if (this.txtHeTongHao.Text.Trim().Length == 0)
            {
                strErr += "HeTongHao不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string BianMa    = this.txtBianMa.Text;
            string MingCheng = this.txtMingCheng.Text;
            string GuiGe     = this.txtGuiGe.Text;
            string XingHao   = this.txtXingHao.Text;
            string HeTongHao = this.txtHeTongHao.Text;

            Maticsoft.Model.tb_WuPinDetail model = new Maticsoft.Model.tb_WuPinDetail();
            model.BianMa    = BianMa;
            model.MingCheng = MingCheng;
            model.GuiGe     = GuiGe;
            model.XingHao   = XingHao;
            model.HeTongHao = HeTongHao;

            Maticsoft.BLL.tb_WuPinDetail bll = new Maticsoft.BLL.tb_WuPinDetail();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }