• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Data.PropertyCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.PropertyCollection的典型用法代码示例。如果您正苦于以下问题:C# PropertyCollection类的具体用法?C# PropertyCollection怎么用?C# PropertyCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertyCollection类属于System.Data命名空间,在下文中一共展示了PropertyCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DataRelation

		public DataRelation (string relationName, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints) 
		{
			this.extendedProperties = new PropertyCollection();
			if (relationName == null) relationName = string.Empty;
			this.relationName = relationName;
			if (parentColumns == null) throw new ArgumentNullException ();
			this.parentColumns = parentColumns;
			if (childColumns == null) throw new ArgumentNullException ();
			this.childColumns = childColumns;
			this.createConstraints = createConstraints;
			if (parentColumns.Length != childColumns.Length)
				throw new ArgumentException ("ParentColumns and ChildColumns should be the same length");
			DataTable parentTable = parentColumns[0].Table;
			DataTable childTable = childColumns[0].Table;
			if (parentTable.DataSet != childTable.DataSet)
				throw new InvalidConstraintException ();
			foreach (DataColumn column in parentColumns)
				if (column.Table != parentTable)
					throw new InvalidConstraintException ();
			foreach (DataColumn column in childColumns)
				if (column.Table != childTable)
					throw new InvalidConstraintException ();

			for (int i=0; i<ChildColumns.Length; i++)
				if (!( parentColumns[i].DataType.Equals( childColumns[i].DataType)))
					throw new InvalidConstraintException();
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:27,代码来源:DataRelation.cs


示例2: AddExtendedProperties

        internal static void AddExtendedProperties(PropertyCollection props, XmlElement node, Type type) {
            if(props != null) {
                foreach(DictionaryEntry entry in props) {
                    String s, v;

                    if (entry.Key is INullable) {
                        s = (String) SqlConvert.ChangeTypeForXML(entry.Key, typeof(string));

                    }
                    else {
                        s = (String) Convert.ToString(entry.Key, CultureInfo.InvariantCulture);
                    }

                    if (entry.Value is INullable) {
                        v = (String) SqlConvert.ChangeTypeForXML(entry.Value, typeof(string));
                    }
                    else if (entry.Value is System.Numerics.BigInteger) {
                        v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)entry.Value, typeof(string), CultureInfo.InvariantCulture);
                    }
                    else {
                        v = (String) Convert.ToString(entry.Value, CultureInfo.InvariantCulture);
                    }

                    if (type == typeof(DataRelation)) {
                        s = Keywords.MSD_REL_PREFIX + s;
                    }
                    else if (type == typeof(ForeignKeyConstraint)) {
                        s = Keywords.MSD_FK_PREFIX + s;
                    }
                    node.SetAttribute(XmlConvert.EncodeLocalName(s), Keywords.MSPROPNS, v);
                }
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:33,代码来源:xmlsaver.cs


示例3: Message

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dest">Destination of the message</param>
 /// <param name="src">Source of the message</param>
 /// <param name="buf">Byte buffer of payload associated with the message</param>
 public Message(Address dest, Address src, byte[] buf)
 {
     dest_addr = dest;
     src_addr = src;
     this.buf = buf;
     headers = new PropertyCollection();
 }
开发者ID:curasystems,项目名称:externals,代码行数:13,代码来源:Message.cs


示例4: Clone

 public override object Clone() {
     // override Clone so that returned object is an
     // instance of PropertyCollection instead of Hashtable
     PropertyCollection clone = new PropertyCollection();
     foreach (DictionaryEntry pair in this) {
         clone.Add(pair.Key, pair.Value);
     }
     return clone;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:9,代码来源:PropertyCollection.cs


示例5: AttachProperties_PropertyCollectionWithMishmatchingSchemaTypes_ThrowsArgumentException

		public void AttachProperties_PropertyCollectionWithMishmatchingSchemaTypes_ThrowsArgumentException() {
			var prophandler = DummyFactory.GetPropertyHandler();

			var propertyList = DummyFactory.GetPropertyList(12);
			var schema = DummyFactory.GetSchema<int>("property", 12);
			var attachedProperties = new PropertyCollection(propertyList, schema);

			Assert.Throws<ArgumentException>(() => prophandler.AttachProperties(attachedProperties));
		}
开发者ID:aelveborn,项目名称:njupiter,代码行数:9,代码来源:PropertyHandlerTests.cs


示例6: DataSet

		public DataSet (string name)
		{
			dataSetName = name;
			tableCollection = new DataTableCollection (this);
			relationCollection = new DataRelationCollection.DataSetRelationCollection (this);
			properties = new PropertyCollection ();
			this.prefix = String.Empty;
			
			this.Locale = CultureInfo.CurrentCulture;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:DataSet.cs


示例7: AppendExtendedProperties

 public static void AppendExtendedProperties(DataTable dtObj, PropertyCollection props, bool withClear)
 {
     if (withClear)
         dtObj.ExtendedProperties.Clear();
     try
     {
         foreach (DictionaryEntry item in props)
         {
             dtObj.ExtendedProperties.Add(item.Key, item.Value);
         }
     }
     catch { }
 }
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:13,代码来源:DataWorkShared.cs


示例8: Field

 public Field(int fieldId, string column, int typeId, string typeName, int panelId, 
     PropertyCollection attr = null, PropertyCollection rules = null)
 {
     this.fieldId = fieldId;
     this.column = column;
     this.typeName = typeName;
     this.panelId = panelId;
     this.typeId = typeId;
     this.attr = attr==null?new PropertyCollection():attr;
     this.rules = rules==null?new PropertyCollection():rules;
     value = null;
     errMsg = "";
 }
开发者ID:rjankovic,项目名称:deskmin,代码行数:13,代码来源:Field.cs


示例9: Panel

 // holder (if != null) in attr["holder"]
 public Panel(string tableName, int panelId, int typeId, string typeName, List<IPanel> children,
     List<IField> fields, List<IControl> controls, List<string> PKColNames, DataRow PK = null,
     PropertyCollection viewAttr = null, PropertyCollection controlAttr = null, IPanel parent = null)
 {
     this.tableName = tableName;
     this.viewAttr = viewAttr == null ? new PropertyCollection() : viewAttr;
     this.controlAttr = controlAttr==null?new PropertyCollection():controlAttr;
     this.panelId = panelId;
     this.children = children;
     this.fields = fields;
     this.controls = controls;
     this.PKColNames = PKColNames;
     this.PK = PK;
     this.typeId = typeId;
     this.typeName = typeName;
     this.parent = parent;
     if (this.controls == null) this.controls = new List<IControl>();
     if (this.fields == null) this.fields = new List<IField>();
     if (this.controlAttr == null) this.controlAttr = new PropertyCollection();
     if (this.viewAttr == null) this.viewAttr = new PropertyCollection();
     if (this.PKColNames == null) this.PKColNames = new List<string>();
 }
开发者ID:rjankovic,项目名称:deskmin,代码行数:23,代码来源:Panel.cs


示例10: DeserializeDataSetProperties

 private void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context)
 {
     this.dataSetName = info.GetString("DataSet.DataSetName");
     this.namespaceURI = info.GetString("DataSet.Namespace");
     this._datasetPrefix = info.GetString("DataSet.Prefix");
     this._caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
     int culture = (int) info.GetValue("DataSet.LocaleLCID", typeof(int));
     this._culture = new CultureInfo(culture);
     this._cultureUserSet = true;
     this.enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");
     this.extendedProperties = (PropertyCollection) info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:DataSet.cs


示例11: _PropsNotEmpty

 //Does the DS or ANY object in it have ExtendedProperties?
 private static bool _PropsNotEmpty(PropertyCollection props) {
     return props != null && props.Count != 0;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:xmlsaver.cs


示例12: setProperties

        /// <summary>
        /// Sets the properties specified in the configuration string
        /// </summary>
        /// <param name="props">Properties to set</param>
        /// <returns>False if properties were specified that are not know, otherwise true</returns>
        public override bool setProperties(PropertyCollection props)
        {
            if(props.Contains("shun"))
            {
                shun = Convert.ToBoolean(props["shun"]);
                props.Remove("shun");
            }
            if(props.Contains("print_local_addr"))
            {
                print_local_addr = Convert.ToBoolean(props["print_local_addr"]);
                props.Remove("print_local_addr");
            }
            if(props.Contains("join_timeout"))
            {
                join_timeout = Convert.ToInt64(props["join_timeout"]);
                props.Remove("join_timeout");
            }
            if(props.Contains("join_retry_timeout"))
            {
                join_retry_timeout = Convert.ToInt64(props["join_retry_timeout"]);
                props.Remove("join_retry_timeout");
            }
            if(props.Contains("leave_timeout")) // time to wait until coord responds to LEAVE req.
            {
                leave_timeout = Convert.ToInt64(props["leave_timeout"]);
                props.Remove("leave_timeout");
            }
            if(props.Contains("digest_timeout")) // time to wait for GET_DIGEST_OK from PBCAST
            {
                digest_timeout = Convert.ToInt64(props["digest_timeout"]);
                props.Remove("digest_timeout");
            }
            if(props.Contains("disable_initial_coord")) // time to wait for GET_DIGEST_OK from PBCAST
            {
                disable_initial_coord = Convert.ToBoolean(props["disable_initial_coord"]);
                props.Remove("disable_initial_coord");
            }

            if(props.Count > 0)
            {
                return false;
            }
            return true;
        }
开发者ID:curasystems,项目名称:externals,代码行数:49,代码来源:GMS.cs


示例13: setPropertiesInternal

        /// <summary>
        /// Removes and sets all generic properties of a Protocol, then passes remainder of properties on to implementation
        /// </summary>
        /// <param name="properties">Collection of properties</param>
        /// <returns>False if properties were specified that are not know, otherwise true</returns>
        public bool setPropertiesInternal(PropertyCollection properties)
        {
            this.props = properties;

            if(props.Contains("down_thread"))
            {
                down_thread = Convert.ToBoolean(props["down_thread"]);
                props.Remove("down_thread");
            }

            if(props.Contains("up_thread"))
            {
                up_thread = Convert.ToBoolean(props["up_thread"]);
                props.Remove("up_thread");
            }

            return setProperties(props);
        }
开发者ID:curasystems,项目名称:externals,代码行数:23,代码来源:Protocol.cs


示例14: BuildDynamicUpdateCommand

        public static NpgsqlCommand BuildDynamicUpdateCommand(tgDataRequest request, tgEntitySavePacket packet)
        {
            string where = String.Empty;
            string conncur = String.Empty;
            string scomma = String.Empty;
            string defaults = String.Empty;
            string defaultsComma = String.Empty;
            string and = String.Empty;

            string sql = "UPDATE " + CreateFullName(request) + " SET ";

            PropertyCollection props = new PropertyCollection();
            NpgsqlParameter p = null;

            Dictionary<string, NpgsqlParameter> types = Cache.GetParameters(request);

            NpgsqlCommand cmd = new NpgsqlCommand();
            if (request.CommandTimeout != null) cmd.CommandTimeout = request.CommandTimeout.Value;

            tgColumnMetadataCollection cols = request.Columns;
            foreach (tgColumnMetadata col in cols)
            {
                bool isModified = packet.ModifiedColumns == null ? false : packet.ModifiedColumns.Contains(col.Name);

                if (isModified && (!col.IsAutoIncrement && !col.IsConcurrency && !col.IsEntitySpacesConcurrency))
                {
                    p = cmd.Parameters.Add(CloneParameter(types[col.Name]));

                    object value = packet.CurrentValues[col.Name];
                    p.Value = value != null ? value : DBNull.Value;

                    sql += scomma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    scomma = ", ";
                }
                else if (col.IsAutoIncrement)
                {
                    // Nothing to do but leave this here
                }
                else if (col.IsConcurrency)
                {
                    p = CloneParameter(types[col.Name]);
                    p.SourceVersion = DataRowVersion.Original;
                    p.Direction = ParameterDirection.InputOutput;
                    cmd.Parameters.Add(p);

                    conncur += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                }
                else if (col.IsEntitySpacesConcurrency)
                {
                    p = CloneParameter(types[col.Name]);
                    p.Value = packet.OriginalValues[col.Name];
                    p.Direction = ParameterDirection.InputOutput;
                    cmd.Parameters.Add(p);

                    sql += scomma;
                    sql += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName + " + 1";

                    conncur += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;

                    defaults += defaultsComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    defaultsComma = ",";
                }
                else if (col.IsComputed)
                {
                    // Do nothing but leave this here
                }
                else if (cols.IsSpecialColumn(col))
                {
                    // Do nothing but leave this here
                }
                else if (col.HasDefault)
                {
                    // defaults += defaultsComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    // defaultsComma = ",";
                }

                if (col.IsInPrimaryKey)
                {
                    p = CloneParameter(types[col.Name]);
                    p.Value = packet.OriginalValues[col.Name];
                    cmd.Parameters.Add(p);

                    where += and + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    and = " AND ";
                }
            }

            #region Special Column Logic
            if (cols.DateModified != null && cols.DateModified.IsServerSide)
            {
                p = CloneParameter(types[cols.DateModified.ColumnName]);
                p.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(p);

                sql += scomma + Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose + " = " + request.ProviderMetadata["DateModified.ServerSideText"];
                scomma = ", ";

                defaults += defaultsComma + cols.DateModified.ColumnName;
                defaultsComma = ",";
            }
//.........这里部分代码省略.........
开发者ID:HoosierMike,项目名称:Tiraggo,代码行数:101,代码来源:Shared.cs


示例15: ShowBills

        /* METHODS */
        private double ShowBills(DateTime fromDay, DateTime toDay)
        {
            Dictionary<string, object> items = DataWorkBill.LoadRangeBills(fromDay, toDay, AppConfig.Path_Bills, AppConfig.APP_SubUnit);
            DataTable currentBill = new DataTable();
            PropertyCollection props = new PropertyCollection();
            Dictionary<string, object> billInfo = new Dictionary<string, object>();
            double generalSuma = 0.0;
            //this.billFileList.Clear();
            listGrid.Rows.Clear();
            foreach (KeyValuePair<string, object> billEntry in items)
            {
                currentBill = (DataTable)((object[])billEntry.Value)[0];
                props = (PropertyCollection)((object[])billEntry.Value)[1];
                billInfo = ((Dictionary<string, object>)props[CoreConst.BILL]);
                //this.billFileList.Add(billInfo[CoreConst.OID].ToString(), billEntry.Key);

                if (props[CoreConst.ORDER_NO] == null)
                    continue;

                listGrid.Rows.Add(
                    new object[] {
                            billInfo[CoreConst.OID],
                            billEntry.Key,
                            false,
                            billInfo[CoreConst.BILL_NO],
                            billInfo[CoreConst.DATETIME],
                            billInfo[CoreConst.COMMENT],
                            (double)props[mdcore.Common.CoreConst.ORDER_SUMA],
                            bool.Parse(billInfo[CoreConst.IS_LOCKED].ToString()),
                            props[CoreConst.ORDER_NO]
                        }
                );
                generalSuma += (double)props[mdcore.Common.CoreConst.ORDER_SUMA];
                /*if (props.ContainsKey(CoreConst.ORDER_NO) && props[CoreConst.ORDER_NO] != null && props[CoreConst.ORDER_NO].ToString() != string.Empty)
                {
                    Font extFont = listGrid.Font;
                    listGrid.Rows[listGrid.Rows.Count - 1].DefaultCellStyle.Font = new Font(extFont, FontStyle.Strikeout);
                }*/
            }

            this.label_orderInfo_General.Text = string.Format("Всього {0} запис(ів) на суму {1:0.00}{2}", listGrid.RowCount, generalSuma, "грн");

            return generalSuma;
        }
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:45,代码来源:uiWndBillManagercs.cs


示例16: BuildDynamicInsertCommand

        public static SqlCeCommand BuildDynamicInsertCommand(tgDataRequest request, tgEntitySavePacket packet)
        {
            string sql = String.Empty;
            string defaults = String.Empty;
            string into = String.Empty;
            string values = String.Empty;
            string comma = String.Empty;
            string defaultComma = String.Empty;
            string where = String.Empty;
            string whereComma = String.Empty;

            PropertyCollection props = new PropertyCollection();
            SqlCeParameter p = null;

            Dictionary<string, SqlCeParameter> types = Cache.GetParameters(request);

            SqlCeCommand cmd = new SqlCeCommand();
            if (request.CommandTimeout != null) cmd.CommandTimeout = request.CommandTimeout.Value;

            tgColumnMetadataCollection cols = request.Columns;
            foreach (tgColumnMetadata col in cols)
            {
                bool isModified = packet.ModifiedColumns == null ? false : packet.ModifiedColumns.Contains(col.Name);

                if (isModified && (!col.IsAutoIncrement && !col.IsConcurrency && !col.IsTiraggoConcurrency))
                {
                    p = cmd.Parameters.Add(CloneParameter(types[col.Name]));

                    into += comma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    values += comma + p.ParameterName;
                    comma = ", ";
                }
                else if (col.IsAutoIncrement)
                {
                    props["AutoInc"] = col.Name;
                    props["Source"] = request.ProviderMetadata.Source;
                }
                else if (col.IsConcurrency)
                {
                    props["Timestamp"] = col.Name;
                    props["Source"] = request.ProviderMetadata.Source;
                }
                else if (col.IsTiraggoConcurrency)
                {
                    props["EntitySpacesConcurrency"] = col.Name;

                    into += comma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    values += comma + "1";
                    comma = ", ";

                    p = CloneParameter(types[col.Name]);
                    p.Value = 1;
                    cmd.Parameters.Add(p);
                }
                else if (col.IsComputed)
                {
                    // Do nothing but leave this here
                }
                else if (cols.IsSpecialColumn(col))
                {
                    // Do nothing but leave this here
                }
                else if (col.HasDefault)
                {
                    into += comma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    values += comma + "DEFAULT";
                    comma = ",";

                    defaults += defaultComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    defaultComma = ",";
                }

                if (col.IsInPrimaryKey)
                {
                    where += whereComma + col.Name;
                    whereComma = ",";
                }
            }

            #region Special Columns
            if (cols.DateAdded != null && cols.DateAdded.IsServerSide)
            {
                into += comma + Delimiters.ColumnOpen + cols.DateAdded.ColumnName + Delimiters.ColumnClose;
                values += comma + request.ProviderMetadata["DateAdded.ServerSideText"];
                comma = ", ";

                defaults += defaultComma + Delimiters.ColumnOpen + cols.DateAdded.ColumnName + Delimiters.ColumnClose;
                defaultComma = ",";
            }

            if (cols.DateModified != null && cols.DateModified.IsServerSide)
            {
                into += comma + Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose;
                values += comma + request.ProviderMetadata["DateModified.ServerSideText"];
                comma = ", ";

                defaults += defaultComma + Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose;
                defaultComma = ",";
            }

//.........这里部分代码省略.........
开发者ID:BrewDawg,项目名称:Tiraggo,代码行数:101,代码来源:Shared.cs


示例17: DeserializeDataSetProperties

        //      DeSerialize dataset properties
        private void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context) {
            //DataSet basic properties
            dataSetName = info.GetString("DataSet.DataSetName");
            namespaceURI = info.GetString("DataSet.Namespace");
            _datasetPrefix = info.GetString("DataSet.Prefix");
            //DataSet runtime properties
            _caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
            int lcid = (int)info.GetValue("DataSet.LocaleLCID", typeof(int));
            _culture = new CultureInfo(lcid);
            _cultureUserSet = true;
            enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");



            //ExtendedProperties
            extendedProperties = (PropertyCollection)info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
        }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:18,代码来源:DataSet.cs


示例18: PanelFields

        private List<Field> PanelFields(int idPanel)
        {
            DataTable tbl = fetchAll("SELECT * FROM fields JOIN field_types USING(id_field) WHERE id_panel = ", idPanel);
            List<Field> res = new List<Field>();
            foreach(DataRow row in tbl.Rows){

                int typeId = (int) row["id_type"];
                int fieldId = (int)row["id_field"];

                PropertyCollection properties = new PropertyCollection();
                PropertyCollection rules = new PropertyCollection();
                PropertyCollection controlOptions = new PropertyCollection();
                DataTable propsTab = fetchAll("SELECT name, val, concerns FROM fields_meta WHERE id_field = ", fieldId);
                foreach(DataRow propRow in propsTab.Rows)
                    switch((string)propRow["concerns"]){
                        case "view":
                            properties.Add(propRow["name"], propRow["val"]);
                            break;
                        case "validation":
                            rules.Add(propRow["name"], propRow["val"]);
                            break;
                        case "controls":
                            controlOptions.Add(propRow["name"], propRow["val"]);
                            break;
                        default:
                            throw new Exception("Cannot handle metadata about " + propRow["concerns"].ToString() + " (yet).");
                    }

                properties.Add("caption", row["caption"] as string);

                string typeName = row["type_name"] as string;
                if(!controlOptions.ContainsKey("isFK") && !controlOptions.ContainsKey("isM2NMapping")){
                    res.Add(new Field(fieldId, (string)row["column_name"], typeId, (string)row["type_name"], idPanel, properties, rules));
                    continue;   // just a standard field
                }

                //  FK or M2NMapping
                string myTable = fetchSingle("SELECT table_name FORM panels WHERE id_panel = ", idPanel) as string;
                string myColumn = row["column_name"] as string;
                string refTable = controlOptions[CC.FIELD_REF_TABLE] as string;
                string refColumn = controlOptions[CC.FIELD_REF_COLUMN] as string;
                string displayColumn = controlOptions[CC.FIELD_DISPLAY_COLUMN] as string;

                if(controlOptions.ContainsKey("isFK")){     // foreign key
                    FKMySql fk = new FKMySql(myTable, myColumn, refTable, refColumn, displayColumn);
                    res.Add(new FKField(fieldId, myColumn, typeId, typeName, idPanel, fk, properties, rules));
                }

                //  M2NMapping
                string mapTable = controlOptions[CC.FIELD_MAP_TABLE] as string;
                string mapMyColumn = controlOptions[CC.FIELD_MAP_MY_COLUMN] as string;
                string mapRefColumn = controlOptions[CC.FIELD_REF_COLUMN] as string;

                M2NMappingMySql mapping = new M2NMappingMySql(myTable, myColumn, refTable, refColumn, mapTable, displayColumn, mapMyColumn, mapRefColumn);
                res.Add(new M2NMappingField(fieldId, myColumn, typeId, typeName, idPanel, mapping, properties, rules));
            }

            return res;
        }
开发者ID:rjankovic,项目名称:deskmin,代码行数:59,代码来源:SystemMySql.cs


示例19: BuildDynamicUpdateCommand

        public static SqlCeCommand BuildDynamicUpdateCommand(tgDataRequest request, tgEntitySavePacket packet)
        {
            string where = String.Empty;
            string scomma = String.Empty;
            string wcomma = String.Empty;
            string defaults = String.Empty;
            string defaultsWhere = String.Empty;
            string defaultsComma = String.Empty;
            string defaultsWhereComma = String.Empty;

            string sql = "UPDATE " + CreateFullName(request) + " SET ";

            PropertyCollection props = new PropertyCollection();
            SqlCeParameter p = null;

            Dictionary<string, SqlCeParameter> types = Cache.GetParameters(request);

            SqlCeCommand cmd = new SqlCeCommand();
            if (request.CommandTimeout != null) cmd.CommandTimeout = request.CommandTimeout.Value;

            tgColumnMetadataCollection cols = request.Columns;
            foreach (tgColumnMetadata col in cols)
            {
                bool isModified = packet.ModifiedColumns == null ? false : packet.ModifiedColumns.Contains(col.Name);

                if (isModified && (!col.IsAutoIncrement && !col.IsConcurrency && !col.IsTiraggoConcurrency))
                {
                    p = cmd.Parameters.Add(CloneParameter(types[col.Name]));

                    sql += scomma;
                    sql += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    scomma = ", ";
                }
                else if (col.IsAutoIncrement)
                {
                    // Nothing to do but leave this here
                }
                else if (col.IsConcurrency)
                {
                    p = CloneParameter(types[col.Name]);
                    p.SourceVersion = DataRowVersion.Original;
                    cmd.Parameters.Add(p);

                    where += wcomma;
                    where += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    wcomma = " AND ";
                }
                else if (col.IsTiraggoConcurrency)
                {
                    props["EntitySpacesConcurrency"] = col.Name;

                    p = CloneParameter(types[col.Name]);
                    p.SourceVersion = DataRowVersion.Original;
                    cmd.Parameters.Add(p);

                    sql += scomma;
                    sql += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " + 1";
                    scomma = ", ";

                    where += wcomma;
                    where += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    wcomma = " AND ";
                }
                else if (col.IsComputed)
                {
                    // Do nothing but leave this here
                }
                else if (cols.IsSpecialColumn(col))
                {
                    // Do nothing but leave this here
                }
                else if (col.HasDefault)
                {
                    // defaults += defaultsComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    // defaultsComma = ",";
                }

                if (col.IsInPrimaryKey)
                {
                    p = CloneParameter(types[col.Name]);
                    p.SourceVersion = DataRowVersion.Original;
                    cmd.Parameters.Add(p);

                    where += wcomma;
                    where += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    wcomma = " AND ";

                    defaultsWhere += defaultsWhereComma + col.Name;
                    defaultsWhereComma = ",";
                }
            }

            #region Special Columns
            if (cols.DateModified != null && cols.DateModified.IsServerSide)
            {
                sql += scomma;
                sql += Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose + " = " + request.ProviderMetadata["DateModified.ServerSideText"];
                scomma = ", ";

                defaults += defaultsComma + Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose;
//.........这里部分代码省略.........
开发者ID:BrewDawg,项目名称:Tiraggo,代码行数:101,代码来源:Shared.cs


示例20: _PropsNotEmpty

 private static bool _PropsNotEmpty(PropertyCollection props)
 {
     return ((props != null) && (props.Count != 0));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:XmlTreeGen.cs



注:本文中的System.Data.PropertyCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Data.Select类代码示例发布时间:2022-05-26
下一篇:
C# Data.Node类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap