public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { AddColumns(); AddRows(); SetColumnWidth(); MyController.SubscribeForChangesToPeople(new Client.EmployeeData.PersonRowChangeEventHandler(Person_PersonRowChanged)); }
public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { ProductDS products = StoreController.GetCatalogProducts(); catalogGrid.DataSource = products; catalogGrid.DataMember = "product"; DataGridTableStyle style = new DataGridTableStyle(); style.ReadOnly = true; style.MappingName = "product"; PropertyDescriptorCollection descriptors = this.BindingContext[products, "product"].GetItemProperties(); DataGridColumnStyle productId = new DataGridTextBoxColumn(descriptors["ProductID"]); productId.MappingName = "ProductID"; productId.HeaderText = "Product ID"; productId.ReadOnly = true; style.GridColumnStyles.Add(productId); DataGridColumnStyle categoryID = new DataGridTextBoxColumn(descriptors["CategoryID"]); categoryID.MappingName = "CategoryID"; categoryID.HeaderText = "Category ID"; categoryID.ReadOnly = true; style.GridColumnStyles.Add(categoryID); DataGridColumnStyle modelNumber = new DataGridTextBoxColumn(descriptors["ModelNumber"]); modelNumber.MappingName = "ModelNumber"; modelNumber.HeaderText = "Model Number"; modelNumber.ReadOnly = true; style.GridColumnStyles.Add(modelNumber); DataGridColumnStyle modelName = new DataGridTextBoxColumn(descriptors["ModelName"]); modelName.MappingName = "ModelName"; modelName.HeaderText = "Model Name"; modelName.ReadOnly = true; style.GridColumnStyles.Add(modelName); DataGridColumnStyle unitCost = new DataGridTextBoxColumn(descriptors["UnitCost"], "c"); unitCost.MappingName = "UnitCost"; unitCost.HeaderText = "Unit Cost"; unitCost.ReadOnly = true; style.GridColumnStyles.Add(unitCost); DataGridColumnStyle description = new DataGridTextBoxColumn(descriptors["Description"]); description.MappingName = "Description"; description.HeaderText = "Description"; description.ReadOnly = true; style.GridColumnStyles.Add(description); catalogGrid.TableStyles.Add(style); }
/// <summary> /// This method is used an initialization by Controllers. /// It is passed Task Arguments, with which it can do anything. /// </summary> /// <param name="taskArguments">A holder for originating navgraph and taskid, and an object for other "stuff" that /// will be used by the controller to get state information from the previous nav graph</param> public override void EnterTask(TaskArgumentsHolder taskArguments) { base.EnterTask(taskArguments); if (null != taskArguments) { // Store the previous navgraph and task id into our State MyState.PreviousNavGraph = taskArguments.OriginatingNavGraphName; MyState.PreviousTaskID = taskArguments.OriginatingTaskID; } }
public override bool PreStartTask(INavigator navigator, string graphName, TaskArgumentsHolder holder) { ObservableCollection<string> processNames = new ObservableCollection<string>(); ////TODO: Need to come from config var setting = this.appModel.ShellConfiguration.ConfigurationSettings["ClaimReviewGraphs"]; if (setting != null) { processNames = (from v in setting.SettingParmeters.Where(c => c.QualifierName == "ReviewGraph") select v.QualifierValue).ToObservableCollection<string>(); } if (processNames.Count > 0) { string folio = string.Empty; this.args = (TaskInitiatedContollerArgs)holder.ControllerArguments; ITaskRow taskRow = this.args.TaskRow; folio = taskRow.Folio; this.taskServiceHelper.GetTaskDetailsByProcessName( folio, processNames, results => { if (results != null && results.Count > 0) { foreach (KeyValuePair<string, int> keyVal in results.ToObservableCollection()) { if (keyVal.Key == taskRow.ProcessName) { if (keyVal.Value > 1) { this.FinishGraph(navigator, args); break; } } else { if (keyVal.Value > 0) { this.FinishGraph(navigator, args); break; } } } } }, this.claimTaskInitialDueDateController.HandleError); } return true; }
public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { // subscribe to be notified for the changes that we are interested in MyController.SelectedPersonChanged += new Client.PersonController.PersonChangedHandler(MyController_SelectedPersonChanged); MyController.SubscribeForChangesToAddressInformation(new Client.EmployeeData.AddressRowChangeEventHandler(Address_AddressRowChanged)); MyController.SubscribeForChangesToPeople(new Client.EmployeeData.PersonRowChangeEventHandler(Person_PersonRowChanged)); MyController.SubscribeForChangesToPhoneInformation(new Client.EmployeeData.PhoneRowChangeEventHandler(Phone_PhoneRowChanged)); // monitor when the validating address events fires off so we can implement our own custom address validation this.WorkAddress.ValidatingAddress += new Client.AddressControl.ValidateAddressHandler(WorkAddress_ValidatingAddress); this.HomeAddress.ValidatingAddress += new Client.AddressControl.ValidateAddressHandler(HomeAddress_ValidatingAddress); }
/// <summary> /// This method is used an initialization by Controllers. /// It is passed Task Arguments, with which it can do anything. /// </summary> /// <param name="taskArguments">A holder for originating navgraph and taskid, and an object for other "stuff" that /// will be used by the controller to get state information from the previous nav graph</param> public override void EnterTask(TaskArgumentsHolder taskArguments) { base.EnterTask(taskArguments); if (taskArguments != null) { // Store the previous navgraph and task id into our State MyState.PreviousNavGraph = taskArguments.OriginatingNavGraphName; MyState.PreviousTaskID = taskArguments.OriginatingTaskID; // Push whatever state they passed into our State MyState["previousNavState"] = (string)taskArguments.TaskArguments; } }
public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { cartDS = StoreControllerHostedControl.GetCart(); cartDS.CartItems.RowChanging += new DataRowChangeEventHandler(OnRowChanged); cartDS.CartItems.RowDeleted += new DataRowChangeEventHandler(OnRowDeleted); DataView view = cartDS.CartItems.DefaultView; view.AllowNew = false; this.cartGrid.DataSource = cartDS; this.cartGrid.DataMember = "cart_details"; DataGridTableStyle tableStyle = new DataGridTableStyle(); tableStyle.MappingName = "cart_details"; PropertyDescriptorCollection descriptors = this.BindingContext[cartDS, "cart_details"].GetItemProperties(); DataGridColumnStyle quantity = new DataGridTextBoxColumn(descriptors["Quantity"]); quantity.MappingName = "Quantity"; quantity.ReadOnly = false; quantity.HeaderText = "Quantity"; tableStyle.GridColumnStyles.Add(quantity); DataGridColumnStyle productId = new DataGridTextBoxColumn(descriptors["ProductID"]); productId.MappingName = "ProductID"; productId.HeaderText = "Product ID"; productId.ReadOnly = true; tableStyle.GridColumnStyles.Add(productId); DataGridColumnStyle modelName = new DataGridTextBoxColumn(descriptors["ModelName"]); modelName.MappingName = "ModelName"; modelName.HeaderText = "Model Name"; modelName.ReadOnly = true; tableStyle.GridColumnStyles.Add(modelName); DataGridColumnStyle unitCost = new DataGridTextBoxColumn(descriptors["UnitCost"], "c"); unitCost.MappingName = "UnitCost"; unitCost.HeaderText = "Unit Cost"; unitCost.ReadOnly = true; tableStyle.GridColumnStyles.Add(unitCost); this.cartGrid.TableStyles.Add(tableStyle); checkoutButton.Enabled = ItemCount > 0; }
public override void OnStart(TaskArgumentsHolder holder) { ArgumentCheck.ArgumentNullCheck(holder, "holder"); ArgumentCheck.ArgumentNullCheck(holder.ControllerArguments, "holder.ControllerArguments"); this.holder = holder; if (holder.ControllerArguments != null) { this.args = (TaskInitiatedContollerArgs)holder.ControllerArguments; this.Model.IsBusy = true; TaskDetail taskDetails = this.args.TaskDetail; Dictionary<string, object> activityData = taskDetails.Data; if (!activityData.ContainsKey("ClaimTransactionHeaderID")) { throw new ArgumentException("activity data must contain ClaimTransactionHeaderID"); } this.claimTransactionHeaderID = Convert.ToInt64(activityData["ClaimTransactionHeaderID"]); } }
public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { Controller.State.StateChanged += new Microsoft.ApplicationBlocks.UIProcess.State.StateChangedEventHandler(State_StateChanged); Bind(); DataGridTableStyle tableStyle = new DataGridTableStyle(); tableStyle.MappingName = "cart_details"; PropertyDescriptorCollection descriptors = this.BindingContext[cartDS, "cart_details"].GetItemProperties(); DataGridColumnStyle quantity = new DataGridTextBoxColumn(descriptors["Quantity"]); quantity.MappingName = "Quantity"; quantity.ReadOnly = false; quantity.HeaderText = "Quantity"; tableStyle.GridColumnStyles.Add(quantity); DataGridColumnStyle productId = new DataGridTextBoxColumn(descriptors["ProductID"]); productId.MappingName = "ProductID"; productId.HeaderText = "Product ID"; productId.ReadOnly = true; tableStyle.GridColumnStyles.Add(productId); DataGridColumnStyle modelName = new DataGridTextBoxColumn(descriptors["ModelName"]); modelName.MappingName = "ModelName"; modelName.HeaderText = "Model Name"; modelName.ReadOnly = true; tableStyle.GridColumnStyles.Add(modelName); DataGridColumnStyle unitCost = new DataGridTextBoxColumn(descriptors["UnitCost"], "c"); unitCost.MappingName = "UnitCost"; unitCost.HeaderText = "Unit Cost"; unitCost.ReadOnly = true; tableStyle.GridColumnStyles.Add(unitCost); this.cartGrid.TableStyles.Add(tableStyle); checkoutButton.Enabled = ItemCount > 0; }
public override void Initialize(TaskArgumentsHolder args, ViewSettings settings) { //Demo use of custom attribute of View element in config file this.Text = settings.Navigator.GetAttribute("MainFormTitle", ""); }
private void StartGraph(GlobalSearchControllerArgs args, ClaimHeaderData claimHeaderData) { args.SetProperty("ClientReference", claimHeaderData.CustomReference01); args.SetProperty("OutsourceReference", claimHeaderData.CustomReference02); // For Search Tab Title args.SetProperty("ClaimTitle", claimHeaderData.ClaimTitle); args.SetProperty("ProductCode", this.claimModel.ProductCode); args.SetProperty("ClaimReference", claimHeaderData.ClaimReference); TaskArgumentsHolder argsHolder = new TaskArgumentsHolder(null, args); NavigationManager manager = this.Container.Resolve<NavigationManager>(); // Starting the search graph. manager.Start("DuplicateClaimSearchGraph", argsHolder); }
private void StartTask(TaskArgumentsHolder args) { ControllerBase firstController = ControllerFactory.Create(_startView.Name, this); firstController.EnterTask(null); CurrentState.CurrentView = _startView.Name; CurrentState.Save(); try { ViewManager.ActivateView(null, _startView.Name, this, args); } catch(System.Threading.ThreadAbortException) {} catch( Exception ex ) { throw new Exception(string.Format("ExceptionCantActivateView: {0} - {1}.", _startView.Name, ex.Message)); } }
/// <summary> /// Overloaded. Starts open navigation beginning with the first view. /// </summary> /// <param name="firstView">The name of the first view.</param> /// <param name="args">Additional navigation arguments.</param> public void StartTask(string firstView, TaskArgumentsHolder args) { SetState(CreateState()); string startViewName = null; if (!string.IsNullOrEmpty(CurrentState.CurrentView)) { startViewName = CurrentState.CurrentView; _startView = UIPConfiguration.Config.GetViewSettingsFromName(CurrentState.CurrentView); } else if (!string.IsNullOrEmpty(firstView)) { startViewName = firstView; _startView = UIPConfiguration.Config.GetViewSettingsFromName(firstView); } if (_startView == null) throw new Exception(string.Format("ExceptionViewConfigNotFound: {0}.", startViewName)); StartTask(args); }
/// <summary> /// Overloaded. Starts open navigation for the specified task identifier. /// </summary> /// <param name="taskId">The task identifier (a GUID associated with the task).</param> /// <param name="args">Additional navigation arguments.</param> public void StartTask(Guid taskId, TaskArgumentsHolder args) { SetState(GetState(taskId)); StartTask(string.Empty, args); }
/// <summary> /// Initializes the WebFormView. /// </summary> /// <param name="args">The initialization arguments.</param> /// <param name="settings">The settings for the view.</param> public virtual void Initialize(TaskArgumentsHolder args, ViewSettings settings) { }
public override void OnStart(TaskArgumentsHolder holder) { this._previewRegionHelper = new SearchPreviewRegionHelper(this.Navigator.ScopedRegionManager, "PreviewRegion"); SearchContext context = this.LoadSearchContext(holder.ControllerArguments as GlobalSearchControllerArgs); this.ClaimSearchModel.BuildSearchItems(this.Navigator.ScopedRegionManager); this._eventAggregator.GetEvent<DuplicateSearchEvent>().Publish(context); this.SetHeader(); }
/// <summary> /// Activates a specific view. /// </summary> /// <param name="previousView">The view actually displayed.</param> /// <param name="view">The name of the view to be displayed.</param> /// <param name="navigator">The navigator requesting the transition.</param> /// <param name="args">Not used in this implementation of ActivateView.</param> public void ActivateView(string previousView, string view, Navigator navigator, TaskArgumentsHolder args) { ActivateView(previousView, view, navigator); }