Exemple #1
0
        //↓添加更改或删除界面_更改按钮
        private void button7_Click(object sender, EventArgs e)
        {
            if (textBox2.Text.Length == 0)
            {
                MessageBox.Show("订单号不可为空!");
            }
            else if (textBox3.Text.Length == 0)
            {
                MessageBox.Show("送货日期不可为空!");
            }
            else if (textBox4.Text.Length == 0)
            {
                MessageBox.Show("请确认收货情况!");
            }
            else if (textBox6.Text.Length == 0)
            {
                MessageBox.Show("送货员不可为空!");
            }
            else
            {
                string sql = "UPDATE Goods SET name = " + "'" + dataGridView4.Rows[0].Cells[1].Value.ToString() + "', sex = '" + dataGridView4.Rows[0].Cells[2].Value.ToString() + "', telephone =" + "'" + dataGridView4.Rows[0].Cells[3].Value.ToString() + "', position = '" + dataGridView4.Rows[0].Cells[4].Value.ToString() + "' , whichgoods = '" + dataGridView4.Rows[0].Cells[5].Value.ToString() + "' , date = '" + textBox3.Text + "' , isOrNo = '" + textBox4.Text + "' ,courier = '" + textBox6.Text + "' WHERE orderNumber = " + "'" + textBox2.Text + "'";
                int    num = GM_AOA.GetProductsNumber();
                GM_DM.GetData_Operation(num, MainSystem.thisAdmin, "管理员:" + MainSystem.thisAdmin + "更改了订单号为 " + textBox2.Text + "的送货信息", DateTime.Now.ToString());

                int num_01 = GM_AOA.GetAllGoodsNumber();
                GM_DM.GetData_AllGoods(num_01, dataGridView4.Rows[0].Cells[1].Value.ToString(), dataGridView4.Rows[0].Cells[2].Value.ToString(), dataGridView4.Rows[0].Cells[3].Value.ToString(), dataGridView4.Rows[0].Cells[4].Value.ToString(), dataGridView4.Rows[0].Cells[5].Value.ToString(), textBox3.Text, textBox4.Text, textBox2.Text, textBox6.Text, DateTime.Now.ToString());

                GM_DM.Run(sql);
                MessageBox.Show("更改成功!");
                dataGridView4.DataSource = null;
            }
            string sql_01 = "SELECT * FROM Goods";

            UpdateDataView_GM(sql_01);
        }
Exemple #2
0
        //↓添加顾客信息成功后,自动添加送货、维修、安装等基本信息,同时向所有信息库中添加相应信息
        //  基本信息包括:1.id 2.名字 3.性别 4.电话 5.住址 6.购买商品名 7.订单号
        public void AddAll()
        {
            int i_1 = CM_IM.GetProductsNumber();
            int i_2 = CM_MM.GetProductsNumber();
            int i_3 = CM_GM.GetProductsNumber();

            CM_DM.GetData_Install(i_1, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text);
            CM_DM.GetData_Maintain(i_2, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text);
            CM_DM.GetData_Goods(i_3, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text);

            int num_1 = CM_AOA.GetAllInstallNumber();
            int num_2 = CM_AOA.GetAllMaintainNumber();
            int num_3 = CM_AOA.GetAllGoodsNumber();

            CM_DM.GetData_AllInstall(num_1, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text, DateTime.Now.ToString());
            CM_DM.GetData_AllMaintain(num_2, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text, DateTime.Now.ToString());
            CM_DM.GetData_AllGoods(num_3, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, null, "否", textBox7.Text, DateTime.Now.ToString());
        }