示例#1
0
        private string getCodeGenAttribute(TableDefinitionDataSet.FieldDefinitionRow row)
        {
            string format = "[FdmCodeGen("
                            + "Title = \"{0}\", "
                            + "IsRequired = {1}, "
                            + "IsUnique = {2}, "
                            + "IsSearch = {3}, "
                            + "IsSearchRange = {4}, "
                            + "IsListVisible = {5}, "
                            + "IsCreateVisible = {6}, "
                            + "IsEditVisible = {7}"
                            + ")]";

            string codeGenAttr = string.Format(format
                                               , row.DisplayName
                                               , row.IsRequired == "Y" ? "true" : "false"
                                               , row.KeyType.equalIgnoreCase("UK") ? "true" : "false"
                                               , row.IsSearch == "Y" ? "true" : "false"
                                               , row.IsSearchRange == "Y" ? "true" : "false"
                                               , row.IsListVisible == "N" ? "false" : "true"
                                               , row.IsCreateVisible == "N" ? "false" : "true"
                                               , row.IsEditVisible == "N" ? "false" : "true"
                                               );

            return(codeGenAttr);
        }
示例#2
0
        private string getDataLengthDesc(TableDefinitionDataSet.FieldDefinitionRow row)
        {
            if (row.DataType.StartsWith("DTN_", StringComparison.OrdinalIgnoreCase))
            {
                return(string.Format("{{{0}}}", row.DataType));
            }

            switch (row.DataType)
            {
            //case "DTN_ID":
            //case "DTN_NID":
            //    return "15";
            //case "DTN_DECIMAL":
            //    return "18";
            //case "DTN_INTEGER":
            //    return "INTEGER";
            //case "DTN_DOUBLE":
            //    return "DOUBLE";
            //case "DTN_BOOL_TF":
            //case "DTN_NBOOL_TF":
            //    return "1";
            //case "DTN_DATETIME_19":
            //    return "DateTime19";
            //case "DTN_DATETIME_10":
            //    return "DateTime10";
            //case "DTN_DATE_8":
            //    return "DateTime8";
            //case "DTN_DATETIME_16":
            //    return "DateTime16";
            //case "DTN_NVARCHAR1":
            //case "DTN_VARCHAR1":
            //    return "1";
            //case "DTN_NVARCHAR10":
            //case "DTN_VARCHAR10":
            //    return "10";
            //case "DTN_NVARCHAR20":
            //case "DTN_VARCHAR20":
            //    return "20";
            //case "DTN_NVARCHAR50":
            //case "DTN_VARCHAR50":
            //    return "50";
            //case "DTN_NVARCHAR100":
            //case "DTN_VARCHAR100":
            //    return "100";
            //case "DTN_NVARCHAR200":
            //case "DTN_VARCHAR200":
            //    return "200";
            //case "DTN_NVARCHAR500":
            //case "DTN_VARCHAR500":
            //    return "500";
            //case "DTN_NVARCHAR1000":
            //case "DTN_VARCHAR1000":
            //    return "1000";
            //case "DTN_NVARCHAR4000":
            //case "DTN_VARCHAR4000":
            //    return "4000";
            //case "DTN_TEXT":
            //    return "TEXT";
            //case "DTN_NTEXT":
            //    return "NTEXT";
            //case "DTN_EMAIL":
            //    return "EMAIL";
            //case "DTN_NEMAIL":
            //    return "NEMAIL";
            case "FdmDecimalType":
                return(string.Format("{{Decimal({0},{1})}}", row.Precision, row.Scale));

            case "FdmVarcharType":
                return(string.Format("{{Varchar({0})}}", row.DataLength));

            case "FdmNVarcharType":
                return(string.Format("{{NVarchar({0})}}", row.DataLength));

            default:
                return("");
            }
        }