本文整理汇总了C#中Record.SetFieldValue方法的典型用法代码示例。如果您正苦于以下问题:C# Record.SetFieldValue方法的具体用法?C# Record.SetFieldValue怎么用?C# Record.SetFieldValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record.SetFieldValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessProperty
static void ProcessProperty(string Name)
{
TrimApplication.Initialize();
using (Database db = new Database())
{
db.Id = "10";
//db.WorkgroupServerName = "https://SCDB98:9443";
db.Connect();
//Console.WriteLine("DB test: " + db.CurrentUser.Name);
//
JsonSerializer s = new JsonSerializer();
try
{
T1Property t1 = null;
using (StreamReader sr = new StreamReader(Name))
{
using (JsonTextReader reader = new JsonTextReader(sr))
{
//T1Integration t1 = new T1Integration();
t1 = (T1Property)s.Deserialize(reader, typeof(T1Property));
}
}
if (t1 != null)
{
FieldDefinition fdPropertyAddress = new FieldDefinition(db, 502);
if (t1.EddieUri == 0)
{
RecordType rt = new RecordType(db, 1);
Record rec = new Record(rt);
FieldDefinition fdPropertyNo = new FieldDefinition(db, 504);
rec.Title = "Property folder - " + t1.PropertyNumber.ToString();
rec.SetFieldValue(fdPropertyNo, new UserFieldValue(t1.PropertyNumber));
rec.SetFieldValue(fdPropertyAddress, new UserFieldValue(t1.PropertyAddress));
Classification c = new Classification(db, 2616);
rec.Classification = c;
Location loc = new Location(db, 43);
rec.SetAssignee(loc);
//rec.assig
rec.Save();
t1.EddieUri = rec.Uri;
t1.EddieRecordUrl = rec.WebURL;
Console.WriteLine("New property record created ok - number: " + rec.Number);
}
else
{
//RecordType rt = new RecordType(db, 2);
Record rec = new Record(db, t1.EddieUri);
//Record cont = new Record(db, t1.lEddieUri);
//rec.Container = cont;
//rec.Title = "Application - " + t1.ApplicationNo;
//if (t1.propertyLoc != null)
//{
// rec.SetDocument(t1.propertyLoc);
//}
rec.SetFieldValue(fdPropertyAddress, new UserFieldValue(t1.PropertyAddress));
rec.Save();
//t1.EddieUri = rec.Uri;
t1.EddieRecordUrl = rec.WebURL;
Console.WriteLine("Property record upgrades - number: " + rec.Number);
}
using (StreamWriter sw = new StreamWriter(pathout + "T1 property - "+t1.PropertyNumber.ToString()+".txt"))
{
using (JsonWriter writer = new JsonTextWriter(sw))
{
s.Serialize(writer, t1);
Console.WriteLine("Property file returned");
}
};
FileInfo f = new FileInfo(Name);
if (f.Exists)
f.Delete();
}
}
catch (Exception exp)
{
Console.WriteLine("Error: " + exp.Message.ToString());
throw;
}
}
}