private void bindParameters()
        {
            try
            {
                BsonArray machineNames = new BsonArray();
                foreach (ListItem item in multiselectddlMachineID.Items)
                {
                    if (item.Selected)
                    {
                        if (machineNames == "")
                        {
                            machineNames.Add(item.Value);
                        }
                        else
                        {
                            machineNames.Add(item.Value);
                        }
                    }
                }
                //List<string> selectedParameterList = new List<string>();
                //foreach (ListItem item in cbParameterList.Items)
                //{
                //    if (item.Selected)
                //    {
                //        selectedParameterList.Add(item.Text);
                //    }
                //}
                List <string> selectedParameterList = new List <string>();
                if (Session["PPParameters"] == null)
                {
                }
                else
                {
                    selectedParameterList = (List <string>)Session["PPParameters"];
                }


                foreach (ListItem item in cbParameterList.Items)
                {
                    if (item.Selected)
                    {
                        if (selectedParameterList.Contains(item.Text))
                        {
                        }
                        else
                        {
                            selectedParameterList.Add(item.Text);
                        }
                    }
                    else
                    {
                        if (selectedParameterList.Contains(item.Text))
                        {
                            selectedParameterList.Remove(item.Text);
                        }
                    }
                }
                Session["PPParameters"] = selectedParameterList;

                List <ListItem> parameterList = new List <ListItem>();
                if (cbCommonParametersOnly.Checked)
                {
                    parameterList = MongoDBAccess.getCoomomParameterListForMachines(machineNames, ddlCompany.SelectedValue == null ? "" : ddlCompany.SelectedValue.ToString(), ddlPlant.SelectedValue == null ? "" : ddlPlant.SelectedValue.ToString());
                }
                else
                {
                    parameterList = MongoDBAccess.getParameterListForMachines(machineNames, ddlCompany.SelectedValue == null ? "" : ddlCompany.SelectedValue.ToString(), ddlPlant.SelectedValue == null ? "" : ddlPlant.SelectedValue.ToString());
                }

                cbParameterList.DataSource = parameterList;
                cbParameterList.DataBind();
                //if (parameterList.Count > 0)
                //{
                //    cbParameterList.Items[0].Selected = true;
                //}
                bool selected = false;
                for (int i = 0; i < selectedParameterList.Count; i++)
                {
                    foreach (ListItem item in cbParameterList.Items)
                    {
                        if (item.Text == selectedParameterList[i])
                        {
                            item.Selected = true;
                            selected      = true;
                        }
                    }
                }
                if (!selected)
                {
                    if (parameterList.Count > 0)
                    {
                        cbParameterList.Items[0].Selected = true;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }