DeleteComfortZoneData() public method

public DeleteComfortZoneData ( string id ) : void
id string
return void
コード例 #1
0
        private void btn_delete_Cl(object sender, EventArgs e)
        {
            //This one is for deletion operation
            int index = comboBox2.SelectedIndex;

            if (index >= 0)
            {
                //WE need to call the index value as well as send the id parameter
                //This will delete the value form both the comfortDetail and chartcomfortzonesetting table.
                DialogResult dialogResult = MessageBox.Show("are you sure you want to delete :" + bs.listComfortZoneDetail[index].name, "Delete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    bs.DeleteComfortZoneData(bs.listComfortZoneDetail[index].id);
                    MessageBox.Show("value deleted successfully");
                    //Refresh the values
                    refreshAfterEdit();
                }
            }
        }