示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            DatabaseResolver.Disconnect();
            Form3 f3 = new Form3();

            f3.ShowDialog();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DatabaseResolver.Disconnect();
            Form1 f1 = new Form1();

            f1.ShowDialog();
        }
示例#3
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            listBox5.DataSource = null;
            listBox5.Items.Clear();
            string curItem = listBox1.SelectedItem.ToString();

            lbindex1 = listBox1.FindString(curItem);
            if (lbindex1 == 0)
            {
                stringList.Add("Alla");
                foreach (string s in DatabaseResolver.GetAllManufacturers())
                {
                    stringList.Add(s);
                }
                listBox5.DataSource = stringList;
                stringList.Clear();
            }
            else
            {
                stringList.Add("Alla");
                foreach (string s in DatabaseResolver.GetManufacturers(listBox1.SelectedItem.ToString()))
                {
                    stringList.Add(s);
                }
                listBox5.DataSource = stringList;
                stringList.Clear();
            }
        }
示例#4
0
 private void button2_Click(object sender, EventArgs e)
 {
     kkx          = Convert.ToInt32(textBox4.Text);
     personnummer = Convert.ToInt64(textBox5.Text);
     if (DatabaseResolver.CreateSalj(svid, kkx, personnummer))
     {
         DatabaseResolver.DecreaseAmount(svid, kkx);
     }
 }
示例#5
0
 public Form1()
 {
     DatabaseResolver.Connect();
     InitializeComponent();
     listBox1.DataSource = null;
     listBox1.Items.Clear();
     listBox1.DataSource = DatabaseResolver.typeList;
     listBox4.DataSource = null;
     listBox4.Items.Clear();
     listBox4.DataSource = DatabaseResolver.columnList;
 }
示例#6
0
 private void button1_Click(object sender, EventArgs e) //Utför köp
 {
     ikx        = Convert.ToInt32(textBox1.Text);
     leverantor = textBox2.Text;
     ikpris     = Convert.ToInt32(textBox3.Text);
     if (DatabaseResolver.CreateInkop(svid, ikx, leverantor, ikpris))
     {
         DatabaseResolver.IncreaseAmount(svid, ikx);
     }
     //lägg in ett värde i inkop med ett unikt ID, varuID, leverantörid, inköpspris, och antal.
     //"INSER INTO Inkop VALUES(ikid,svid,leverantor,ikpris,ikx)"
 }
示例#7
0
 public Form3()
 {
     DatabaseResolver.Connect();
     InitializeComponent();
     listBox1.DataSource = null;
     listBox1.Items.Clear();
     foreach (string s in DatabaseResolver.GetAllTypes())
     {
         stringList.Add(s);
     }
     listBox1.DataSource = stringList;
     stringList.Clear();
     listBox3.DataSource = null;
     listBox3.Items.Clear();
     listBox3.DataSource = DatabaseResolver.columnList;
 }
示例#8
0
 private void listBox5_SelectedIndexChanged(object sender, EventArgs e)
 {
     listBox2.DataSource = null;
     listBox2.Items.Clear();
     try
     {
         stringList.Clear();
         foreach (string s in DatabaseResolver.GetItems(listBox1.SelectedItem.ToString(), listBox5.SelectedItem.ToString()))
         {
             stringList.Add(s);
         }
         listBox2.DataSource = stringList;
         stringList.Clear();
     }
     catch (NullReferenceException)
     {
     }
 }
示例#9
0
 private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     listBox2.DataSource = null;
     listBox2.Items.Clear();
     try
     {
         stringList.Clear();
         foreach (string s in DatabaseResolver.GetInformation(listBox1.SelectedItem.ToString()))
         {
             stringList.Add(s);
         }
         string tempString = DatabaseResolver.GetItemID(listBox1.SelectedItem.ToString());
         svid = Convert.ToInt32(tempString);
     }
     catch (NullReferenceException)
     {
     }
     listBox2.DataSource = stringList;
     stringList.Clear();
 }
示例#10
0
 private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
 {
     listBox3.DataSource = null;
     listBox3.Items.Clear();
     try
     {
         stringList.Clear();
         foreach (string s in DatabaseResolver.GetInformation(listBox2.SelectedItem.ToString()))
         {
             stringList.Add(s);
         }
     }
     catch (NullReferenceException)
     {
     }
     listBox3.DataSource = stringList;
     compareList.Clear();
     foreach (string s in stringList)
     {
         compareList.Add(s);
     }
     stringList.Clear();
 }