private void populateItemInfo(SPDGList list, ISPDGListItemInfo item, bool isDocLib) { List <string> userFields = new List <string>(); foreach (var field in list.Fields) { if (ColumnsAndViewsGenerationTask.AvailableFieldInfos.Any(x => x.DisplayName == field.Title)) { userFields.Add(field.InternalName); } } string title = getFieldValue("First Name") + " " + getFieldValue("Last Name"); if (!_titleUsage.ContainsKey(title)) { _titleUsage[title] = 0; } _titleUsage[title]++; if (_titleUsage[title] != 1) { title += " No. " + _titleUsage[title]; } item["Title"] = title; foreach (string fieldName in userFields) { object value = getFieldValue(fieldName); if (value != null) { item[fieldName] = value; } } }
private void populateTask(ISPDGListItemInfo item) { string title = SampleData.GetSampleValueRandom(SampleData.Accounts) + " Task"; item["Title"] = title; item["Status"] = "In Progress"; item["DueDate"] = SampleData.GetRandomDate(2013, 2015); item["Priority"] = "(2) Normal"; item["PercentComplete"] = SampleData.GetRandomNumber(1, 100) / 100; }
private void populateEvent(ISPDGListItemInfo item) { string title = SampleData.GetSampleValueRandom(SampleData.Accounts) + " Event"; item["Title"] = title; DateTime time = SampleData.GetRandomDateCurrentMonth(); item["EventDate"] = time; item["EndDate"] = time; item["Location"] = SampleData.GetSampleValueRandom(SampleData.Cities); }
private void populateItemInfo(SPDGList list, ISPDGListItemInfo item, bool isDocLib ) { List<string> userFields = new List<string>(); foreach(var field in list.Fields) { if( _availableFieldInfos.Any(x=>x.DisplayName==field.Title)) { userFields.Add(field.InternalName); } } string title = getFieldValue("First Name") + " " + getFieldValue("Last Name"); if (!titleUsage.ContainsKey(title)) { titleUsage[title] = 0; } titleUsage[title]++; if (titleUsage[title] != 1) { title += " No. " + titleUsage[title]; } item["Title"] = title; foreach( string fieldName in userFields ) { object value = getFieldValue(fieldName); if( value != null ) { item[fieldName] = value; } } }