日期:2014-05-16  浏览次数:20457 次

关于asp.net里填写用户信息出现的问题,求助!
在写提交用户信息的时候出现了一下的问题:1、如果啥都没写,然后点保存,则提示“请填写正确的电话号码”,可是如果啥都填了,有提示我“请填写好超市名”各位大神帮忙看看代码哪里出了问题:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAL;
using System.Text.RegularExpressions;



namespace frmEmpInfo
{
    public partial class frmSupermarket : Form
    {
        public frmSupermarket()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            tb_Supermarket addInfo = new tb_Supermarket();
            addInfo.SupermarketName = tb_name.Text;
            addInfo.SupermarketDirector = tb_Director.Text;
            addInfo.SupermarketPwd = tb_psw.Text;
            addInfo.SupermarketRePwd = tb_pswreturn.Text;
            addInfo.SupermarketPhone = tb_phone.Text;
            addInfo.SupermarketAddress = tb_supperaddress.Text;
            addInfo.SupermarketRemark = tb_remark.Text;
            addSupermarket Daladd = new addSupermarket();
            if(CheckSuper()==1){
    
            
            if (Daladd.Insert(addInfo) == 1)
            {
                MessageBox.Show("保存成功");
            }
            else
            {
                MessageBox.Show("保存失败");
            }
          
            }
          
          
        }

       private int CheckSuper()
       {
           if (tb_name.Text != null&&tb_name.Text !="")