Exemple #1
0
 private void butInsertSQL_Click(object sender, EventArgs e)
 {
     if (!flag)
     {
         MessageBox.Show("待插入的数据为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         bool temp = false;
         for (int i = 0; i <= index; i++)
         {
             SqlParameter[] paraValues =
             {
                 new SqlParameter("@StaffNum",  SqlDbType.Char),
                 new SqlParameter("@StaffName", SqlDbType.Char),
                 new SqlParameter("@StaffSex",  SqlDbType.Char),
                 new SqlParameter("@StaffTime", SqlDbType.DateTime),
                 new SqlParameter("@StaffDuty", SqlDbType.Char)
             };
             for (int j = 0; j < 5; j++)
             {
                 paraValues[j].Value = setStaffMessage.Rows[i].Cells[j].Value.ToString();
             }
             temp = Manipulation.Manipulation.insertStoredProcedure("Insert_Staff", paraValues);
         }
         if (temp)
         {
             MessageBox.Show("所有数据插入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         InformationManage.clear(setStaffMessage);
     }
 }
Exemple #2
0
 private void butCancel_Click(object sender, EventArgs e)
 {
     if (index <= 0)
     {
         flag = false;
         InformationManage.clear(setStaffMessage);
     }
     else
     {
         InformationManage.remove(setStaffMessage, index);
         index--;
     }
 }
Exemple #3
0
 private void butAdd_Click(object sender, EventArgs e)
 {
     string[] values = { cusNum.Text, cusName.Text, cusTell.Text };
     if (InformationManage.isEmpty(values))
     {
         index = setCusMessage.Rows.Add();
         flag  = true;
         InformationManage.insert(values, setCusMessage, index);
     }
     else
     {
         MessageBox.Show("请将信息填写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #4
0
 /**
  * 加入按钮点击事件
  */
 private void butAdd_Click(object sender, System.EventArgs e)
 {
     string[] values = { drugNum.Text, customerNum.Text, drugPrice.Text, supplyNum.Text, orderTime.Value.ToString() };
     if (InformationManage.isEmpty(values))
     {
         index = setDrugMessage.Rows.Add();
         flag  = true;
         InformationManage.insert(values, setDrugMessage, index);
     }
     else
     {
         MessageBox.Show("请将信息填写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #5
0
 private void butAdd_Click(object sender, EventArgs e)
 {
     string[] values = { drugNum.Text,     drugName.Text,      birthday.Value.ToString(), validity.Value.ToString(), drugFunction.Text,
                         supplierNum.Text, supplierPrice.Text, supplyNum.Text,            supplyTime.Value.ToString() };
     if (InformationManage.isEmpty(values))
     {
         index = setPurchaseMessage.Rows.Add();
         flag  = true;
         InformationManage.insert(values, setPurchaseMessage, index);
     }
     else
     {
         MessageBox.Show("请将信息填写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #6
0
 private void butInsertSQL_Click(object sender, EventArgs e)
 {
     if (!flag)
     {
         MessageBox.Show("待插入的数据为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         bool temp = false;
         for (int i = 0; i <= index; i++)
         {
             SqlParameter[] paraValues =
             {
                 new SqlParameter("@DrugNum",       SqlDbType.Char),
                 new SqlParameter("@DrugName",      SqlDbType.Char),
                 new SqlParameter("@Birthday",      SqlDbType.Char),
                 new SqlParameter("@Validity",      SqlDbType.Char),
                 new SqlParameter("@DrugFunction",  SqlDbType.Char),
                 new SqlParameter("@SupplierNum",   SqlDbType.Char),
                 new SqlParameter("@SupplierPrice", SqlDbType.Char),
                 new SqlParameter("@SupplyNum",     SqlDbType.Char),
                 new SqlParameter("@SupplyTime",    SqlDbType.Char)
             };
             for (int j = 0; j < 9; j++)
             {
                 paraValues[j].Value = setPurchaseMessage.Rows[i].Cells[j].Value.ToString();
             }
             temp = Manipulation.Manipulation.insertStoredProcedure("Insert_SupplierShip", paraValues);
             if (temp)
             {
                 SqlParameter[] MinusParaValues =
                 {
                     new SqlParameter("@DrugNum",   SqlDbType.Char),
                     new SqlParameter("@SupplyNum", SqlDbType.Int)
                 };
                 MinusParaValues[0].Value = setPurchaseMessage.Rows[i].Cells[0].Value.ToString();
                 MinusParaValues[1].Value = setPurchaseMessage.Rows[i].Cells[7].Value.ToString();
                 Manipulation.Manipulation.insertStoredProcedure("Add_Drug", MinusParaValues);
                 temp = false;
             }
         }
         if (temp)
         {
             MessageBox.Show("所有数据插入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         InformationManage.clear(setPurchaseMessage);
     }
 }
Exemple #7
0
 /**
  * 插入数据库按钮点击事件
  */
 private void butInsertSQL_Click(object sender, System.EventArgs e)
 {
     if (!flag)
     {
         MessageBox.Show("待插入的数据为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         bool temp = false;
         for (int i = 0; i <= index; i++)
         {
             SqlParameter[] insertParaValues =
             {
                 new SqlParameter("@DrugNum",     SqlDbType.Char),
                 new SqlParameter("@CustomerNum", SqlDbType.Char),
                 new SqlParameter("@DemandPrice", SqlDbType.Real),
                 new SqlParameter("@DemandNum",   SqlDbType.Int),
                 new SqlParameter("@DamandTime",  SqlDbType.DateTime),
             };
             for (int j = 0; j < 5; j++)
             {
                 insertParaValues[j].Value = setDrugMessage.Rows[i].Cells[j].Value.ToString();
             }
             temp = Manipulation.Manipulation.insertStoredProcedure("Insert_DemandShip", insertParaValues);
             if (temp)
             {
                 SqlParameter[] MinusParaValues =
                 {
                     new SqlParameter("@DrugNum",   SqlDbType.Char),
                     new SqlParameter("@DemandNum", SqlDbType.Int)
                 };
                 MinusParaValues[0].Value = setDrugMessage.Rows[i].Cells[0].Value.ToString();
                 MinusParaValues[1].Value = setDrugMessage.Rows[i].Cells[3].Value.ToString();
                 Manipulation.Manipulation.insertStoredProcedure("Minus_Drug", MinusParaValues);
                 temp = false;
             }
         }
         if (temp)
         {
             MessageBox.Show("所有数据插入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         InformationManage.clear(setDrugMessage);
     }
 }
Exemple #8
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            string sex = "";

            if (radioMan.Checked)
            {
                sex = "男";
            }
            if (radioWom.Checked)
            {
                sex = "女";
            }
            string[] values = { staffNum.Text, staffName.Text, sex, staffTime.Value.ToString(), staffDuty.Text };
            if (InformationManage.isEmpty(values))
            {
                flag  = true;
                index = setStaffMessage.Rows.Add();
                InformationManage.insert(values, setStaffMessage, index);
            }
            else
            {
                MessageBox.Show("请将信息填写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }