Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();
            DataSet  ds    = new DataSet();

            if (comboBox1.Text.Equals("All"))
            {
                ds = s._Select("*", "good");
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("商品号"))
            {
                ds = s._Select("*", "good", "good_num", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("商品类别"))
            {
                ds = s._Select("*", "good", "good_typeid", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("商品名"))
            {
                ds = s._Select("*", "good", "good_name", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SFact    sFact = new SFact();
            SOperate s1    = sFact.Select();

            if (s1._Select("*", "staff", "sta_num", textBox1.Text).Tables[0].Rows.Count == 0)
            {
                if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox5.Text != "" && textBox6.Text != "" &&
                    textBox7.Text != "")
                {
                    SOperate s = sFact.Add();
                    s._Add("staff(sta_name,sta_pwd,sta_num,sta_sex,sta_age,pos_id,sta_startime)",
                           textBox2.Text, textBox7.Text, textBox1.Text, textBox5.Text, textBox3.Text, comboBox1.Text, textBox6.Text);
                    ClearInfo();
                    MessageBox.Show("添加成功");
                }
                else
                {
                    MessageBox.Show("存在输入信息为空。!");
                }
            }
            else
            {
                MessageBox.Show("该员工账号已存在!");
            }
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            SFact    sFact = new SFact();
            SOperate s1    = sFact.Select();

            if (s1._Select("*", "vip", "vip_num", textBox1.Text).Tables[0].Rows.Count == 0)
            {
                if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox5.Text != "" && textBox6.Text != "" &&
                    textBox7.Text != "")
                {
                    SOperate s = sFact.Add();
                    s._Add("vip(vip_num,vip_name,vip_sex,vip_age,vip_money,vip_pwd,vip_phone)", "'" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" +
                           textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "' ");
                    textBox1.Text = "";
                    textBox2.Text = "";
                    textBox3.Text = "";
                    textBox4.Text = "";
                    textBox5.Text = "";
                    textBox6.Text = "";
                    textBox7.Text = "";
                }
                else
                {
                    MessageBox.Show("存在输入信息为空。!");
                }
            }
            else
            {
                MessageBox.Show("该员工账号已存在!");
            }
        }
Beispiel #4
0
        public void showInfo()
        {
            DataSet  ds    = new DataSet();
            DataSet  ds1   = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();

            ds  = s._Select("good");
            ds1 = s._Select("good_id", "good");
            dataGridView1.DataSource = ds.Tables[0].DefaultView;
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                comboBox1.Items.Add(ds.Tables[0].Rows[i][0].ToString().Trim());
            }
            comboBox1.DisplayMember = "shang";
            comboBox1.ValueMember   = "id";
        }
        private void button4_Click(object sender, EventArgs e)
        {
            DataSet  ds     = new DataSet();
            SFact    s      = new SFact();
            SOperate select = s.Select();

            ds = select._Select("pos_id as ID,pos_name as 职位", "position");
            dataGridView1.DataSource = ds.Tables[0].DefaultView;
        }
        public void ShowInfo()
        {
            DataSet  ds    = new DataSet();
            DataSet  ds1   = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();

            ds = s._Select("id,sta_num as 账号,sta_name as 姓名,sta_age as 年龄,sta_sex as  性别,pos_name as 职位,sta_startime as 入职时间",
                           "staff,position where staff.pos_id= position.pos_id "); //查询全部工人信息
            ds1 = s._Select("pos_id", "position");
            dataGridView2.DataSource = ds.Tables[0].DefaultView;
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                comboBox1.Items.Add(ds1.Tables[0].Rows[i][0].ToString().Trim());
            }
            comboBox1.DisplayMember = "shang";
            comboBox1.ValueMember   = "id";
        }
        private void button5_Click(object sender, EventArgs e)
        {
            DataSet  ds    = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();

            ds = s._Select("id,sta_num as 账号,sta_name as 姓名,sta_age as 年龄,sta_sex as  性别,pos_name as 职位,sta_startime as 入职时间", "staff,position where staff.pos_id= position.pos_id "); //查询全部工人信息

            dataGridView2.DataSource = ds.Tables[0].DefaultView;
        }
Beispiel #8
0
        public void ShowInfo()
        {
            DataSet ds = new DataSet();

            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();

            ds = s._Select("good");

            dataGridView1.DataSource = ds.Tables[0].DefaultView;
            comboBox1.Items.Add("All");
            comboBox1.Items.Add("商品号");
            comboBox1.Items.Add("商品类别");
            comboBox1.Items.Add("商品名");
        }
Beispiel #9
0
        public InpSp()
        {
            InitializeComponent();
            DataSet  ds    = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();

            ds = s._Select("goodType_name", "goodtype");
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                comboBox1.Items.Add(ds.Tables[0].Rows[i][0].ToString().Trim());
            }
            comboBox1.DisplayMember = "shang";
            comboBox1.ValueMember   = "id";
        }
Beispiel #10
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     if (tabControl1.SelectedTab.Name == "tabPage2")
     {
         Login_stra l = new Login_stra();
         // 返回的s是该登录用户的密码
         string s = l.Login(1, textBox3.Text);
         if (textBox4.Text == s)
         {
             DataSet  ds    = new DataSet();
             SFact    sFact = new SFact();
             SOperate s1    = sFact.Select();
             ds = s1._Select("sta_name", "staff", "sta_num", textBox3.Text);
             Form f = new MainWin(this, ds.Tables[0].Rows[0][0].ToString().Trim(), 0);
             this.Hide();
             f.Show();
         }
         else
         {
             MessageBox.Show("用户名不存在或密码错误...");
         }
     }
     else if (tabControl1.SelectedTab.Name == "tabPage1")//vip
     {
         Login_stra l = new Login_stra();
         string     s = l.Login(0, textBox1.Text);
         if (textBox2.Text == s)
         {
             DataSet  ds    = new DataSet();
             SFact    sFact = new SFact();
             SOperate s1    = sFact.Select();
             ds = s1._Select("sys_name", "system", "sys_num", textBox1.Text);
             Form f = new MainWin(this, ds.Tables[0].Rows[0][0].ToString().Trim(), 1);
             this.Hide();
             f.Show();
         }
         else
         {
             MessageBox.Show("用户名不存在或密码错误...");
         }
     }
 }
Beispiel #11
0
        private void button2_Click(object sender, EventArgs e)
        {
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();
            DataSet  ds    = new DataSet();

            if (comboBox1.Text.Equals("All"))
            {
                ds = s._Select("id,sta_num as 账号,sta_name as 姓名,sta_age as 年龄,sta_sex as  性别,pos_name as 职位,sta_startime as 入职时间", "staff,position where staff.pos_id= position.pos_id");
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("员工号"))
            {
                ds = s._Select("", "staff", "sta_id", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("职位"))
            {
                ds = s._Select("*", "staff", "pos_id", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("姓名"))
            {
                ds = s._Select("*", "staff", "sta_name", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("年龄"))
            {
                ds = s._Select("*", "staff", "sta_age", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("性别"))
            {
                ds = s._Select("*", "staff", "sta_sex", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("入职时间"))
            {
                ds = s._Select("*", "staff", "sta_startime", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
        }
Beispiel #12
0
        private void button4_Click(object sender, EventArgs e)
        {
            num = textBox1.Text;
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();
            DataSet  d     = s._Select("*", "staff", "sta_num", textBox1.Text);

            if (d.Tables[0].Rows.Count == 0 && d.Tables.Count == 1)//判断是否有数据
            {
                MessageBox.Show("该职工号不存在");
                ClearInfo();
            }
            else
            {
                id            = d.Tables[0].Rows[0][0].ToString();
                textBox2.Text = d.Tables[0].Rows[0][6].ToString();
                textBox3.Text = d.Tables[0].Rows[0][1].ToString();
                textBox4.Text = d.Tables[0].Rows[0][5].ToString();
                textBox5.Text = d.Tables[0].Rows[0][4].ToString();
                textBox6.Text = d.Tables[0].Rows[0][7].ToString();
                textBox7.Text = d.Tables[0].Rows[0][2].ToString();
            }
        }
Beispiel #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet  ds    = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();
            SOperate s1    = sFact.Update();
            SOperate s2    = sFact.Delete();
            int      num   = int.Parse(s._Select("good_sum", "good", "good_id", comboBox1.Text).Tables[0].Rows[0][0].ToString().Trim());

            if (num < int.Parse(textBox1.Text))
            {
                MessageBox.Show("数量不足!");
            }
            else if (num == int.Parse(textBox1.Text))
            {
                num = num - int.Parse(textBox1.Text);
                s2._Del("good", "good_id", comboBox1.Text);
            }
            else
            {
                num = num - int.Parse(textBox1.Text);
                s1._Update("good", "good_sum", num.ToString(), "good_id", comboBox1.Text);
            }
        }
Beispiel #14
0
        private void button2_Click(object sender, EventArgs e)
        {
            DataSet  ds    = new DataSet();
            SFact    sFact = new SFact();
            SOperate s     = sFact.Select();
            DataSet  ds1   = new DataSet();

            if (comboBox1.Text.Equals("All"))
            {
                ds = s._Select(" id as ID,vip_num as '会员号',vip_name as '会员名',vip_sex as '性别', vip_age as '年龄',vip_money as '余额',vip_phone as '联系方式',vip_pwd as '密码'", "vip");
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("会员号"))
            {
                ds = s._Select("*", "vip", "vip_num", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("姓名"))
            {
                ds = s._Select("*", "vip", "vip_name", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("年龄"))
            {
                ds = s._Select("*", "vip", "vip_age", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("性别"))
            {
                ds = s._Select("*", "vip", "vip_sex", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
            else if (comboBox1.Text.Equals("手机号"))
            {
                ds = s._Select("*", "vip", "vip_phone", textBox1.Text);
                dataGridView1.DataSource = ds.Tables[0].DefaultView;
            }
        }