1. Список говнокодов пользователя LIBERTE

    Всего: 1

  2. C# / Говнокод #18120

    +147

    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
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    public static object get_pack_print(int packid)
                {
                    OracleConnection conn = connect();
                    conn.Open();
                    string json = "";
                    string sql1 = "select id, num, k01.fio||' '||k01.fnam||' '||k01.fot fio, k02.fio||' '||k02.fnam||' '||k02.fot fior, s01.s_name_s sno, s02.s_name_s snor " +
                                  "from ertd_card ec, HCM_K01@DBLKIPR k01, HCM_K01@DBLKIPR k02, HCM_S01@DBLKIPR s01, HCM_S01@DBLKIPR s02 " +
                                  "where " +
                                  "EC.PACKID=" + packid +
                                  " and k01.tnr = ec.tnr " +
                                  "and k02.tnr = ec.tnrr " +
                                  "and s01.s_no = ec.sno " +
                                  "and s02.s_no = ec.snor " +
                                  "and ec.del= 0";
                    try
                    {
    
                        OracleCommand cmd = new OracleCommand(sql1, conn);
                        cmd.CommandType = CommandType.Text;
                        OracleDataReader dr = cmd.ExecuteReader();
                        dr.Read();
                       
                        do
                        {
                            if (string.IsNullOrEmpty(json))
                            {
                               
    
                                json += "{\"data\":[{\"id\":\"" + dr["id"].ToString() + "\",\"num\":\"" + dr["num"].ToString() + "\",\"sno\":\"" + dr["sno"].ToString() + "\",\"snor\":\"" + dr["snor"].ToString() +
                                    "\",\"fio\":\"" + dr["fio"].ToString() +
                                    "\",\"fior\":\"" + dr["fior"].ToString() + "\"}";
    
                            }
                            else
                            {
                                json += ",{\"id\":\"" + dr["id"].ToString() + "\",\"num\":\"" + dr["num"].ToString() + "\",\"sno\":\"" + dr["sno"].ToString() + "\",\"snor\":\"" + dr["snor"].ToString() +
                                    "\",\"fio\":\"" + dr["fio"].ToString() +
                                    "\",\"fior\":\"" + dr["fior"].ToString() + "\"}";
                            }
                        }
                        while (dr.Read());
                      
                        json += "]}";
    
                        conn.Close();
                        return new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(json);
                      
                    }
                    catch (Exception ex)
                    {
                        conn.Close();
                        return null;
                    }
                }

    да просто стиль у него такой. Суровый.
    += "}"

    LIBERTE, 06 Мая 2015

    Комментарии (24)