示例#1
0
        // int row;

        private void TrashForm_Load(object sender, EventArgs e)
        {
            connection = new MySqlConnection(ConnectionString);

            using (MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT iid AS ID, date(item_date) AS Date, cid AS Category, item_name AS Item, item_description AS Description, item_serial AS Serial, bid AS Brand, quantity AS Quantity, unit AS Unit, status AS Status from Trash", connection))
            {
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                item.inventory_grid.Rows.Clear();

                trash_grid.DataSource = ds.Tables[0];
                trash_grid.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
            item.LoadAllInventory();
        }
示例#2
0
        private void TrashForm_Load(object sender, EventArgs e)
        {
            connection = new MySqlConnection(ConnectionString);

            using (MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT iid AS ID, date(item_date) AS Date, cid AS Category, item_name AS Item, item_description AS Description, item_serial AS Serial, bid AS Brand, quantity AS Quantity, unit AS Unit, status AS Status from Trash", connection))
            //using (MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT inventory_info.iid As ID, inventory_info.item_date As Date, category_info.cat_name As Category, inventory_info.item_name As Item,  inventory_info.item_description As Description, inventory_info.item_serial As Serial, brand_info.brand_name As Brand, inventory_info.quantity As Quantity, inventory_info.unit As Unit, inventory_info.`status`As Status FROM category_info Inner Join inventory_info ON category_info.cid = inventory_info.cid Inner Join brand_info ON brand_info.bid = inventory_info.bid where order by iid desc", connection))
            {
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                item.inventory_grid.Rows.Clear();

                trash_grid.DataSource = ds.Tables[0];
                trash_grid.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
            item.LoadAllInventory();
        }
示例#3
0
 private void Active()
 {
     connection = new MySqlConnection(ConnectionString);
     try
     {
         connection.Open();
         MySqlCommand cmd = new MySqlCommand("Update inventory_info set status = 'Active' where iid = '" + mtxt_iid.Text + "'", connection);
         cmd.ExecuteNonQuery();
         connection.Close();
         iff.LoadAllInventory();
     }
     catch (Exception ex)
     {
         MetroMessageBox.Show(this, ex.Message);
     }
 }