public override DataGridResult <ToDoListElement> execute(DataGridInput input) { ToDoListRequest request = new ToDoListRequest(); request.UserInfo = NavigationHandler.UserInfo; request.PageSize = input.NumResForPage; request.RequestedPage = input.NumPage; request.IdGruppo = NavigationHandler.RuoloInfo.IdGruppo; request.Registri = NavigationHandler.Registri; if (!string.IsNullOrEmpty(input.IdParent)) { request.ParentFolderId = input.IdParent; } ToDoListResponse resp = WSStub.getTodoList(request); DataGridResult <ToDoListElement> res = new DataGridResult <ToDoListElement>(); res.NumTotResults = resp.TotalRecordCount; res.Elements = new List <ToDoListElement>(); foreach (ToDoListElement temp in resp.Elements) { res.Elements.Add(temp); } return(res); }
protected override void ExecuteParticular(MainModel model) { logger.Info("begin"); model.TabShow = Tab.TODO_LIST; ToDoListRequest request = new ToDoListRequest(); request.UserInfo = NavigationHandler.CurrentUser; if (NavigationHandler.DeleganteInfo != null) //Abbiamo una delega in esercizio { request.UserInfo.DelegatoInfo = NavigationHandler.LoggedInfo; } request.PageSize = ConfigurationHandler.NumResultsForPage; request.RequestedPage = _currentPage; request.IdGruppo = NavigationHandler.RuoloInfo.IdGruppo; request.IdCorrGlobali = NavigationHandler.RuoloInfo.Id; request.Registri = NavigationHandler.Registri; request.ParentFolderId = IdParent; request.FascId = IdFasc; ToDoListResponse resp = WSStub.getTodoList(request); logger.Info("responseCode: " + resp.Code); if (resp.Code == ToDoListResponseCode.OK) { ToDoListModel tabModel = new ToDoListModel(resp.TotalRecordCount, ConfigurationHandler.NumResultsForPage); tabModel.IdParent = IdParent; tabModel.NomeParent = NomeParent; tabModel.ToDoListElements = resp.Elements; if (resp.TotalRecordCount == 0) { tabModel.CurrentPage = 0; } else { tabModel.CurrentPage = _currentPage; } if (_numElements < 0 || IdParent == null) { _numElements = resp.TotalRecordCount; } if (_idTrasm != null) { foreach (ToDoListElement el in tabModel.ToDoListElements) { el.IdTrasm = _idTrasm; } } //Verifico se il pulsante visto è visibile bool setDataVista = ConfigurationHandler.IsVisibleButtonVisto; tabModel.SetDataVista = setDataVista; tabModel.NumElements = _numElements; model.TabModel = tabModel; NavigationHandler.ToDoListMemento = Memento; } else { logger.Info("add system error"); addSystemError(model); } logger.Info("end"); }
public ToDoListResponse getTodoList(ToDoListRequest request) { SetUserId(request.UserInfo); return(MobileManager.getNotify(request)); }