Example #1
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());
        }
Example #2
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 if (textBox7.Text.Length == 0)
            {
                MessageBox.Show("请输入家电的维修原因!");
            }
            else
            {
                string sql_isOrNo = "SELECT isOrNo FROM Goods WHERE orderNumber = '" + textBox2.Text + "'";
                string ion        = (string)MM_DM.FindData(sql_isOrNo);
                if (ion == "否" && textBox4.Text == "是")
                {
                    MessageBox.Show("该订单并未签收,维修情况不可为已维修!");
                    textBox4.Text = null;
                }
                else
                {
                    string sql = "UPDATE Maintain 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 + "' , maintainMan = '" + textBox6.Text + "' , errorInfor = '" + textBox7.Text + "' WHERE orderNumber = " + "'" + textBox2.Text + "'";
                    int    num = MM_AOA.GetProductsNumber();                         //向操作记录库中添加信息
                    MM_DM.GetData_Operation(num, MainSystem.thisAdmin, "管理员:" + MainSystem.thisAdmin + "更改了订单号为 " + textBox2.Text + "的维修信息", DateTime.Now.ToString());

                    int num_01 = MM_AOA.GetAllMaintainNumber();                      //向所有维修信息库中添加信息
                    MM_DM.GetData_AllMaintain(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, textBox7.Text, DateTime.Now.ToString());

                    MM_DM.Run(sql);
                    MessageBox.Show("更改成功!");
                    dataGridView4.DataSource = null;
                    textBox3.Text            = null;
                    textBox4.Text            = null;
                }
            }
            string sql_01 = "SELECT * FROM Maintain";

            UpdateDataView_MM(sql_01);
        }