Ejemplo n.º 1
0
        private void UpdateSupplierDataTable()
        {
            try {
                string connectionString = ConfigurationManager.ConnectionStrings["db-connection"].ConnectionString;

                using (MySqlConnection connection = new MySqlConnection(connectionString)) {
                    connection.Open();

                    using (MySqlCommand command = new MySqlCommand("SELECT * FROM supplier")) {
                        using (MySqlDataAdapter supplierDataAdapter = new MySqlDataAdapter()) {
                            command.Connection = connection;
                            supplierDataAdapter.SelectCommand = command;

                            using (DataTable table = new DataTable()) {
                                supplierDataAdapter.Fill(table);
                                SupplierDataTable.DataSource = table;
                                SupplierDataTable.DataBind();
                                SupplierDataTable.HeaderRow.Cells[0].Text = "Supplier ID";
                                SupplierDataTable.HeaderRow.Cells[1].Text = "Company";
                                SupplierDataTable.HeaderRow.Cells[2].Text = "Contact Email";
                                SupplierDataTable.HeaderRow.Cells[3].Text = "Contact Phone";
                                SupplierDataTable.HeaderRow.Cells[4].Text = "Billing Address";
                                SupplierDataTable.HeaderRow.Cells[5].Text = "Shipping Address";
                            }
                        }
                    }

                    connection.Close();
                }
            } catch (MySqlException err) {
                Response.Write("<script>alert('Connection was interrupted.');</script>");
            }
        }
Ejemplo n.º 2
0
        public virtual SupplierDataTable GetData()
        {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            SupplierDataTable supplierDataTable = new SupplierDataTable();

            this.Adapter.Fill(supplierDataTable);
            return(supplierDataTable);
        }
Ejemplo n.º 3
0
        public virtual int Fill(SupplierDataTable dataTable)
        {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if (this.ClearBeforeFill)
            {
                dataTable.Clear();
            }
            int num = this.Adapter.Fill(dataTable);

            return(num);
        }
Ejemplo n.º 4
0
 private void SupplierForm_Load(object sender, EventArgs e)
 {
     this.sTable = this._supplier.getSuppliers();
     this.sTable.AddressColumn.ColumnName    = "العنوان";
     this.sTable.AccCodeColumn.ColumnName    = "رقم الحساب";
     this.sTable.NameColumn.ColumnName       = "اسم المورد";
     this.sTable.PersonNameColumn.ColumnName = "اسم المسؤول";
     this.sTable.PhoneColumn.ColumnName      = "رقم الهاتف";
     this.sTable.SupplierIDColumn.ColumnName = "رقم المورد";
     this.dgvSuppliers.DataSource            = this.sTable;
     this.mode        = Mode.Null;
     base.WindowState = FormWindowState.Maximized;
     this.resetUI((Form1)base.MdiParent.UserName);
 }
Ejemplo n.º 5
0
 public virtual int Update(SupplierDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }
Ejemplo n.º 6
0
 internal void InitVars()
 {
     this.tableSupplier = (SupplierDataTable) base.Tables["Supplier"];
     if (this.tableSupplier != null)
     {
         this.tableSupplier.InitVars();
     }
 }
Ejemplo n.º 7
0
 private void InitClass()
 {
     base.DataSetName = "dsSupplier";
     base.Prefix = "";
     base.Namespace = "http://www.tempuri.org/dsSupplier.xsd";
     base.Locale = new CultureInfo("en-US");
     base.CaseSensitive = false;
     base.EnforceConstraints = true;
     this.tableSupplier = new SupplierDataTable();
     base.Tables.Add(this.tableSupplier);
 }