private void btSearchManager_Click(object sender, EventArgs e)
        {
            string information = "";

            switch (combManager.Text.Trim())
            {
            case "工号":
                information = "manID";
                break;

            case "姓名":
                information = "manName";
                break;

            case "性别":
                information = "manSex";
                break;

            case "年龄":
                information = "manAge";
                break;

            default:
                break;
            }
            Maticsoft.BLL.Manager man = new BLL.Manager();
            string string1            = string.Format("{0} = '{1}'", information, tbManager.Text.Trim());

            if (information == "manID")
            {
                Model.Manager manmodel = new Model.Manager();
                manmodel = man.GetModel1(string1);
                if (manmodel.manID == "" || manmodel.manID == null)
                {
                    MessageBox.Show("查无此人");
                }
                else
                {
                    SeekManager see = new Hotel.SeekManager(manmodel);
                    see.ShowDialog(this);
                }
            }
            else
            {
                DataSet ds = new DataSet();
                ds = man.GetList(string1);
                dgvManager.DataSource = ds.Tables[0];
                ds.Tables[0].Columns["manID"].ColumnName   = "前台工号";
                ds.Tables[0].Columns["manName"].ColumnName = "姓名";
                ds.Tables[0].Columns["manSex"].ColumnName  = "性别";
                ds.Tables[0].Columns["manAge"].ColumnName  = "年龄";
                ds.Tables[0].Columns["passwd"].ColumnName  = "密码";
                dgvManager.AllowUserToAddRows = false;
                dgvManager.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            }
        }
Exemple #2
0
        private void tbID_TextChanged_1(object sender, EventArgs e)
        {
            Maticsoft.BLL.Manager man = new BLL.Manager();
            string string1            = string.Format("manID = '{0}'", tbID.Text.Trim());

            if (man.GetRecordCount(string1) == 1)
            {
                Model.Manager manmodel = new Model.Manager();
                nudAge.Value = man.GetModel1(string1).manAge;
            }
            else
            {
                nudAge.Value = 18;
            }
        }