本文整理汇总了C#中Business.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Business.Update方法的具体用法?C# Business.Update怎么用?C# Business.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetComplexListValues
private List<string> SetComplexListValues(Business.ManagedItem managedItem, string complexListName, DataTable dtExcelData, DataRow row, bool firstRow)
{
List<string> errors = new List<string>();
Business.ComplexList complexList = managedItem.FindComplexList(complexListName) as Business.ComplexList;
if (complexList != null)
{
try
{
if (firstRow)
complexList.Clear();
Dictionary<string /*FieldName*/, string /*FieldValue*/> fieldValues = new Dictionary<string, string>();
foreach (DataColumn col in dtExcelData.Columns)
{
if (SkipColumn(col.ColumnName))
continue;
if (fieldValues.ContainsKey(col.ColumnName))
throw new Exception(string.Format("Field {0} is repeated", col.ColumnName));
fieldValues.Add(col.ColumnName, row[col.ColumnName].ToString());
}
complexList.Load(fieldValues);
}
catch (Exception ex)
{
errors.Add(string.Format("Load of complex list {0} threw exception: {1}.", complexList.Name, ex.Message));
}
}
else
{
errors.Add(string.Format("Unable to find complex list {0}.", complexListName));
}
if (errors.Count == 0)
managedItem.Update(false, Business.Retro.AuditType.Saved);
return errors;
}
示例2: SubmitTime
public void SubmitTime(Business.Time time, ref bool cancel){
/* This function is public because it is used by CurrentTimerManager */
string minutes = time.Minutes.ToString();
InputModal im = new InputModal("Submit this timing information", "Minutes", "Date", "Comment");
TextBox txtMin = (TextBox)im.AnswerTable["Minutes"];
TextBox txtDate = (TextBox)im.AnswerTable["Date"];
txtMin.Text = minutes;
txtDate.Text = DateTime.Now.ToString();
if (im.ShowDialog(this) == DialogResult.OK){
time.Minutes = Int32.Parse(txtMin.Text);
time.Date = DateTime.Parse(txtDate.Text);
time.User = Thread.CurrentPrincipal.Identity.Name;
time.Text =((TextBox)im.AnswerTable["Comment"]).Text;
if (time.IsValid)
time.Update();
else
MessageBox.Show(this, time.BrokenRules.ToString());
cancel = false;
}else{
cancel = true;
}
}