1. C# / Говнокод #1977

    +139

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    // export in csv - part of the code
    // ...
                foreach (users_view _item in _users_view)
                {
                    _writer.Write(String.Format("{1}{0}{2}{0}{3}{0}{4}{0}{5}{0}{6}{0}{7}{0}{8}{0}{9}{0}{10}{0}{11}{0}{12}{0}{13}{0}{14}{0}{15}{0}{16}{0}{17}{0}{18}{0}{19}{0}{20}{0}{21}{0}{22}{0}{23}{0}{24}\n",
                        AppSettingsReader.GetValue("CSVFileSeparator"),
                         @"""" + _item.title_name + @"""", @"""" + _item.first_name + @"""",
                         @"""" + _item.last_name + @"""", @"""" + _item.job_title + @"""",
                        @"""" + _item.user_type_name + @"""",
                                                
                        @""""+_item.company_name+@"""",
                        (_item.telephone != null) ? (@"""" + _item.telephone + @"""") : (""),
                        (_item.fax != null) ? (@"""" + _item.fax + @"""") : (""),
                        @"""" + _item.email + @"""",
                        (_item.account_email != null) ? (@"""" + _item.account_email + @"""") : (""),
                        @"""" + _item.site_address + @"""",
                        @"""" + _item.advertisement_source_name+@"""",
    
                        @"""" + _item.address_1+@"""",
                        (_item.address_2 != null) ? (@"""" + _item.address_2+@"""") : (""),
                        @"""" + _item.country_name+@"""",
                       
                        //_item.email_format_name,
    
                        (_item.postcode != null) ? (@"""" + _item.postcode+@"""") : (""),
                        (_item.county != null) ? (@"""" + _item.county+@"""") : (""),
                        @"""" + _item.town + @"""",
                    //    (_item.is_active == false) ? ("No") : ("Yes"),
    
                        @"""" + _item.username+@"""",
                        @"""" + _item.password+@"""",
                        @"""" + _item.account_type_name + @"""",
    
                        @"""" + _item.creation_date + @"""",
    
                        (_item.is_newsletter_subscriber == false) ? ("No") : ("Yes"),
                        (_item.is_marketing_subscriber == false) ? ("No") : ("Yes")
                        )
                    );
                }

    Вот что нашел :)

    Запостил: bugotrep, 14 Октября 2009

    Комментарии (7) RSS

    Добавить комментарий