public Form_NewPaymentNote(Company targetCustomer = null)
        {
            InitializeComponent();

            AddNewTableRow(1, tblPanelService);
            AddNewTableRow(1, tblPanelAdvance);

            tblPanelService.AutoScroll = tblPanelAdvance.AutoScroll = true;
            tblPanelService.Padding = tblPanelAdvance.Padding = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);

            BindingList<Company> comBindingList = Form_Main.Instance.AddressBook.Companies;
            lblCompanyName.DataBindings.Add("Text", comBindingList, "CompanyName");
            lblContact.DataBindings.Add("Text", comBindingList, "Contact");
            lblCellphone.DataBindings.Add("Text", comBindingList, "Cellphone");
            lblTel.DataBindings.Add("Text", comBindingList, "Tel");
            lblFax.DataBindings.Add("Text", comBindingList, "Fax");

            cmb_Category.DataSource = PaymentNote.CategoryList;

            hapDataView1.DataSource = Form_Main.Instance.AddressBook.Companies;

            if (targetCustomer != null)
                hapDataView1.SelectedItem = targetCustomer;
        }
Exemple #2
0
 public static void Copy(Company source, Company destination)
 {
     destination.Id = source.Id;
     destination.PhoneFormatId = source.PhoneFormatId;
     destination.CompanyName = source.CompanyName;
     destination.President = source.President;
     destination.Contact = source.Contact;
     destination.Tel = source.Tel;
     destination.Fax = source.Fax;
     destination.Cellphone = source.Cellphone;
     destination.Address1 = source.Address1;
     destination.Address2 = source.Address2;
     destination.SerialNumber = source.SerialNumber;
     destination.State = source.State;
 }
Exemple #3
0
        void LoadAddressBook(IBindingList target)
        {
            target.Clear();

            using (System.Data.SQLite.SQLiteDataReader reader = DataBase.Instance.ExecuteReader("SELECT * FROM AddressBook"))
            {
                while (reader.Read())
                {
                    reader.GetValue(0);
                    Company com = new Company(
                        reader.GetInt32(0),
                        reader.IsDBNull(1) ? string.Empty : reader.GetString(1),
                        reader.IsDBNull(2) ? string.Empty : reader.GetString(2),
                        reader.IsDBNull(3) ? string.Empty : reader.GetString(3),
                        reader.IsDBNull(4) ? string.Empty : reader.GetString(4),
                        reader.IsDBNull(5) ? string.Empty : reader.GetString(5),
                        reader.IsDBNull(6) ? string.Empty : reader.GetString(6),
                        reader.IsDBNull(7) ? string.Empty : reader.GetString(7),
                        reader.IsDBNull(8) ? string.Empty : reader.GetString(8),
                        reader.IsDBNull(9) ? string.Empty : reader.GetString(9),
                        reader.IsDBNull(10) ? string.Empty : reader.GetString(10),
                        reader.GetInt32(11));
                    target.Add(com);
                }
            }
        }
Exemple #4
0
 private void btnModify_Click(object sender, EventArgs e)
 {
     currentState = AddressBookState.Modify;
     modifyCompanyTemp = (Company)CurrentCompany.Clone();
     UpdateControls();
 }
Exemple #5
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     currentState = AddressBookState.Add;
     Company newCompany = new Company();
     companies.Add(newCompany);
     companies.ResetItem(companies.IndexOf(newCompany));
     customControl1.SelectedItem = newCompany;
     UpdateControls();
 }