private void button2_Click(object sender, EventArgs e) { DatabaseResolver.Disconnect(); Form3 f3 = new Form3(); f3.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { DatabaseResolver.Disconnect(); Form1 f1 = new Form1(); f1.ShowDialog(); }
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(); } }
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); } }
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; }
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)" }
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; }
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) { } }
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(); }
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(); }