public CellTextID1(CellConstruct construct, SPList currentList) : base(construct) { if (rowHandler != null) { Cell idCell = rowHandler.FindCell("ID"); idCell.PropertyChangedEvent += idCell_PropertyChangedEvent; } _currentList = currentList; }
public ListSettings(SPList list,MainPage page) { InitializeComponent(); _list = list; _listNameOld = list.Title; _listDescriptionOld = list.Description; this.DataContext = _list; _helper = new ListHelper(page); _page = page; _helper.UpdateListComplete += handler_ListUpdated; rdoQuickLaunchNo.IsEnabled = false; rdoQuickLaunchYes.IsEnabled = false; }
public void BatchUpdate(Dictionary<int, RowHandler> updates, SPList list) { List<bCheckV2.Helpers.Definitions.TaskItem> tasks = new List<bCheckV2.Helpers.Definitions.TaskItem>(); updates.ToList().ForEach(row => { var rowData = row.Value.Data; bCheckV2.Helpers.Definitions.TaskItem task = new bCheckV2.Helpers.Definitions.TaskItem(); task.ID1 = rowData["ID1"].ToString(); task.AlertTime = rowData["AlertTime"].ToString(); task.DueTime = rowData["DueTime"].ToString(); task.EscalationLevel1Time = rowData["EscalationLevel1Time"].ToString(); task.AssetCategoryID = (DataHandler.Current.StaticData["AssetCategories"]).Where(ac => ac.Value == rowData["AssetCategoryID"].ToString()).First().Key; task.BusinessAreaID = (DataHandler.Current.StaticData["BusinessAreas"]).Where(ba => ba.Value == rowData["BusinessAreaID"].ToString()).First().Key; task.Comments = (String)rowData["Comments"]; task.Description = (String)rowData["Description"]; task.FrequencyID = (DataHandler.Current.StaticData["Frequencies"]).Where(freq => freq.Value == rowData["FrequencyID"].ToString()).First().Key; task.FunctionalID = (DataHandler.Current.StaticData["Functionals"]).Where(func => func.Value == rowData["FunctionalID"].ToString()).First().Key; task.HolidayCalendar = Boolean.Parse(rowData["HolidayCalendar"].ToString()); task.KeyControl = Boolean.Parse(rowData["KeyControl"].ToString()); task.LinkToProcess = rowData["LinkToProcess"] == null ? null : rowData["LinkToProcess"].ToString(); task.LocationID = (DataHandler.Current.StaticData["Locations"]).Where(ac => ac.Value == rowData["LocationID"].ToString()).First().Key; task.ManagerSelfApproval = Boolean.Parse(rowData["ManagerSelfApproval"].ToString()); task.BypassManagerApproval = Boolean.Parse(rowData["BypassManagerApproval"].ToString()); task.RandomFrequencyID = (DataHandler.Current.StaticData["RandomFrequencies"]).Where(ac => ac.Value == rowData["RandomFrequencyID"].ToString()).First().Key; task.SpecificFrequencyID = (DataHandler.Current.StaticData["SpecificFrequencies"]).Where(ac => ac.Value == rowData["SpecificFrequencyID"].ToString()).First().Key; task.TaskName = rowData["TaskName"].ToString(); task.MandatoryLink = Boolean.Parse(rowData["MandatoryLink"].ToString()); task.Assignees = (List<bCheckV2.Helpers.Definitions.User>)rowData["Assignees"]; task.Managers = (List<bCheckV2.Helpers.Definitions.User>)rowData["Managers"]; tasks.Add(task); }); ChecklistAdminAgent = new ChecklistAdminServiceAgent(); ChecklistAdminAgent.UpdateTaskDefintions(tasks, reply => { }); //XElement batchNode = BuildBatchStringWebService(list, updates); //_service.UpdateListItemsAsync(list.ListName, batchNode); }
SPList InitializeList(XElement x) { SPList list = new SPList(); list.Id = x.Attribute("ID").Value; list.ListName = x.Attribute("Title").Value; list.Title = x.Attribute("Title").Value; list.Hidden = x.Attribute("Hidden").Value == "True"; list.Description = x.Attribute("Description").Value; list.QuickLaunch = Navigation.Yes; list.BaseType = (SPList.BaseTypes)Convert.ToInt32(x.Attribute("BaseType").Value); return list; }
public void GetListData(SPList list) { _currentList = list; _dataReady = false; _schemaReady = false; _isListDataRetrieved = false; ExcelColumns = new Dictionary<string, ExcelColumn>(); Rows = new List<Dictionary<string, object>>(); InitilizeColumns(); ChecklistAdminServiceAgent checklistagent = new ChecklistAdminServiceAgent(); checklistagent.GetChecklistTaskDefinitions("5", items => { taskDefinitions = items; items.ForEach(item => { Dictionary<string, object> row = new Dictionary<string, object>(); foreach (string key in ExcelColumns.Keys) { var property = item.GetType().GetProperty(key); if (property != null) { String PropertyColumnType = ((ColumnTypeAttribute)Attribute.GetCustomAttribute(property, typeof(ColumnTypeAttribute))).ColumnType.ToString(); var value = item.GetType().GetProperty(key).GetValue(item, null); if (PropertyColumnType == "Choice" && value != null) { String choiceGroup = ((ColumnTypeAttribute)Attribute.GetCustomAttribute(property, typeof(ColumnTypeAttribute))).ChoiceGroupName.ToString(); row.Add(ExcelColumns[key].PropertyBind, StaticData[choiceGroup][int.Parse(value.ToString())]); } else { row.Add(ExcelColumns[key].PropertyBind, value); } } } Rows.Add(row); }); ListDataRetrieved(this, new EventArgs()); }); }
public void DeleteList(SPList list) { _listHelper.DeleteList(list); }
static XElement BuildBatchStringWebService(SPList list, Dictionary<int, RowHandler> rowHandler) { var sb = new StringBuilder(); const string batchFragmentBegin = "<Batch OnError='Continue' ListVersion='1' ViewName=''>"; const string batchFragmentEnd = "</Batch>"; const string tagMethodOpen = "<Method ID='{0}' Cmd='{1}'>"; const string tagMethodClose = "</Method>"; const string tagField = "<Field Name='{0}'>{1}</Field>"; const string id = "ID"; sb.AppendLine(batchFragmentBegin); foreach (int handleKey in rowHandler.Keys) { RowHandler handler = rowHandler[handleKey]; string method = string.Format(tagMethodOpen, handleKey, handler.rowUpdate.UpdateType.ToString()); sb.AppendLine(method); sb.AppendLine(string.Format(tagField, id, handler.Data[id])); foreach (string key in handler.rowUpdate.UpdateValues.Keys) { string field = string.Format(tagField, key, HtmlEncode(handler.rowUpdate.UpdateValues[key])); sb.AppendLine(field); } sb.AppendLine(tagMethodClose); } sb.AppendLine(batchFragmentEnd); return XElement.Parse(sb.ToString()); }
public void DeleteList(SPList list) { Dictionary<string, object> userState = new Dictionary<string, object>(); userState.Add("Source", Constants.Delete); userState.Add("List", list); userState.Add("ConfigList", "bcheck"); GetListItemDetails(userState); }
void UpdateList(SPList list) { string quickLaunch = (list.QuickLaunch == Navigation.Yes) ? "True" : "False"; string listProperties = string.Format("<List ID='{0}' Title='{1}' Description='{2}' OnQuickLaunch='{3}'/>", list.Id, HtmlEncode(list.Title), HtmlEncode(list.Description), quickLaunch); XElement Node = XElement.Parse(listProperties); _service.UpdateListAsync(list.Id, Node, null, null, null, null, ""); }
public void UpdateListProperties( SPList list,string ListNameOld) { Dictionary<string, object> userState = new Dictionary<string, object>(); userState.Add("Source", Constants.Update); userState.Add("List", list); userState.Add("ConfigList", Constants.ConfigListBCheck); userState.Add("ConfigListItem", ListNameOld); GetListItemDetails(userState); }
public void SetupList(SPList list) { if (!_currentlyLoading) { _currentlyLoading = true; sbMenuHide.Begin(); IS[Constants.ISListName] = list.ListName; txtGridName.Text = list.ListName + " ▼"; txtTextLine.IsReadOnly = true; _excelGrid.ShowSplash(); _excelGrid.ClearGrid(); _handler.GetListData(list); } }
void settings_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (CurrentList != null) MessageDialog.ShowMessage("Please close list to perform List Settings Option."); else { ListItemControl lst = (ListItemControl)((Grid)(((StackPanel)((Image)sender).Parent).Parent)).Parent; DropDownSelectedList = lst.List; ListOldName = DropDownSelectedList.ListName; string ListAsmx = Constants.InitParams.ListAsmx(this); string ListOrgAsmx = Constants.InitParams.ListOrgAsmx(this); string PeopleAsmx = Constants.InitParams.PeopleAsmx(this); string custompermissionsasmx = Constants.InitParams.CustomPermissionsAsmx(this); string siteURL = Constants.InitParams.ListURL(this); string siteRootURL = Constants.InitParams.SiteRootURL(this); ListSettingsDialog listSettingsDialog = new ListSettingsDialog(ListAsmx, ListOrgAsmx, PeopleAsmx, custompermissionsasmx, DropDownSelectedList, siteURL, siteRootURL, _sLog, BusinessUnits); listSettingsDialog.Show(); } e.Handled = true; }
public void ListUpdatedSubscription(SPList ChangedDropDownList) { _handler.GetSiteLists(); }