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

    +132

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    SqlConnection cmdConnection = GetSKDConnection();
    cmdConnection.Open();
    SqlCommand resetCardCmd = new SqlCommand("UPDATE hPerson SET CurrentCardNr=NULL WHERE PersonalNr='" + pass.Number.TrimStart('0'), cmdConnection);
    resetCardCmd.CommandText = "DELETE FROM bCardData WHERE CardFK=" + (from pf in pass.PassFieldList where pf.FieldTypeName == "radio" select pf).Single().Card.CardNumber;
    resetCardCmd.ExecuteNonQuery();

    Мне кажется, или что то важное точно не произойдет?

    SantePaulinum, 24 Октября 2014

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

    +134

    1. 1
    2. 2
    3. 3
    4. 4
    //#if UNITY_IPHONE && !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9)
    if (Selection.activeGameObject != null)
    control = (IControl)Selection.activeGameObject.GetComponent("IControl");
    //#endif

    принял код от юнити юниора

    sladkijBubaleh, 23 Октября 2014

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

    +135

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    bool result = false;
    if (xmlString != null)
    {
       result = reportService.SaveQ360Report(questionnaireId, xmlString, publishReport);
       UpdateCurrentReportModel(questionnaireId, reportService);
    }
    // string errorMessage;
    if (result == false)
       result = true; //because model is not changed
    return Json(new { Success = result, ErrorMessage = DisplayLabels.InvalidModelError });

    sharpman, 23 Октября 2014

    Комментарии (1)
  4. C# / Говнокод #16902

    +132

    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
    IEnumerator CalcTimeToEnd()
    		{
    			while (Work.TimeToEnd > 0)
    			{
    				Work.TimeToEnd -= 1;
    				Text timerText = questTimerBg.gameObject.transform.FindChild("Text").GetComponent<Text>();
    				
    				int iHours = 0;
    				int iMunuts = 0;
    				int iSeconds = Quest.TimeToEnd;
    				if (iSeconds > 60)
    				{
    					iMunuts = iSeconds / 60;
    					iSeconds = iSeconds % 60;
    				}
    				if (iMunuts > 60)
    				{
    					iHours = iMunuts / 60;
    					iMunuts = iMunuts % 60;
    				}
    				string strTime = "";
    				if (iHours > 0)
    					strTime = iHours.ToString() + ":";
    				if (iMunuts < 10)
    					strTime += "0"; 
    				strTime += iMunuts.ToString() + ":";
    				if (iSeconds < 10)
    					strTime += "0";
    				strTime += iSeconds.ToString();
    				timerText.text = strTime;
    				yield return new WaitForSeconds(1f);
    			}
    			Work.SetState(EQuestState.eQS_ABORT);
    		}

    перевод времени в текст, на индусском

    govnim, 21 Октября 2014

    Комментарии (11)
  5. C# / Говнокод #16853

    +138

    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
    public virtual double MakePayment(double Summ)
    { 
                double remain = SummPlan - SummFact;
                remain = Summ - remain;
                remain = remain - SummFact;
                if (remain >= 0)
                {
                    SummFact = SummPlan;
                    return remain;
                }
                else
                {
                    SummFact = Summ;
                    return remain;
                }
    }

    Вот такая математика!

    kompman, 15 Октября 2014

    Комментарии (0)
  6. C# / Говнокод #16834

    +137

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public new String StartTime { get { return base.StartTime.ToString("H:mm"); } }
    
    public new String EndTime { get { return base.EndTime.ToString("H:mm"); } }
    
    public DateTime base_StartTime { get { return base.StartTime; } }
    
    public DateTime base_EndTime { get { return base.EndTime; } }

    kjuby8709gsome, 10 Октября 2014

    Комментарии (7)
  7. C# / Говнокод #16796

    +138

    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
    public static byte[] Trim(this byte[] origin_array)
            {
                int findex = -1, eindex = -1;
    
                bool inseq = false;
    
                if (origin_array[0] != 0x00)
                {
                    if (origin_array[origin_array.Length - 1] != 0x00)
                        return origin_array;
                    findex = 0;
                }
    
                for (int i = 0; i < origin_array.Length; i++)
                {
                    if (origin_array[i] == 0x00)
                    {
                        if (inseq)
                            continue;
                        else
                            inseq = true;
                    }
                    else
                    {
                        if (inseq)
                            if (findex == -1)
                                findex = i;
                        eindex = i;
                    }
                }
    
                if (findex == eindex)
                    return new byte[0];
                
                byte[] result_array = new byte[eindex - findex + 1]; 
                Array.Copy(origin_array, findex, result_array, 0, result_array.Length);
                return result_array;
            }

    dzzpchelka, 04 Октября 2014

    Комментарии (32)
  8. C# / Говнокод #16778

    +140

    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
    private void SetProgressIndicator(int step) {
       switch (step) {
        case 1:
         liStepOne.Attributes["class"] = "current";
         liStepTwo.Attributes["class"] = "";
         liStepThree.Attributes["class"] = "";
         liStepFour.Attributes["class"] = "";
         liStepFive.Attributes["class"] = "";
         break;
        case 2:
         liStepTwo.Attributes["class"] = "current";
         liStepOne.Attributes["class"] = "complete";
         liStepThree.Attributes["class"] = "";
         liStepFour.Attributes["class"] = "";
         liStepFive.Attributes["class"] = "";
         break;
        case 3:
         liStepThree.Attributes["class"] = "current";
         liStepOne.Attributes["class"] = "complete";
         liStepTwo.Attributes["class"] = "complete";
         liStepFour.Attributes["class"] = "";
         liStepFive.Attributes["class"] = "";
         break;
        case 4:
         liStepFour.Attributes["class"] = "current";
         liStepOne.Attributes["class"] = "complete";
         liStepTwo.Attributes["class"] = "complete";
         liStepThree.Attributes["class"] = "complete";
         liStepFive.Attributes["class"] = "";
         break;
        case 5:
         liStepFive.Attributes["class"] = "current";
         liStepOne.Attributes["class"] = "complete";
         liStepTwo.Attributes["class"] = "complete";
         liStepThree.Attributes["class"] = "complete";
         liStepFour.Attributes["class"] = "complete";
         break;
       }
    }

    http://s.lurkmore.to/images/8/85/Indian.jpg

    fafik91, 30 Сентября 2014

    Комментарии (9)
  9. C# / Говнокод #16774

    +138

    1. 1
    2. 2
    3. 3
    4. 4
    for (int i = 1; i != chars.Length; i++ )
                    {
                        charlist.Items.Add(chars[i]);
                    }

    http://kn1fe-zone.ru/index.php?threads/Лаунчер-с-автовходом-на-аккаунт-и-перса.430/

    DesmondHume, 28 Сентября 2014

    Комментарии (4)
  10. C# / Говнокод #16765

    +138

    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
    public List<string> AutoPublishProjectDepartmentNames { get; private set; }
            public string AutoPublishProjectDepartments
            {
                get { return _projectDepartments; }
                set
                {
                    _projectDepartments = value;
    
                    AutoPublishProjectDepartmentNames.Clear();
                    var departments = _projectDepartments.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    //Get EPT Names
                    foreach (var department in departments)
                    {
                        try
                        {
                            if (department.Length == 36 || department.Length == 38)
                            {
                                var departmentUid = new Guid(department);
                                AutoPublishProjectDepartmentNames.Add(SqlInstance.GetDepartmentName(departmentUid));
                                continue;
                            }
                        }
                        catch (FormatException)
                        {
                        }
    
                        //Not a guid
                        AutoPublishProjectDepartmentNames.Add(department);
                    }
                }
            }

    Очень хитрая пропертя, пока не засетишь одну пропертю - другая не будет работать. А еще она с гуидами работает. Ооочень хитрая. Юсфуль-туль.

    boades, 25 Сентября 2014

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