Esempio n. 1
0
        private void initialiseLabel()
        {
            labNbPassager.Text      = serviceFicheBord.getNombreTotalPassager(hfNumerosFB.Value).ToString();
            labPoidTotalBagage.Text = serviceGeneral.separateurDesMilles(serviceFicheBord.getPoidTotalBagage(hfNumerosFB.Value).ToString("0")) + "Kg";
            labSommeRecu.Text       = serviceGeneral.separateurDesMilles((serviceFicheBord.getPrixTotalBillet(hfNumerosFB.Value) + serviceFicheBord.getPrixTotalBagage(hfNumerosFB.Value)).ToString("0")) + "Ar";

            labPoidTotalCommission.Text  = serviceGeneral.separateurDesMilles(serviceFicheBord.getPoidTotalCommission(hfNumerosFB.Value).ToString("0")) + "Kg";
            labTotalFraisCommission.Text = serviceGeneral.separateurDesMilles(serviceFicheBord.getPrixTotalCommission(hfNumerosFB.Value).ToString("0")) + "Ar";
        }
Esempio n. 2
0
        private Table creeImageVoiture(int nbPlace, int nbColone, List <crlPlaceFB> placeFBs, crlFicheBord ficheBord)
        {
            #region declaration
            Table tableVoiture = null;
            #endregion

            #region implementation
            if (nbPlace == placeFBs.Count)
            {
                LinkButton btnSelectHead = new LinkButton();
                btnSelectHead.Text        = ficheBord.autorisationVoyage.Verification.Licence.vehicule.MatriculeVehicule + " <br/>" + ficheBord.autorisationVoyage.Verification.Licence.vehicule.MarqueVehicule + " <br/>" + ficheBord.autorisationVoyage.Verification.Licence.vehicule.CouleurVehicule;
                btnSelectHead.PostBackUrl = "RemplirFB.aspx?numerosFB=" + ficheBord.NumerosFB;
                btnSelectHead.CssClass    = "voitureText";
                btnSelectHead.Width       = new Unit(80);


                List <TableCell> cells  = new List <TableCell>();
                List <TableRow>  rows   = new List <TableRow>();
                List <Image>     images = new List <Image>();

                TableCell cellChauffeur  = new TableCell();
                Image     imageChauffeur = new Image();
                imageChauffeur.ImageUrl = "~/CssStyle/images/bleu.png";

                cellChauffeur.Controls.Add(imageChauffeur);
                cellChauffeur.ColumnSpan = nbColone - 2;

                TableCell cellHead = new TableCell();
                cellHead.ColumnSpan = nbColone;
                cellHead.Height     = 25;
                cellHead.CssClass   = "voitureHead";
                cellHead.Controls.Add(btnSelectHead);
                //cellHead.Controls.Add(btnSelectHeadMarque);
                //cellHead.Controls.Add(btnSelectHeadCouleur);

                TableRow rowHead = new TableRow();
                rowHead.Cells.Add(cellHead);
                TableCell cellFoot = new TableCell();
                cellFoot.ColumnSpan = nbColone;
                cellFoot.Height     = 10;
                cellFoot.CssClass   = "voitureFoot";

                #region foot
                TableCell cellFootItem11 = new TableCell();
                cellFootItem11.ColumnSpan = nbColone - 1;
                cellFootItem11.CssClass   = "voitureFootItem";
                TableCell cellFootItem12 = new TableCell();
                cellFootItem12.CssClass = "voitureFootItem";
                TableCell cellFootItem22 = new TableCell();
                cellFootItem22.ColumnSpan = nbColone;
                cellFootItem22.CssClass   = "voitureFootItem";

                Image imgIndicateur = new Image();

                int    nbPlaceOccuper = serviceFicheBord.getNombreTotalPassager(ficheBord.NumerosFB);
                double poidBagage     = serviceFicheBord.getPoidTotalBagage(ficheBord.NumerosFB) + serviceFicheBord.getPoidTotalCommission(ficheBord.NumerosFB);

                if (ficheBord.autorisationVoyage.Verification.Licence.vehicule.paramVehicule.NbPassagerMin > nbPlaceOccuper)
                {
                    imgIndicateur.ImageUrl = "~/CssStyle/images/rouge.png";
                }
                else if (nbPlaceOccuper == ficheBord.autorisationVoyage.Verification.Licence.NombrePlacePayante)
                {
                    imgIndicateur.ImageUrl = "~/CssStyle/images/vert.png";
                }
                else
                {
                    imgIndicateur.ImageUrl = "~/CssStyle/images/bleu.png";
                }

                Label labelIndicateur = new Label();
                labelIndicateur.Text = "Indicateur:";
                Label labelBagVar = new Label();
                labelBagVar.Text = "Bag:" + poidBagage.ToString("0") + "Kg/" + ficheBord.autorisationVoyage.Verification.Licence.vehicule.paramVehicule.PoidBagageMax.ToString("0") + "Kg";

                cellFootItem11.Controls.Add(labelIndicateur);
                cellFootItem12.Controls.Add(imgIndicateur);

                cellFootItem22.Controls.Add(labelBagVar);

                TableRow rowFootItem1 = new TableRow();
                rowFootItem1.Cells.Add(cellFootItem11);
                rowFootItem1.Cells.Add(cellFootItem12);
                TableRow rowFootItem2 = new TableRow();
                rowFootItem2.Cells.Add(cellFootItem22);
                #endregion


                TableRow rowFoot = new TableRow();
                rowFoot.Cells.Add(cellFoot);

                for (int i = 0; i < nbPlace; i++)
                {
                    cells.Add(new TableCell());
                    images.Add(new Image());
                }
                for (int i = 0; i < nbPlace; i++)
                {
                    if (placeFBs[i].IsOccuper == 1)
                    {
                        images[i].ImageUrl = "~/CssStyle/images/rouge.png";
                    }
                    else
                    {
                        images[i].ImageUrl = "~/CssStyle/images/vert.png";
                    }

                    cells[i].Controls.Add(images[i]);
                }

                rows = new List <TableRow>();
                rows.Add(new TableRow());
                rows[0].Cells.Add(cellChauffeur);
                if (cells.Count >= 2)
                {
                    rows[0].Cells.Add(cells[0]);
                    rows[0].Cells.Add(cells[1]);
                }

                int iColone = 1;
                int iPlace  = 2;
                int iRow    = 1;

                while (iPlace < nbPlace)
                {
                    if (iColone == 1)
                    {
                        rows.Add(new TableRow());
                        rows[iRow].Cells.Add(cells[iPlace]);

                        iPlace  = iPlace + 1;
                        iColone = iColone + 1;
                    }
                    else
                    {
                        rows[iRow].Cells.Add(cells[iPlace]);

                        iPlace  = iPlace + 1;
                        iColone = iColone + 1;
                    }

                    if (iColone > nbColone)
                    {
                        iRow    = iRow + 1;
                        iColone = 1;
                    }

                    tableVoiture             = new Table();
                    tableVoiture.CellSpacing = 0;

                    tableVoiture.Rows.Add(rowHead);
                    for (int i = 0; i < iRow; i++)
                    {
                        rows[i].CssClass = "trVoiture";
                        tableVoiture.Rows.Add(rows[i]);
                    }
                    tableVoiture.Rows.Add(rowFootItem2);
                    tableVoiture.Rows.Add(rowFootItem1);
                    tableVoiture.Rows.Add(rowFoot);
                }
            }
            #endregion

            return(tableVoiture);
        }