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

    Всего: 2

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

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    public string LastModifiedOnDisplay
     { 
           get 
           {
                if (LastModifiedOn != null)
                    return DateTime.Parse(LastModifiedOn.ToString()).ToShortDateString() + " " + DateTime.Parse(LastModifiedOn.ToString()).ToLongTimeString();
                else
                    return string.Empty;
            }
    }

    Наследие от вроде бы настоящих индусов

    kagetoki, 10 Ноября 2017

    Комментарии (2)
  3. C# / Говнокод #19722

    +1

    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
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    private int GetSroOper(MiscTransactionParams param)
    		{
    			if (param.ExpenseItem != null)
    			{
    				switch (param.ContractType)
    				{
    					case Entities.AT.ContractType.Undefined:
    					case Entities.AT.ContractType.TimeAndMaterials:
    					case Entities.AT.ContractType.Retainer:
    						switch ((int)param.ExpenseItem.ExpenseCategory)
    						{
    							case 2:
    							case 3:
    							case 29684252:
    							case 29684285:
    							case 29684805:
    								return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation900;
    							default:
    								throw new InvalidOperationException("Unsupported Expense Category value");
    						}
    					case Entities.AT.ContractType.RecurringService:
    						switch ((int)param.ExpenseItem.ExpenseCategory)
    						{
    							case 2:
    							case 3:
    							case 29684252:
    							case 29684285:
    							case 29684805:
    								return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation550 : Helper.SLServiceOrderOperation950;
    							default:
    								throw new InvalidOperationException("Unsupported Expense Category value");
    						}
    					case Entities.AT.ContractType.FixedPrice:
    						switch ((int)param.ExpenseItem.ExpenseCategory)
    						{
    							case 2:
    							case 3:
    							case 29684252:
    							case 29684285:
    							case 29684805:
    								return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation500 : Helper.SLServiceOrderOperation950;
    							default:
    								throw new InvalidOperationException("Unsupported Expense Category value");
    						}
    					case Entities.AT.ContractType.Incident:
    						switch ((int)param.ExpenseItem.ExpenseCategory)
    						{
    							case 2:
    							case 3:
    							case 29684252:
    							case 29684285:
    							case 29684805:
    								return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation950;
    							default:
    								throw new InvalidOperationException("Unsupported Expense Category value");
    						}
    					default:
    						throw new InvalidOperationException("Unsupported ContractType value");
    				}
    			}
    			else
    			{
    				switch (param.ContractType)
    				{
    					case Entities.AT.ContractType.Undefined:
    					case Entities.AT.ContractType.TimeAndMaterials:
    					case Entities.AT.ContractType.Retainer:
    						return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation900;
    					case Entities.AT.ContractType.RecurringService:
    						return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation550 : Helper.SLServiceOrderOperation950;
    					case Entities.AT.ContractType.FixedPrice:
    					case Entities.AT.ContractType.Incident:
    						int sroOper = (int)param.OrderOperation.EntityRow()[Constants.ServiceOrderOperation.Field.SroOper];
    						switch (sroOper)
    						{
    							case 500:
    							case 600:
    							case 800:
    							case 850:
    							case 950:
    								return sroOper;
    							default:
    								throw new InvalidOperationException("Unsupported Operation value");
    						}
    					default:
    						throw new InvalidOperationException("Unsupported ContractType value");
    				}
    			}
    		}

    Это наш сеньор написал

    kagetoki, 30 Марта 2016

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