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


C# Business.Update方法代码示例

本文整理汇总了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;
        }
开发者ID:dlnuckolls,项目名称:glorykidd-public,代码行数:41,代码来源:ManagedItemLoad.aspx.cs

示例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;
			}
		}
开发者ID:jhogan,项目名称:qed,代码行数:22,代码来源:Main.cs


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