Пример #1
0
        private void Frm_Waiter_Load(object sender, EventArgs e)
        {
            try
            {
                string  str_sql = "select a.Waiter_ID,a.Waiter_Nmae,a.Waiter_Sex,a.Waiter_Age,b.Duty_Name,a.Waiter_Phone,a.Waiter_birthday,a.Waiter_IDCard,a.Waiter_Address,a.Beizhu   from tb_Waiter as a,tb_duty as b where Waiter_duty=Duty_ID";
                DataSet ds      = db.GetDataFromSQL(str_sql);
                DGV_info.DataSource = ds.Tables[0];
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    CB_ID.Items.Add(ds.Tables[0].Rows[i]["Waiter_ID"].ToString().Trim());
                }

                // 查询员工职务名称

                string zw = "select Duty_Name from tb_duty";
                ds = db.GetDataFromSQL(zw);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    CB_zhiwu.Items.Add(ds.Tables[0].Rows[i]["Duty_Name"].ToString().Trim());
                }

                CB_ID.Focus();
            }
            catch { }
        }
Пример #2
0
        private void but_HY_Click(object sender, EventArgs e)
        {
            try
            {
                but_HY.Visible      = false;                      //隐藏会员按钮
                but_PT.Visible      = true;                       //显示普通按钮
                CB_ID.DropDownStyle = ComboBoxStyle.DropDownList; //显示下拉框
                CB_ID.Enabled       = true;
                CB_ID.Focus();

                //获取会员编号
                CB_ID.Items.Clear();
                string  str_sql = "select member_ID from tb_member";
                DataSet ds      = db.GetDataFromSQL(str_sql);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    CB_ID.Items.Add(ds.Tables[0].Rows[i][0].ToString().Trim());
                }
                CB_ID.SelectedIndex = 0;
            }
            catch { }
            //string str_sql = "select a.member_Name,a.Member_JF,b.Mt_Name,b.Mt_agio from tb_membertype b,tb_member a  where a.Member_DJ=b.Mt_ID";
            //DataSet ds = db.GetDataFromSQL(str_sql);
            ////CB_ID.Text = "普通顾客";
            //LB_Name.Text = ds.Tables[0].Rows[0]["member_Name"].ToString().Trim();
            //LB_JF.Text = ds.Tables[0].Rows[0]["Member_JF"].ToString().Trim();
            //LB_DJ.Text = ds.Tables[0].Rows[0]["Mt_Name"].ToString().Trim();
            //  LB_ZK.Text = ds.Tables[0].Rows[0]["Mt_agio"].ToString().Trim();
            //LB_Ymoney.Text = LB_money.Text;
            //LB_Smoney.Text = LB_money.Text;
            //LB_ZL.Text = "0.00";
        }
Пример #3
0
        private void but_xianshi_Click(object sender, EventArgs e)
        {
            try
            {
                string  str_sql = "select a.Waiter_ID,a.Waiter_Nmae,a.Waiter_Sex,a.Waiter_Age,b.Duty_Name,a.Waiter_Phone,a.Waiter_birthday,a.Waiter_IDCard,a.Waiter_Address,a.Beizhu   from tb_Waiter as a,tb_duty as b where Waiter_duty=Duty_ID";
                DataSet ds      = db.GetDataFromSQL(str_sql);
                DGV_info.DataSource = ds.Tables[0];

                CB_zhiwu.Text = "";
                TB_Name.Text  = "";
                CB_ID.Text    = "";
                CB_ID.Focus();
            }
            catch { }
        }
Пример #4
0
        private void but_HY_Click(object sender, EventArgs e)
        {
            try
            {
                but_HY.Visible      = false;                      //隐藏会员按钮
                but_PT.Visible      = true;                       //显示普通按钮
                CB_ID.DropDownStyle = ComboBoxStyle.DropDownList; //显示下拉框
                CB_ID.Enabled       = true;
                CB_ID.Focus();

                //获取会员编号
                CB_ID.Items.Clear();
                string  str_sql = "select member_ID from tb_member";
                DataSet ds      = db.GetDataFromSQL(str_sql);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    CB_ID.Items.Add(ds.Tables[0].Rows[i][0].ToString().Trim());
                }
                CB_ID.SelectedIndex = 0;
            }
            catch { }
        }