Exemplo n.º 1
0
        private void submitUpdateOwner_btn_Click(object sender, EventArgs e)
        {
            ownerResultBindingSource.Position = 0;
            OwnerResult OwnerToUpdate = (OwnerResult)ownerResultBindingSource.Current;

            OwnerToUpdate.Update(Form1.MasterConnection);
            updateSuccess_label.Text = "Owner Updated Successfully!";
            updateSuccess_label.Show();
        }
Exemplo n.º 2
0
        private void ownerSelection_box_SelectedIndexChanged(object sender, EventArgs e)
        {
            ownerResultBindingSource.Clear();
            OwnerResult SelectedOwner = new OwnerResult();

            SelectedOwner.IDName = ownerSelection_box.SelectedItem.ToString();
            MySqlCommand QueryOwner = new MySqlCommand("select * from `gaminginv`.`owner` where `Name` = @NameParam" + ';', Form1.MasterConnection);

            QueryOwner.Parameters.AddWithValue("@NameParam", SelectedOwner.IDName);
            MySqlDataReader OwnerReader = QueryOwner.ExecuteReader();

            if (OwnerReader.Read())
            {
                SelectedOwner.BadgeName    = OwnerReader.GetString("BadgeName");
                SelectedOwner.EmailAddress = OwnerReader.GetString("Email");
                SelectedOwner.ItemQty      = OwnerReader.GetInt32("ItemCount");
                SelectedOwner.OwnerID      = OwnerReader.GetInt32("ID");
                SelectedOwner.PhoneNumber  = OwnerReader.GetString("Phone");
                ownerResultBindingSource.Add(SelectedOwner);
            }
            OwnerReader.Close();
        }