public static void Init() { DBCom = new DBCommunication(); //DBCom.GetGlobalVariables(); /*SqlConnection connection = new SqlConnection(ConnectionString); * connection.Open(); * SqlCommand cmd = new SqlCommand(); * cmd.Connection = connection; * cmd.CommandText = String.Format("select * from Globals"); * try * { * SqlDataReader reader = cmd.ExecuteReader(); * reader.Read(); * VoucherNumber = (int)reader["VoucherNumber"]; * InvoiceNumber = (int)reader["InvoiceNumber"]; * PaymentTerm = (int)reader["PaymentTerm"]; * PenaltyInterest = (double)reader["PenaltyInterest"]; * Address = (string)reader["Address"]; * Name = (string)reader["Name"]; * PhoneNumber = (string)reader["PhoneNumber"]; * Email = (string)reader["Email"]; * OrgNumber = (string)reader["OrgNumber"]; * FSkatt = (bool)reader["FSkatt"]; * Bankgiro = (string)reader["Bankgiro"]; * reader.Close(); * } * catch * { * * } * connection.Close();*/ }
private void ImportAccounts() { DBCommunication DBCom = new DBCommunication(); /*foreach(Account a in DBCom.ImportAccounts()) * { * ListViewItem item = new ListViewItem(a.Number.ToString()); * item.SubItems.Add(a.Name); * item.SubItems.Add(a.Balance.ToString()); * listView1.Items.Add(item); * }*/ }
public InvoiceForm() { InitializeComponent(); ImportInvoiceSettings(); SetupLabels(); descriptionTextBoxes = new List <TextBox>(); descriptionTextBoxes.Add(descriptionTextBox1); dateBoxes = new List <DateTimePicker>(); dateTimePicker1.Value = DateTime.Now; dateBoxes.Add(dateTimePicker1); amountTextBoxes = new List <TextBox>(); amountTextBoxes.Add(amountTextBox1); DBCom = new DBCommunication(); newInvoice = true; }
public VoucherForm() { InitializeComponent(); accounts = new List <Account>(); DBCommunication DBCom = new DBCommunication(); //accounts = DBCom.ImportAccounts(); accountBox1.Items.AddRange(accounts.ToArray()); accountBox2.Items.AddRange(accounts.ToArray()); accountBoxes = new List <ComboBox>(); debetBoxes = new List <TextBox>(); kreditBoxes = new List <TextBox>(); PopulateLists(); verNumLabel.Text = 1.ToString(); }