Ejemplo n.º 1
0
        /// <summary>
        ///     Entry point
        /// </summary>
        public void BeginBuild(object sender, EventArgs args)
        {
            ShellViewService.Current.RebuildRequested -= new EventHandler(BeginBuild);
            try
            {
                Step     = "Intilialize Database ...";
                StepType = true;

                if (!BuildDBController.HasInitialized())
                {
                    BuildDBController.BuildCache();
                }

                IEnumerable <Product> productlist = ProductController.GetAllProduct();

                if (productlist.Count() > 0)
                {
                    Step     = "Clear Cached funds ...";
                    StepType = true;
                    FundController.ClearFundData();

                    serviceadapter.Start();
                }

                Tasks = (from a in productlist.Where(t => t.Code == ProductCode.IP)
                         select new Task
                {
                    product = a,
                    TaskDescription = String.Concat("Retrieving Funds List for Product ", a.Name, " ...")
                }).ToObservableCollection();


                Task task = Tasks[0];
                ProcessTask(task);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }