Ejemplo n.º 1
0
    public void FillVehicleDashboard()
    {
        try
        {
            external1.Controls.Clear();
            string procName = "";
            procName = "GetRegTagList_NEW";

            var cell = new HtmlTableCell();
            cell.VAlign      = "Top";
            cell.Style.Value = "width:11.11%;";
            DataTable dtVehicle = new DataTable();
            dtVehicle = Getvehicle(procName);
            int   totalVehicle = dtVehicle.Rows.Count;
            Panel pnl          = new Panel();
            pnl.ID = ("pnl_" + ToString());
            Label lbl = new Label();
            for (int j = 0; j < totalVehicle; j++)
            {
                Panel             pnla = new Panel();
                AllotmentVehicles vt   = (AllotmentVehicles)Page.LoadControl("AllotmentVehicles.ascx");
                vt.RegNo          = dtVehicle.Rows[j]["Reg No"].ToString();
                vt.Slno           = dtVehicle.Rows[j]["Slno"].ToString();
                vt.ServiceAdvisor = dtVehicle.Rows[j]["SA"].ToString();
                vt.Model          = dtVehicle.Rows[j]["Tag No"].ToString();
                vt.VehicleImage   = DataManager.car_image(dtVehicle.Rows[j]["ModelImageUrl"].ToString());
                if (dtVehicle.Rows[j]["PDT"].ToString().Contains("#"))
                {
                    vt.VehicleColor = "Orange";
                    vt.PDT          = dtVehicle.Rows[j]["PDT"].ToString().Split('#')[0];
                }
                else
                {
                    vt.PDT = dtVehicle.Rows[j]["PDT"].ToString();
                }
                vt.PDTStatus = DataManager.jcr_image(dtVehicle.Rows[j]["PDTStatus"].ToString());
                vt.CWJDP     = DataManager.jcr_image(dtVehicle.Rows[j]["CWJDP"].ToString());
                pnla.Controls.Add(vt);
                pnl.Controls.Add(pnla);
            }
            cell.Controls.Add(lbl);
            cell.Controls.Add(pnl);
            external1.Controls.Add(cell);
        }
        catch (Exception ex)
        {
            // Console.WriteLine(ex.Message);
        }
    }
Ejemplo n.º 2
0
    //VEHICLE DETAILS

    public void FillVehicleDashboard(string procName)
    {
        try
        {
            external1.Controls.Clear();
            String Error = "";
            var    cell  = new HtmlTableCell();
            cell.VAlign      = "Top";
            cell.Style.Value = "width:11.11%;";
            DataTable dtVehicle = new DataTable();
            if (string.Equals(procName, "GetRegTagList_NEW", StringComparison.OrdinalIgnoreCase))
            {
                dtVehicle = Getvehicle(procName);
            }
            else if (string.Equals(procName, "CheckAllotmentByRegNo_New", StringComparison.OrdinalIgnoreCase))
            {
                dtVehicle = GetVehicleByRegNO(procName, txtsearch.Text);
                Error     = "RegNo";
            }

            else if (string.Equals(procName, "CheckAllotmentByTagNo_New", StringComparison.OrdinalIgnoreCase))
            {
                dtVehicle = GetVehicleByTagNO(procName, txtsearch.Text);
                Error     = "TagNo";
            }
            if (dtVehicle.Rows.Count == 0 && Error != "")
            {
                lblMessage.ForeColor = Color.Red;
                lblMessage.Text      = "Wrong " + Error + ".!";
            }
            else
            {
                lblMessage.Text = "";
                int   totalVehicle = dtVehicle.Rows.Count;
                Panel pnl          = new Panel();
                pnl.ID = ("pnl_" + ToString());
                Label lbl = new Label();

                for (int j = 0; j < totalVehicle; j++)
                {
                    Panel             pnla = new Panel();
                    AllotmentVehicles vt   = (AllotmentVehicles)Page.LoadControl("AllotmentVehicles.ascx");
                    regno.Text        = dtVehicle.Rows[j]["Reg No"].ToString();
                    vt.RegNo          = dtVehicle.Rows[j]["Reg No"].ToString();
                    vt.Slno           = dtVehicle.Rows[j]["Slno"].ToString();
                    vt.ServiceAdvisor = dtVehicle.Rows[j]["SA"].ToString();
                    vt.Model          = dtVehicle.Rows[j]["Tag No"].ToString();
                    vt.VehicleImage   = DataManager.car_image(dtVehicle.Rows[j]["ModelImageUrl"].ToString());
                    if (dtVehicle.Rows[j]["PDT"].ToString().Contains("#"))
                    {
                        vt.VehicleColor = "Orange";
                        vt.PDT          = dtVehicle.Rows[j]["PDT"].ToString().Split('#')[0];
                    }
                    else
                    {
                        vt.PDT = dtVehicle.Rows[j]["PDT"].ToString();
                    }
                    vt.PDTStatus = DataManager.jcr_image(dtVehicle.Rows[j]["PDTStatus"].ToString());
                    vt.CWJDP     = DataManager.jcr_image(dtVehicle.Rows[j]["CWJDP"].ToString());
                    pnla.Controls.Add(vt);
                    pnl.Controls.Add(pnla);
                }

                cell.Controls.Add(lbl);
                cell.Controls.Add(pnl);
                external1.Controls.Add(cell);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }