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

    +125

    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
    protected string getUpdateNotesDE(string fieldNameAlias, string fieldName, string fieldValue, ASPxDateEdit newValue)
            {
                if (isSaveField("fieldName"))
                {
                    if (fieldValue != "")
                        return "Field " + locCom.getFieldAlias("payTFNDeclaredOn") + ", Old Value = " + Convert.ToDateTime(fieldValue).ToString("dd/MM/yyyy") + ", New Value = " + Convert.ToDateTime(newValue.Text).ToString("dd/MM/yyyy") + " ; ";
                    else
                        if (newValue.Text != "")
                            return "Field " + locCom.getFieldAlias("payTFNDeclaredOn") + ", Old Value = , New Value = " + Convert.ToDateTime(newValue.Text).ToString("dd/MM/yyyy") + " ; ";
                }
                return "";
    
            }
    
     protected Boolean isSaveField(string fieldName)
            {
                if (locCom.getVisible(fieldName))
                    return true;
                return false;
            }
    
     public bool getVisible(string fldName)
                {
                    Boolean showall = Convert.ToBoolean(System.Web.Configuration.WebConfigurationManager.AppSettings.Get("Show-all-fields"));
                    if (showall) return true;
    
                    if (fldAccess.Tables.Count == 0) return false;
    
                    foreach (System.Data.DataRow item in fldAccess.Tables[0].Rows)
                    {
                        if (item["fieldname"].ToString().Replace('@', 'a').Replace("%", "percent").Replace("$", "dollar").ToLower() == fldName.ToLower())
                            return Convert.ToBoolean(item["visible"]);
                    }
                    return false;
                }

    особенно доставляет
    protected string getUpdateNotesDE(string fieldName){
    if (isSaveField( !!! "fieldName" !!!)){}
    }

    Запостил: valorkin, 15 Июня 2011

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

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