Пример #1
0
        public IEnumerable <C_TempExpData> GetExperience()
        {
            string assurName;

            try
            {
                if (lbAssur.SelectedItem != null)
                {
                    assurName = lbAssur.SelectedItem.Text.ToString();
                    //###
                    return(C_TempExpData.GetExpDataForAssureur(assurName));
                }

                return(null);
            }
            catch (Exception ex) { UICommon.HandlePageError(ex, this.Page, "GestionExperience::GetExperience"); return(null); }
        }
        public static ExcelPackage ExportExperienceForAssureur(string assureurName)
        {
            try
            {
                List <C_TempExpData> exp = C_TempExpData.GetExpDataForAssureur(assureurName);

                ExcelPackage pck = new ExcelPackage();
                var          ws  = pck.Workbook.Worksheets.Add(assureurName);

                //write the header
                //ws.Column(2).Style.Numberformat.Format = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;
                ws.Column(3).Style.Numberformat.Format = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;

                ws.Cells[1, 1].Value  = "Import Id";
                ws.Cells[1, 2].Value  = "Nom Assureur";
                ws.Cells[1, 3].Value  = "Au";
                ws.Cells[1, 4].Value  = "Contrat";
                ws.Cells[1, 5].Value  = "Code College";
                ws.Cells[1, 6].Value  = "Annee Experience";
                ws.Cells[1, 7].Value  = "Libelle Acte";
                ws.Cells[1, 8].Value  = "Libelle Famille";
                ws.Cells[1, 9].Value  = "Type CAS";
                ws.Cells[1, 10].Value = "Nombre Acte";
                ws.Cells[1, 11].Value = "Frais Reel";
                ws.Cells[1, 12].Value = "Remb SS";
                ws.Cells[1, 13].Value = "Remb Annexe";
                ws.Cells[1, 14].Value = "Remb Nous";
                ws.Cells[1, 15].Value = "Reseau";
                ws.Cells[1, 16].Value = "Min FR";
                ws.Cells[1, 17].Value = "Max FR";
                ws.Cells[1, 18].Value = "Min Nous";
                ws.Cells[1, 19].Value = "Max Nous";

                int row = 2;

                foreach (C_TempExpData c in exp)
                {
                    ws.Cells[row, 1].Value = c.ImportId;
                    ws.Cells[row, 2].Value = c.AssureurName;
                    ws.Cells[row, 3].Value = c.Au;
                    ws.Cells[row, 4].Value = c.Contrat;
                    ws.Cells[row, 5].Value = c.CodCol;

                    ws.Cells[row, 6].Value  = c.AnneeExp;
                    ws.Cells[row, 7].Value  = c.LibActe;
                    ws.Cells[row, 8].Value  = c.LibFam;
                    ws.Cells[row, 9].Value  = c.TypeCas;
                    ws.Cells[row, 10].Value = c.NombreActe;

                    ws.Cells[row, 11].Value = c.Fraisreel;
                    ws.Cells[row, 12].Value = c.Rembss;
                    ws.Cells[row, 13].Value = c.RembAnnexe;
                    ws.Cells[row, 14].Value = c.RembNous;
                    ws.Cells[row, 15].Value = c.Reseau;

                    ws.Cells[row, 16].Value = c.MinFr;
                    ws.Cells[row, 17].Value = c.MaxFr;
                    ws.Cells[row, 18].Value = c.MinNous;
                    ws.Cells[row, 19].Value = c.MaxNous;

                    row++;
                }

                return(pck);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
                throw ex;
            }
        }