public void FillVehicleDashboard()
    {
        try
        {
            pnl_Display.Controls.Clear();
            string procName     = "";
            string title        = "";
            string titleColor   = "";
            string ProcessName  = "";
            string VehicleCount = "";



            for (int i = 0; i < 9; i++)
            {
                if (i == 0)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Gate";
                    titleColor  = "#006666";
                    ProcessName = "Gate";
                    //lbWGate.Text = VehicleCount;
                    DataTable dtVehicle = new DataTable();
                    dtVehicle    = GetVehicles(procName, ProcessName);
                    lbWGate.Text = dtVehicle.Rows.Count.ToString();
                }
                else if (i == 1)
                {
                    procName = "GetVehiclePositionInfo_New";
                    title    = "Job Card";
                    //titleColor = "#c52047";
                    titleColor  = "#ff6b31";
                    ProcessName = "JobSlip";
                    DataTable dtVehicle1 = new DataTable();
                    dtVehicle1 = GetVehicles(procName, ProcessName);
                    lbRO.Text  = dtVehicle1.Rows.Count.ToString();
                }

                else if (i == 2)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Workshop";
                    titleColor  = "#53a145";
                    ProcessName = "WorkShop";
                    DataTable dtVehicle2 = new DataTable();
                    dtVehicle2      = GetVehicles(procName, ProcessName);
                    lbWorkshop.Text = dtVehicle2.Rows.Count.ToString();
                }
                else if (i == 3)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Speedo";
                    titleColor  = "#c16978";
                    ProcessName = "Speedo";
                    DataTable dtVehicle2 = new DataTable();
                    dtVehicle2    = GetVehicles(procName, ProcessName);
                    lbSpeedo.Text = dtVehicle2.Rows.Count.ToString();
                }
                else if (i == 4)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Wheel Alignment";
                    titleColor  = "#275d8b";
                    ProcessName = "Wheel Alignment";
                    dtVehicle   = GetVehicles(procName, ProcessName);
                    lbWA.Text   = dtVehicle.Rows.Count.ToString();
                }
                else if (i == 5)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Road Test";
                    titleColor  = "#11a285";
                    ProcessName = "RT";
                    dtVehicle   = GetVehicles(procName, ProcessName);
                    lbRT.Text   = dtVehicle.Rows.Count.ToString();
                }
                else if (i == 6)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = " Quality";
                    titleColor  = "#6d4270";
                    ProcessName = "Final Inspection";
                    dtVehicle   = GetVehicles(procName, ProcessName);
                    lbFI.Text   = dtVehicle.Rows.Count.ToString();
                }
                else if (i == 7)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Wash";
                    titleColor  = "#d59010";
                    ProcessName = "Wash";
                    dtVehicle   = GetVehicles(procName, ProcessName);
                    lbWash.Text = dtVehicle.Rows.Count.ToString();
                }
                else if (i == 8)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = "Ready";
                    titleColor  = "#95a112";
                    ProcessName = "Vehicle Ready";
                    dtVehicle   = GetVehicles(procName, ProcessName);
                    lbVR.Text   = dtVehicle.Rows.Count.ToString();
                }
                var cell = new HtmlTableCell();
                cell.VAlign      = "Top";
                cell.Style.Value = "width:11.11%;";

                //var Row = new HtmlTableRow();


                //  DataTable dtVehicle = new DataTable();
                dtVehicle = GetVehicles(procName, ProcessName);
                int totalVehicle = dtVehicle.Rows.Count;

                DataTable dt = new DataTable();


                Panel pnl = new Panel();
                pnl.ID = ("pnl_" + i.ToString());
                // pnl.Style.Value = "width:100%;height:340px;background-color:#FFFFFF;overflow:auto;cellspacing='0'; cellpadding='0';";
                pnl.CssClass = "PanelStyle1";
                for (int j = 0; j < totalVehicle; j++)
                {
                    dt = GetInOutTime(dtVehicle.Rows[j]["Slno"].ToString(), ProcessName);
                    Panel           pnla     = new Panel();
                    PositionDisplay vt       = (PositionDisplay)Page.LoadControl("PositionDisplay.ascx");
                    int             Vehlenth = dtVehicle.Rows[j]["RegNo"].ToString().Length;
                    if (dtVehicle.Rows[j]["RegNo"].ToString().Length > 8)
                    {
                        vt.RegNo = dtVehicle.Rows[j]["RegNo"].ToString().Substring(2, Vehlenth - 2);
                    }
                    else
                    {
                        vt.RegNo = dtVehicle.Rows[j]["RegNo"].ToString();
                    }
                    vt.Model        = dtVehicle.Rows[j]["VehicleModel"].ToString();
                    vt.VehicleImage = DataManager.car_image(dtVehicle.Rows[j]["ModelImageUrl"].ToString());
                    vt.Slno         = dtVehicle.Rows[j]["Slno"].ToString();
                    //if (dtVehicle.Rows[j]["Position"].ToString() != "Gate")
                    vt.LastProcess = DataManager.jcr_image(dtVehicle.Rows[j]["PositionUrl"].ToString());
                    // lblSlno.Text = dtVehicle.Rows[j]["Slno"].ToString();
                    vt.VehicleColor = GetPositionColor(dtVehicle.Rows[j]["Position"].ToString().Trim());

                    //vt.PDTCheck = true;
                    //vt.PDT = dtVehicle.Rows[j]["PDT"].ToString();
                    vt.PDTImage = DataManager.jcr_image(dtVehicle.Rows[j]["PDTStatus"].ToString());
                    if (dtVehicle.Rows[j]["ServiceAdvisor"].ToString().Length > 10)
                    {
                        vt.ServiceAdvisor = dtVehicle.Rows[j]["ServiceAdvisor"].ToString().Substring(0, 10);
                    }
                    else
                    {
                        vt.ServiceAdvisor = dtVehicle.Rows[j]["ServiceAdvisor"].ToString();
                    }
                    if (ProcessName.Contains("Ready"))
                    {
                        vt.idletime = "Ready " + dt.Rows[0]["Intime"].ToString().Replace("#", " ");
                    }
                    else
                    {
                        vt.idletime = "Intime " + dt.Rows[0]["Intime"].ToString().Replace("#", " ");
                    }
                    //vt.CWJDPImage = dtVehicle.Rows[j]["CWJDP"].ToString();



                    pnla.Controls.Add(vt);
                    //pnla.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + vt.Slno.ToString() + "','" + ProcessName + "')");
                    //pnla.Attributes.Add("onmouseout", "hideTooltip(event)");
                    pnl.Controls.Add(pnla);
                    //cell.Controls.Add(pnl);
                    //Row.Controls.Add(cell);
                }



                Label lbl = new Label();
                lbl.Style.Value = "width:99%;background-color:" + titleColor + ";vertical-align:middle;color:#FFFFFF; font-weight:bold;padding-left:5px;font-size:18px;";
                lbl.Height      = new Unit(64);
                lbl.Width       = new Unit(13);
                //lbl.Text = "<table style='width: 99%; height: 100%;' border='0' cellspacing='0' cellpadding='0'><tr><td style='white-space:nowrap;'>" + title + "</td><td style='white-space:nowrap;text-align:right;padding-right:15px;border=1;'> " + totalVehicle.ToString() + "</td></tr></table>";
                lbl.Text = "<table style='width: 99%; height: 100%;' border='0' cellspacing='0' cellpadding='0'><tr><td style='white-space:nowrap;text-align:center;border=1;font-family:Roboto, sans-serif; font-size:35px;'> " + totalVehicle.ToString() + "</td></tr><tr><td style='white-space:nowrap;text-align:center;font-family:Roboto, sans-serif; font-size:15px;'>" + title + "</td></tr></table>";
                cell.Controls.Add(lbl);
                cell.Controls.Add(pnl);



                //DataTable dt = new DataTable();
                //dt = GetVehicles(procName, ProcessName);
                //int totalVehicle1 = dt.Rows.Count;
                //for (int flag = 0; flag < totalVehicle1; flag++)
                //{

                //    cell.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + dt.Rows[flag]["Slno"].ToString() + "','" + ProcessName + "')");
                //    cell.Attributes.Add("onmouseout", "hideTooltip(event)");
                //    pnl_Display.Cells.Add(cell);
                //}
                pnl_Display.Controls.Add(cell);
                // pnl_Display.Cells.Add(cell);

                // tbl_Hover.Cells.Add(pnl_Display);

                //pnl_Display.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + lblSlno.Text.ToString() + "','" + ProcessName + "')");
                //pnl_Display.Attributes.Add("onmouseout", "hideTooltip(event)");


                // pnl_Display.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + lblSlno.Text + "','Gate')");
            }
        }
        catch (Exception ex)
        {
        }
    }
    public void FillVehicleIdleDashboard()
    {
        try
        {
            pnl_Idle_Display.Controls.Clear();

            string procName    = "";
            string title       = "";
            string titleColor  = "";
            string ProcessName = "";



            for (int i = 0; i < 5; i++)
            {
                if (i == 0)
                {
                    procName    = "GetVehiclePositionInfo_New";
                    title       = " Vehicle Hold";
                    titleColor  = "Gray";
                    ProcessName = "Vehicle Hold";
                    dtVehicleI  = GetVehicles(procName, ProcessName);
                    lbVH.Text   = dtVehicleI.Rows.Count.ToString();
                }
                else if (i == 1)
                {
                    procName    = "GetVehicleIdlePositionInfo_New";
                    title       = "Workshop";
                    titleColor  = "#53a145";
                    ProcessName = "Workshop";
                    dtVehicleI  = GetVehicles(procName, ProcessName);
                    VHR         = int.Parse(dtVehicleI.Rows.Count.ToString());
                }
                else if (i == 2)
                {
                    procName    = "GetVehicleIdlePositionInfo_New";
                    title       = "Wheel Alignment";
                    titleColor  = "#275d8b";
                    ProcessName = "Wheel Alignment";

                    dtVehicleI = GetVehicles(procName, ProcessName);
                    WA         = int.Parse(dtVehicleI.Rows.Count.ToString());
                }

                else if (i == 3)
                {
                    procName    = "GetVehicleIdlePositionInfo_New";
                    title       = "Quality";
                    titleColor  = "#6d4270";
                    ProcessName = "Final Inspection";

                    dtVehicleI = GetVehicles(procName, ProcessName);
                    FI         = int.Parse(dtVehicleI.Rows.Count.ToString());
                }
                else if (i == 4)
                {
                    procName    = "GetVehicleIdlePositionInfo_New";
                    title       = "Wash";
                    titleColor  = "#d59010";
                    ProcessName = "Wash";
                    dtVehicleI  = GetVehicles(procName, ProcessName);
                    Wash        = int.Parse(dtVehicleI.Rows.Count.ToString());
                }



                var cell = new HtmlTableCell();
                cell.VAlign      = "Top";
                cell.Style.Value = "width:20%;";


                DataTable dtVehicle = new DataTable();
                dtVehicle = GetVehicles(procName, ProcessName);
                int totalVehicle = dtVehicle.Rows.Count;

                Panel pnl1 = new Panel();
                pnl1.ID = ("pnl1_" + i.ToString());
                //pnl1.Style.Value = "width:100%;height:220px;background-color:#FFFFFF;overflow:auto;cellspacing='0'; cellpadding='0';";
                pnl1.CssClass = "PanelStyle";
                for (int j = 0; j < totalVehicle; j++)
                {
                    Panel pnb = new Panel();

                    PositionDisplay vt = (PositionDisplay)Page.LoadControl("PositionDisplay.ascx");
                    vt.RegNo        = dtVehicle.Rows[j]["RegNo"].ToString();
                    vt.Model        = dtVehicle.Rows[j]["VehicleModel"].ToString();
                    vt.VehicleImage = DataManager.car_image(dtVehicle.Rows[j]["ModelImageUrl"].ToString());
                    vt.VehicleColor = GetPositionColor(dtVehicle.Rows[j]["Position"].ToString().Trim());
                    lblSlno.Text    = dtVehicle.Rows[j]["Slno"].ToString();
                    //vt.PDT = dtVehicle.Rows[j]["PDT"].ToString();
                    vt.PDTImage = DataManager.jcr_image(dtVehicle.Rows[j]["PDTStatus"].ToString());
                    if (ProcessName != "Gate")
                    {
                        vt.LastProcess = DataManager.jcr_image(dtVehicle.Rows[j]["PositionUrl"].ToString());
                    }
                    //vt.GateInTime = dtVehicle.Rows[j]["PDT"].ToString();
                    if (dtVehicle.Rows[j]["ServiceAdvisor"].ToString().Length > 12)
                    {
                        vt.ServiceAdvisor = dtVehicle.Rows[j]["ServiceAdvisor"].ToString().Substring(0, 12);
                    }
                    else
                    {
                        vt.ServiceAdvisor = dtVehicle.Rows[j]["ServiceAdvisor"].ToString();
                    }
                    vt.idletime = LoadIdleInOutTime(dtVehicle.Rows[j]["Slno"].ToString());
                    //vt.CWJDPImage = dtVehicle.Rows[j]["CWJDP"].ToString();
                    //vt.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + lblSlno.Text.ToString() + "','" + ProcessName + "')");
                    //vt.Attributes.Add("onmouseout", "hideTooltip(event)");
                    pnb.Controls.Add(vt);

                    /*CHANGES MADE TO HOVER*/

                    //if (ProcessName == "Vehicle Hold")
                    //{
                    //    pnb.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + lblSlno.Text.ToString() + "','" + ProcessName + "')");
                    //    pnb.Attributes.Add("onmouseout", "hideTooltip(event)");
                    //}
                    //else
                    //{
                    //    pnb.Attributes.Add("onmouseover", "ShowLoadIdleInOutTime(event,'" + lblSlno.Text.ToString() + "')");
                    //    pnb.Attributes.Add("onmouseout", "hideTooltip(event)");
                    //}


                    /*CHANGES MADE TO HOVER*/
                    pnl1.Controls.Add(pnb);
                }


                Label lbl = new Label();
                //if (ProcessName == "BodyShop")
                //    lbl.Style.Value = "width:99%;background-color:" + titleColor + ";vertical-align:middle;color:#000000; font-weight:bold;padding-left:5px;font-size:18px;";
                //else
                lbl.Style.Value = "width:99%;background-color:" + titleColor + ";vertical-align:middle;color:#FFFFFF; font-weight:bold;padding-left:5px;font-size:18px;";
                lbl.Height      = new Unit(24);
                lbl.Width       = new Unit(13);
                lbl.Text        = "<table style='width: 99%; height: 100%;' border='0' cellspacing='0' cellpadding='0'><tr><td style='white-space:nowrap;font-family:Roboto, sans-serif;font-size:15px;'>" + title + "</td><td style='white-space:nowrap;text-align:right;padding-right:15px;font-family:Roboto, sans-serif;font-size:15px;'>" + totalVehicle.ToString() + "</td></tr></table>";
                cell.Controls.Add(lbl);


                cell.Controls.Add(pnl1);

                pnl_Idle_Display.Cells.Add(cell);
            }
        }
        catch (Exception ex)
        {
        }
    }