protected void ddlPerformance_SelectedIndexChanged(object sender, EventArgs e)
 {
     txtComps.Text = "";
     txtDropcount.Text = "";
     txtPaidAttendance.Text = "";
     txtgrossales.Text = "";
     DataTable ds = new DataTable();
     ofcobj = new BoxOfficeData();
     ds = ofcobj.Loadboxofficedata(Convert.ToInt32(hdn_engagementid.Value), Convert.ToInt32(ddlPerformance.SelectedItem.Value.ToString()));
     if (ds.Rows.Count > 0)
     {
         filldatacalculations(ds, "n");
     }
     else
     {
         LoadPerformanceCopy(Convert.ToInt32(hdn_engagementid.Value));
     }
 }
        public void ddlPerformancesload(int engmntid)
        {
            string ddlval = ddlPerformance.SelectedItem.Value;
            dtperformancelist = new DataTable();
            ofcobj = new BoxOfficeData();
            //dtperformancelist = ofcobj.GetPerformancelist(engmntid);
            dtperformancelist = ofcobj.LoadPerformancelist(engmntid);
            ViewState["dtperformance"] = dtperformancelist;
            ddlPerformance.DataSource = dtperformancelist;
            ddlPerformance.DataTextField = "schedule_type";
            ddlPerformance.DataValueField = "schedule_id";
            ddlPerformance.DataBind();
            chklstPerformance.DataSource = dtperformancelist;
            chklstPerformance.DataTextField = "schedule_type";
            chklstPerformance.DataValueField = "schedule_id";
            chklstPerformance.DataBind();
            ListItem lst = new ListItem();
            lst.Text = "All";
            lst.Value = "0";
            chklstPerformance.Items.Insert(0, lst);

            DataTable ds = new DataTable();
            ofcobj = new BoxOfficeData();
            ddlPerformance.SelectedIndex = ddlPerformance.Items.IndexOf(ddlPerformance.Items.FindByValue(ddlval));
            if (ddlPerformance.SelectedIndex == -1)
                ddlPerformance.SelectedIndex = 0;
            //ds = ofcobj.Loadboxofficedata(Convert.ToInt32(hdn_engagementid.Value), Convert.ToInt32(ddlPerformance.SelectedItem.Value.ToString()));
            ds = ofcobj.Loadboxofficedata(Convert.ToInt32(hdn_engagementid.Value), Convert.ToInt32(ddlPerformance.SelectedItem.Value.ToString()));
            if (ds.Rows.Count > 0)
            {
                if (Convert.ToInt32(Convert.ToString(ds.Rows[0]["BOCount"])) > 0)
                {
                    pnlcolumn.Visible = false;
                    ddlPerformance.Visible = true;
                    txtPerformance.Visible = false;

                }
                else
                {
                    tdcopyfrom.Visible = false;
                    pnlcolumn.Visible = true;
                    ddlPerformance.Visible = false;
                    txtPerformance.Visible = true;
                    lblcopyfrom.Visible = false;
                    pnlperf.Visible = false;
                }

                filldatacalculations(ds, "n");
                rewriteOverrideValues((Convert.ToInt32(Convert.ToString(ds.Rows[0]["BO_ID"]))));
            }
            else
            {
                tdcopyfrom.Visible = false;
                pnlcolumn.Visible = true;
                ddlPerformance.Visible = false;
                txtPerformance.Visible = true;
                lblcopyfrom.Visible = false;
                pnlperf.Visible = false;
                LoadPerformanceCopy(Convert.ToInt32(hdn_engagementid.Value));

            }
        }