当前位置: 首页>>代码示例>>C#>>正文


C# IRecord.SetFieldValue方法代码示例

本文整理汇总了C#中IRecord.SetFieldValue方法的典型用法代码示例。如果您正苦于以下问题:C# IRecord.SetFieldValue方法的具体用法?C# IRecord.SetFieldValue怎么用?C# IRecord.SetFieldValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRecord的用法示例。


在下文中一共展示了IRecord.SetFieldValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUpdateRecord

        /// <summary>
        /// Called when the record is to be updated
        /// </summary>
        /// <param name="record">The record.</param>
        protected override void OnUpdateRecord(IRecord record)
        {
            int iOne = record.GetFieldValue<int>("One", 0);
            int iTwo = record.GetFieldValue<int>("Two", 0);
            int iThree = record.GetFieldValue<int>("Three", 0);

            record.SetFieldValue<int>("One + Two", iOne + iTwo);
            record.SetFieldValue<int>("One + Three", iOne + iThree);
        }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:13,代码来源:QualityFieldsRecordUpdater.cs

示例2: UpdateMaterialFields

 /// <summary>
 /// Updates the lookup.
 /// </summary>
 /// <param name="record">The record.</param>
 protected void UpdateMaterialFields(IRecord record)
 {
     string materialCode = record.GetFieldValue<string>("Material Code", null);
     if (!string.IsNullOrEmpty(materialCode))
     {
         string vendor = materialService.GetVendor(materialCode);
         record.SetFieldValue("Material Vendor", vendor);
     }
 }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:13,代码来源:MaterialRecordUpdater.cs

示例3: OnUpdateRecord

 /// <summary>
 /// Called when the record is to be updated
 /// </summary>
 /// <param name="record">The record.</param>
 protected override void OnUpdateRecord(IRecord record)
 {
     bool refresh = record.GetFieldValue<bool>("Refresh Material", false);
     if (refresh)
     {
         UpdateMaterialFields(record);
         record.SetFieldValue("Refresh Material", false);
     }
 }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:13,代码来源:MaterialRecordUpdater.cs

示例4: OnUpdateRecord

 /// <summary>
 /// Called when the record is to be updated
 /// </summary>
 /// <param name="record">The record.</param>
 protected override void OnUpdateRecord(IRecord record)
 {
     double source = record.GetFieldValue<double>(sourceField, 0);
     if (source > 0)
     {
         double log = System.Math.Log10(source);
         record.SetFieldValue<double>(logResultField, log);
     }
     else
     {
         TraceError("{0} - Unable to calculate ['{1}'] = Math.Log10({2})  ({2} = {3})", this, logResultField, sourceField, source);
     }
 }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:17,代码来源:LogFieldRecordUpdater.cs

示例5: OnUpdateNewRecord

        /// <summary>
        /// Called when the record is a new record.
        /// </summary>
        /// <param name="record">The record.</param>
        protected override void OnUpdateNewRecord(IRecord record)
        {
            string currentValue = record.GetFieldValue<string>("Shift", null);

            if (string.IsNullOrEmpty(currentValue))
            {
                DateTime utcSample = record.GetFieldValue<DateTime>("SampleDateTime", DateTime.UtcNow);
                TimeSpan time = utcSample.ToLocalTime().TimeOfDay;

                string shift = time >= MorningShift && time < EveningShift ? "Day" : "Night";
                record.SetFieldValue("Shift", shift);
            }
        }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:17,代码来源:DefaultShiftRecordUpdater.cs

示例6: UpdateWeightAndPercentage

        private static void UpdateWeightAndPercentage(IRecord record, string[] measurements, string weightFormat, string percentageFormat)
        {
            using (RecordAggregate aggregate = new RecordAggregate(record))
            {
                string[] weightFieldNames = ExpandFieldNames(weightFormat, measurements);

                double total = aggregate.SumValues(0, weightFieldNames);

                record.SetFieldValue(ExpandFieldName(weightFormat, "Total"), total);

                double runningTotal = 0;
                foreach (string measurement in measurements)
                {
                    string weightField = ExpandFieldName(weightFormat, measurement);
                    string percentageField = ExpandFieldName(percentageFormat, measurement);
                    double ratio = aggregate.GetRatio(weightField, total);
                    runningTotal += ratio;
                    record.SetFieldValue(percentageField, ratio*100);
                }

                record.SetFieldValue(ExpandFieldName(percentageFormat, "Total"), runningTotal);
            }
        }
开发者ID:JoePlant,项目名称:Ampla-Code-Items,代码行数:23,代码来源:SieveAnalysisRecordUpdater.cs


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