本文整理汇总了C#中Epi.View.GetLastRecordId方法的典型用法代码示例。如果您正苦于以下问题:C# View.GetLastRecordId方法的具体用法?C# View.GetLastRecordId怎么用?C# View.GetLastRecordId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epi.View
的用法示例。
在下文中一共展示了View.GetLastRecordId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoImport
/// <summary>
/// Initiates a full import on a single form
/// </summary>
private void DoImport()
{
string importTypeDescription = "Records with matching ID fields will be updated and unmatched records will be appended.";
if (cmbImportType.SelectedIndex == 0)
{
update = true;
append = true;
}
else if (cmbImportType.SelectedIndex == 1)
{
update = true;
append = false;
importTypeDescription = "Records with matching ID fields will be updated. Unmatched records will be ignored.";
}
else
{
update = false;
append = true;
importTypeDescription = "Records with no matching ID fields will be appended. Records with matching ID fields will be ignored.";
}
if (cmbFormName.SelectedIndex >= 0)
{
lbxStatus.Items.Clear();
sourceView = sourceProject.Views[cmbFormName.SelectedItem.ToString()];
lastRecordId = sourceView.GetLastRecordId();
if (!CheckForProblems())
{
return;
}
textProgress.Text = string.Empty;
progressBar.Value = 0;
progressBar.Minimum = 0;
int recordCount = sourceView.GetRecordCount();
int gridRowCount = 0;
foreach (GridField gridField in sourceView.Fields.GridFields)
{
IDataReader reader = sourceProjectDataDriver.GetTableDataReader(gridField.TableName);
while (reader.Read())
{
gridRowCount++;
}
}
progressBar.Maximum = recordCount * (sourceView.Pages.Count + 1);
progressBar.Maximum = progressBar.Maximum + gridRowCount;
if (FormsAreAlike())
{
List<View> viewsToProcess = new List<View>();
foreach (View view in sourceProject.Views)
{
try
{
if (view.IsRelatedView && !string.IsNullOrEmpty(view.TableName) && sourceProjectDataDriver.TableExists(view.TableName) && destinationProject.Views.Contains(view.Name))
{
if (IsDescendant(view, sourceView) && !viewsToProcess.Contains(view))
{
viewsToProcess.Add(view);
progressBar.Maximum = progressBar.Maximum + (view.GetRecordCount() * (view.Pages.Count + 1));
int relatedGridRowCount = 0;
foreach (GridField relatedGridField in view.Fields.GridFields)
{
IDataReader relatedGridReader = sourceProjectDataDriver.GetTableDataReader(relatedGridField.TableName);
while (relatedGridReader.Read())
{
relatedGridRowCount++;
}
}
progressBar.Maximum = progressBar.Maximum + relatedGridRowCount;
}
}
}
catch (NullReferenceException)
{
continue;
}
}
progressBar.Visible = true;
stopwatch = new Stopwatch();
stopwatch.Start();
AddStatusMessage("Import initiated for form " + cmbFormName.SelectedItem.ToString() + ". " + importTypeDescription);
btnBrowse.Enabled = false;
btnCancel.Enabled = false;
btnOK.Enabled = false;
cmbFormName.Enabled = false;
cmbImportType.Enabled = false;
textProjectFile.Enabled = false;
//.........这里部分代码省略.........