示例#1
0
        private void SupplierDetails_Load(object sender, EventArgs e)
        {
            //We don't need a time for the last purchase value.
            lastPurchaseDateTimePicker.Format       = DateTimePickerFormat.Custom;
            lastPurchaseDateTimePicker.CustomFormat = "dd 'of' MMMM yyyy";

            string filterExp = "ID = '" + suppID + "'";

            supplierTableBindingSource.Filter = filterExp;

            sciencedbDataSet.SupplierTableDataTable set = this.sciencedbDataSet.SupplierTable;
            this.supplierTableTableAdapter.Fill(set);

            //Do the combo dance
            sciencedbDataSet.SupplierTableDataTable table = supplierTableTableAdapter.GetData();
            if (intsuppid > 1)
            {
                suppcombo.DataSource    = table;
                suppcombo.DisplayMember = "SupplierName";
                suppcombo.ValueMember   = "ID";
            }
        }
示例#2
0
        void loadSuppliers()
        {
            if (supplierNames.Items.Count < 1)
            {
                sciencedbDataSet.SupplierTableDataTable table = supplierTableTableAdapter1.GetData();

                litems = new Dictionary <int, string>();

                supplierNames.Items.Clear();
                litems.Add(supplierNames.Items.Count, "");
                supplierNames.Items.Add(""); //Add New here for default
                supplierNames.SelectedItem = "";

                /*              foreach (DataRow row in table.Rows)
                 *            {
                 *                string supplierName = row["SupplierName"].ToString();
                 *                string supplierID = row["ID"].ToString();
                 *                litems.Add(supplierNames.Items.Count, supplierName);
                 *
                 *                supplierNames.Items.Add(supplierName);
                 *                supplierNames.SelectedItem = supplierName;
                 *            }
                 */}
        }