Ejemplo n.º 1
0
        private void MakeOrderButton_Click(object sender, EventArgs e)
        {
            try {
                var      result = Microsoft.VisualBasic.Interaction.InputBox("F&&V", "Enter the quantity", "1", -1, -1);
                string[] values = new string[8];
                //
                values[4] = DateTime.Today.ToShortDateString();
                values[1] = servConn.GetCurrentUser();
                values[0] = servConn.FindIdByName(goodsName).ToString();
                values[6] = result;
                Random rand = new Random();
                values[2] = "1";
                values[3] = rand.Next(10, 100).ToString();
                values[5] = "1";
                values[7] = "";


                List <string> attributes = new List <string>();
                attributes = servConn.GetAttributesTable("FV_Order").ToList();
                attributes.RemoveAt(0);

                servConn.InsertInto("FV_Order", values, attributes.ToArray());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }