Exemplo n.º 1
0
        private void LoadApplications(string appList)
        {
            List <string> selectedPackages = new List <string>();

            string[] valArray = appList.Split(SettingsManager.DEFAULT_SPLIT_SEPARATOR);

            foreach (string item in valArray)
            {
                selectedPackages.Add(item);
            }

            m_applications.Clear();

            IList <ApplicationInfo> applications = base.PackageManager.GetInstalledApplications(global::Android.Content.PM.PackageInfoFlags.MetaData);

            foreach (ApplicationInfo app in applications)
            {
                ApplicationItem item = new ApplicationItem(this, app);

                item.Selected = selectedPackages.Contains(app.PackageName);

                try
                {
                    item.Icon = app.LoadIcon(PackageManager);
                }
                catch (System.Exception e)
                {
                    LogsManager.Instance.Error(e);
                }

                m_applications.Add(item);
            }

            m_applications.Sort((a, b) => a.Title.CompareTo(b.Title));
        }
Exemplo n.º 2
0
        private void ShowHideControls(ApplicationItem item)
        {
            this.progressBar1.Value = 0;
            this.progressBar1.Equals(0);
            this.progressBar1.Visible = false;

            if (item == ApplicationItem.Tools)
            {
                this.panelCleanerComponents.Visible = false;
                this.ucCleaner1.Visible             = false;
                this.panelActionButtons.Visible     = true;
            }
            else if (item == ApplicationItem.Registry)
            {
                this.panelCleanerComponents.Visible = true;
                this.ucCleaner1.Visible             = false;
                this.panelActionButtons.Visible     = true;
            }
            else if (item == ApplicationItem.Options)
            {
                this.panelCleanerComponents.Visible = false;
                this.ucCleaner1.Visible             = false;
                this.panelActionButtons.Visible     = true;
            }
            else
            {
                this.panelCleanerComponents.Visible = true;
                this.ucCleaner1.Visible             = true;
                this.panelActionButtons.Visible     = true;
            }
        }
        public Stream UpdateApplicationItem(ApplicationItem applicationItemForm)
        {
            BaseBusinessService <ApplicationItem> businessService = (BaseBusinessService <ApplicationItem>)BusinessFactory.Create(Keywords.UpdateApplicationItem);
            OperationResult result = businessService.Update(applicationItemForm);

            return(result.ToJsonStream());
        }
Exemplo n.º 4
0
        private void LoadApplications(List <string> selectedPackages)
        {
            m_applications.Clear();

            IList <ApplicationInfo> applications = PackageManager.GetInstalledApplications(Android.Content.PM.PackageInfoFlags.MetaData);

            foreach (ApplicationInfo app in applications)
            {
                ApplicationItem item = new ApplicationItem(this, app);
                item.Selected = selectedPackages.Contains(app.PackageName);

                try
                {
                    item.Icon = app.LoadIcon(PackageManager);
                }
                catch (System.Exception e)
                {
                    LogsManager.Instance.Error(e);
                }

                m_applications.Add(item);
            }

            m_applications.Sort((a, b) => a.Title.CompareTo(b.Title));
        }
Exemplo n.º 5
0
 public void LaunchApplication(System.Security.Principal.WindowsIdentity user, string host, RedirectionApplication redirectApp)
 {
     try
     {
         ApplicationItem appInfo = _service.GetApplicationInfo(redirectApp.InternalName, _service.GetUser(user), host, "", null, null, null, redirectApp.FarmName);
         if (!string.IsNullOrEmpty(appInfo.ContentAddress))
         {
             String address = appInfo.ContentAddress;
             if (address != null)
             {
                 this.Page.Response.Redirect(address);
             }
         }
         else
         {
             string app = _service.LaunchApplication(redirectApp.InternalName, _service.GetUser(user), host, "", redirectApp.FarmName);
             this.Page.Response.Clear();
             this.Page.Response.ClearContent();
             this.Page.Response.ClearHeaders();
             this.Page.Response.ContentType = "application/x-ica";
             this.Page.Response.AddHeader("Content-Type", "application/x-ica");
             this.Page.Response.BinaryWrite(this.Page.Response.ContentEncoding.GetBytes(app));
             this.Page.Response.End();
         }
     }
     catch (ThreadAbortException)
     {
         //Do nothing
     }
     catch (Exception ex)
     {
         SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Extentrix", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
         PageLogger.Error("An error occured during launch application", ex);
     }
 }
Exemplo n.º 6
0
        public IActionResult NewAuction(NewAuctionViewModel model)
        {
            if (ModelState.IsValid)
            {
                var CurrentUserId  = _userManager.GetUserId(User);
                var CurrentUserOjb = _userManager.Users.Where(user => user.Id == CurrentUserId).SingleOrDefault();
                var item           = new ApplicationItem {
                    ItemName    = model.ItemName,
                    ItemDetails = model.ItemDetails,
                    StartingBid = model.StartingBid,
                    EndDate     = model.EndDate,
                    CreatedBy   = CurrentUserOjb
                };
                _context.ApplicationItem.Add(item);
                var newAuction = new ApplicationAuction {
                    ItemForBid      = item,
                    ApplicationUser = CurrentUserOjb,
                    HighestBidder   = CurrentUserId,
                    HightestBidInt  = model.StartingBid
                };
                _context.ApplicationAuction.Add(newAuction);
                _context.SaveChanges();
                return(Redirect("/"));
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 7
0
        public FrmMain()
        {
            InitializeComponent();

            FilesFound = new List <ResultDetail>();

            //this.panelCleanerComponents.Controls.Add(new UCCleaner());
            this.labelClientInfo.Text = ApplicationSettings.SystemInformation;

            this.panelCleanerComponents.HorizontalScroll.Maximum = 0;
            this.panelCleanerComponents.AutoScroll             = false;
            this.panelCleanerComponents.VerticalScroll.Visible = false;
            this.panelCleanerComponents.AutoScroll             = true;

            this.progressBar1.Width = this.panelProgress.Width - 100;

            this.backgroundWorkerSearch.WorkerReportsProgress      = true;
            this.backgroundWorkerSearch.WorkerSupportsCancellation = true;

            SelectedItem = ApplicationItem.Cleaner;

            this.ucResult.Visible = false;

            try
            {
                IsSubValid           = OptionsAdvanceSetting.IsSubscriptionValid(this);
                IsSubscriptionExists = true;
            }
            catch (Exception ex)
            {
                OptionsAdvanceSetting.StartTrialPeriod();
            }
        }
        // Creates a Dictionary of DGS Applications, using the server name as the key
        private static ApplicationCollection CreateApplicationItemList()
        {
            ApplicationCollection itemDic = new ApplicationCollection();

            // Get the Server Inventory as a ListItemCollection
            ListItemCollection list = GetApplicationListItems();

            // Itterate through each item in the list
            foreach (ListItem lItem in list)
            {
                try
                {
                    ApplicationItem app = new ApplicationItem(lItem["Title"].ToString());

                    // Set the simple text fields
                    app.SupportContact  = lItem[_supportContactField] != null ? (string)lItem[_supportContactField] : "";
                    app.SupportGroup    = lItem[_supportGroupField] != null ? (string)lItem[_supportGroupField] : "";
                    app.Status          = lItem[_statusField] != null ? (string)lItem[_statusField] : "";
                    app.ApplicationType = lItem[_applicationTypeField] != null ? (string)lItem[_applicationTypeField] : "";
                    app.Description     = lItem[_descriptionField] != null ? (string)lItem[_descriptionField] : "";

                    // Add server to the Dictionary
                    if (!itemDic.ContainsKey(app.ApplicationName))
                    {
                        itemDic.Add(app);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }

            return(itemDic);
        }
Exemplo n.º 9
0
        private void buttonTools_Click(object sender, EventArgs e)
        {
            this.panelProgress.Visible = false;

            buttonTools.BackColor    = ApplicationSettings.SelectedButtonColor;
            buttonCleaner.BackColor  = ApplicationSettings.NormalButtonColor;
            buttonRegistry.BackColor = ApplicationSettings.NormalButtonColor;
            buttonOptions.BackColor  = ApplicationSettings.NormalButtonColor;


            if (panelCleanerComponents.Controls.Find("Registry", false).Count() > 0)
            {
                UCRegistry registry = panelCleanerComponents.Controls.Find("Registry", false)[0] as UCRegistry;
                registry.Hide();
            }


            if (panelCleanerComponents.Controls.Find("ucCleaner1", false).Count() > 0)
            {
                UCCleaner registry = panelCleanerComponents.Controls.Find("ucCleaner1", false)[0] as UCCleaner;
                registry.Hide();
            }

            if (gboxResult.Controls.Find("Options", false).Count() > 0)
            {
                UCOptions result = this.gboxResult.Controls.Find("Options", true)[0] as UCOptions;
                result.Visible = false;
            }

            if (gboxResult.Controls.Find("Tools", false).Count() > 0)
            {
                foreach (Control ctrl in this.gboxResult.Controls)
                {
                    ctrl.Visible = false;
                }
                UCTools registry = gboxResult.Controls.Find("Tools", false)[0] as UCTools;
                registry.Visible = true;
            }
            else
            {
                UCTools tools = new UCTools();
                tools.Name = "Tools";
                tools.Dock = DockStyle.Fill;
                foreach (Control ctrl in this.gboxResult.Controls)
                {
                    ctrl.Visible = false;
                }
                this.gboxResult.Controls.Add(tools);

                Task.Delay(500);
                Task.Factory.StartNew(() => tools.LoadPrograms());
            }

            ShowHideControls(ApplicationItem.Tools);

            SelectedItem = ApplicationItem.Tools;

            this.panelActionButtons.Hide();
        }
Exemplo n.º 10
0
        public IApplicationItem NewApplicationItem(string path)
        {
            // We attempt to create the Application item, but return a NullApplicationItem
            // instead of null if MaybeCreateFromDesktopItem fails.
            IApplicationItem maybe = ApplicationItem.MaybeCreateFromDesktopItem(path);

            return(maybe ?? new NullApplicationItem(path));
        }
Exemplo n.º 11
0
        public override BUSApplicationItem UIToBusiness(UIApplicationItem UIEntity, TContext context, IViewInfo viewInfo, bool isNewRecord)
        {
            BUSApplicationItem businessEntity = base.UIToBusiness(UIEntity, context, viewInfo, isNewRecord);
            Application        application    = context.Applications
                                                .AsNoTracking()
                                                .Select(app => new
            {
                id    = app.Id,
                name  = app.Name,
                items = app.ApplicationItems.Select(item => new
                {
                    id   = item.Id,
                    name = item.Name
                })
            })
                                                .Select(app => new Application
            {
                Id               = app.id,
                Name             = app.name,
                ApplicationItems = app.items.Select(item => new ApplicationItem
                {
                    Id   = item.id,
                    Name = item.name
                }).ToList()
            })
                                                .FirstOrDefault(i => i.Id.ToString() == ComponentsRecordsInfo.GetSelectedRecord("Application"));

            if (application == null)
            {
                businessEntity.ErrorMessage = "First you need create application.";
            }
            else
            {
                // Если запись новая и она не уникальна, записывается ошибка
                ApplicationItem applicationItem = application?.ApplicationItems.FirstOrDefault(n => n.Name == UIEntity.Name);
                if (applicationItem != null && applicationItem.Id != UIEntity.Id)
                {
                    businessEntity.ErrorMessage = $"Application item with this name is already exists in application {application.Name}";
                }

                else
                {
                    businessEntity.Application   = application;
                    businessEntity.ApplicationId = application.Id;

                    // Экран
                    Screen screen = context.Screens.AsNoTracking().FirstOrDefault(n => n.Name == UIEntity.ScreenName);
                    if (screen != null)
                    {
                        businessEntity.Screen     = screen;
                        businessEntity.ScreenId   = screen.Id;
                        businessEntity.ScreenName = screen.Name;
                    }
                }
            }
            return(businessEntity);
        }
Exemplo n.º 12
0
        public void AddChild(ApplicationItem item)
        {
            if (this.children == null)
            {
                this.children = new List <ApplicationItem>();
            }

            this.children.Add(item);
        }
Exemplo n.º 13
0
        public override ApplicationItem BusinessToData(ApplicationItem applicationItem, BUSApplicationItem businessEntity, TContext context, bool NewRecord)
        {
            ApplicationItem dataEntity = base.BusinessToData(applicationItem, businessEntity, context, NewRecord);

            dataEntity.Application   = businessEntity.Application;
            dataEntity.ApplicationId = businessEntity.ApplicationId;
            dataEntity.Screen        = businessEntity.Screen;
            dataEntity.ScreenId      = businessEntity.ScreenId;
            return(dataEntity);
        }
Exemplo n.º 14
0
        private void buttonCleaner_Click(object sender, EventArgs e)
        {
            panelActionButtons.Show();
            this.panelProgress.Visible = true;
            buttonCleaner.BackColor    = ApplicationSettings.SelectedButtonColor;
            buttonRegistry.BackColor   = ApplicationSettings.NormalButtonColor;
            buttonTools.BackColor      = ApplicationSettings.NormalButtonColor;
            buttonOptions.BackColor    = ApplicationSettings.NormalButtonColor;

            this.ucCleaner1.Visible             = true;
            this.ucResult.Visible               = false;
            this.panelCleanerComponents.Visible = true;
            this.gboxResult.Visible             = true;
            this.panelProgress.Visible          = true;

            if (panelCleanerComponents.Controls.Find("Registry", false).Count() > 0)
            {
                UCRegistry registry = panelCleanerComponents.Controls.Find("Registry", false)[0] as UCRegistry;
                registry.Hide();
            }


            if (panelCleanerComponents.Controls.Find("ucCleaner1", false).Count() > 0)
            {
                UCCleaner registry = panelCleanerComponents.Controls.Find("ucCleaner1", false)[0] as UCCleaner;
                registry.Show();
            }


            if (gboxResult.Controls.Find("Tools", false).Count() > 0)
            {
                UCTools registry = gboxResult.Controls.Find("Tools", false)[0] as UCTools;
                registry.Hide();
            }

            if (this.gboxResult.Controls.Find("UCResultRegistry", true).Count() > 0)
            {
                UCResultRegistry result = this.gboxResult.Controls.Find("UCResultRegistry", true)[0] as UCResultRegistry;
                result.Visible = false;
            }

            if (gboxResult.Controls.Find("Options", false).Count() > 0)
            {
                UCOptions result = this.gboxResult.Controls.Find("Options", true)[0] as UCOptions;
                result.Visible = false;
            }


            ShowHideControls(ApplicationItem.Cleaner);

            SelectedItem = ApplicationItem.Cleaner;

            //ucResult.ResetView();
        }
Exemplo n.º 15
0
        /*
         * private void OnItemClick(object sender, ItemClickEventArgs e)
         * {
         *      LogsManager.Instance.Debug("Item click");
         *
         *      if(e.Position < m_applications.Count)
         *      {
         *              ApplicationItem app = m_applications[e.Position];
         *              if(app != null)
         *                      changeAppSelection(app, !app.Selected);
         *      }
         * }
         */
        private void changeAppSelection(ApplicationItem app, bool selected)
        {
            LogsManager.Instance.Debug(string.Format("Application '{0}' is now {1}", app.Title, selected ? "selected" : "deselect"));

            app.Selected = selected;
            // TODO: allows to save on demand
            SaveOptions();

            if (m_applicationsAdapter != null)
            {
                m_applicationsAdapter.NotifyDataSetChanged();
            }
        }
Exemplo n.º 16
0
        public virtual ActionResult Edit(ApplicationItem app)
        {
            Title          = app.FullName;
            app.AddTime    = DateTime.Now;
            app.UpdateTime = DateTime.Now;
            app.UserCount  = 0;
            app.IsTrue     = true;
            var ais = ConfigSerializer.Load <SystemApplicationConfig>("SystemApplication", false);

            ais.Items.Add(app);
            ConfigSerializer.Save(ais, "SystemApplication");
            return(RedirectToAction("Manage"));
        }
Exemplo n.º 17
0
        public override BUSApplicationItem DataToBusiness(ApplicationItem dataEntity, TContext context)
        {
            BUSApplicationItem businessEntity = base.DataToBusiness(dataEntity, context);

            businessEntity.Application   = dataEntity.Application;
            businessEntity.ApplicationId = dataEntity.ApplicationId;

            Screen screen = context.Screens.AsNoTracking().FirstOrDefault(i => i.Id == dataEntity.ScreenId);

            businessEntity.Screen = screen;
            if (screen != null)
            {
                businessEntity.ScreenId   = screen.Id;
                businessEntity.ScreenName = screen.Name;
            }
            return(businessEntity);
        }
        public int Compare(object x, object y)
        {
            ApplicationItem applicationItem  = x as ApplicationItem;
            ApplicationItem applicationItem2 = y as ApplicationItem;
            int             num = 0;

            if (applicationItem == null && applicationItem2 == null)
            {
                num = 0;
            }
            else if (applicationItem == null)
            {
                num = -1;
            }
            else if (applicationItem2 == null)
            {
                num = 1;
            }
            else if ((applicationItem.get_ShouldAutomaticallyConnect() && applicationItem2.get_ShouldAutomaticallyConnect()) || (!applicationItem.get_ShouldAutomaticallyConnect() && !applicationItem2.get_ShouldAutomaticallyConnect()))
            {
                num = string.Compare(applicationItem.get_ApplicationName(), applicationItem2.get_ApplicationName(), StringComparison.InvariantCultureIgnoreCase);
            }
            else if (applicationItem.get_ShouldAutomaticallyConnect() && !applicationItem2.get_ShouldAutomaticallyConnect())
            {
                num = -1;
                if (this.SortDirection == ListSortDirection.Descending)
                {
                    num *= -1;
                }
            }
            else if (!applicationItem.get_ShouldAutomaticallyConnect() && applicationItem2.get_ShouldAutomaticallyConnect())
            {
                num = 1;
                if (this.SortDirection == ListSortDirection.Descending)
                {
                    num *= -1;
                }
            }
            return(num);
        }
Exemplo n.º 19
0
            public override View GetView(int position, View view, ViewGroup parent)
            {
                ApplicationItem item = GetItem(position) as ApplicationItem;

                if (item == null)
                {
                    return(null);
                }

                if (view == null)
                {
                    view = m_inflater.Inflate(Resource.Layout.PackagesPickerItem, null);
                }

                view.Visibility = ViewStates.Visible;

                ImageView itemIcon = view.FindViewById <ImageView>(Resource.Id.packages_picker_item_icon);

                itemIcon.SetImageDrawable(item.Icon);

                CheckBox itemCheckbox = view.FindViewById <CheckBox>(Resource.Id.packages_picker_item_selection);

                itemCheckbox.Checked = item.Selected;

                TextView itemTitle = view.FindViewById <TextView>(Resource.Id.packages_picker_item_title);

                itemTitle.Text = item.Title;

                TextView itemDescription = view.FindViewById <TextView>(Resource.Id.packages_picker_item_description);

                itemDescription.Text = item.Description;

                // TODO: fixme
                //view.Click += (object sender, EventArgs e) => m_activity.changeAppSelection(item, !item.Selected);
                itemCheckbox.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => m_activity.changeAppSelection(item, e.IsChecked);

                return(view);
            }
Exemplo n.º 20
0
        private async void MenuItem_Click_Folder(object sender, RoutedEventArgs e)
        {
            CommonOpenFileDialog cofd = new CommonOpenFileDialog()
            {
                IsFolderPicker   = true,
                EnsureFileExists = true,
                EnsurePathExists = true,
                Multiselect      = true,
                Title            = "Pick a folder",
                EnsureValidNames = true
            };

            if (cofd.ShowDialog() == CommonFileDialogResult.Ok)
            {
                foreach (var item in cofd.FileNames)
                {
                    var app = new ApplicationItem()
                    {
                        Name      = item.Remove(0, item.LastIndexOf('\\') + 1),
                        Path      = item,
                        IconBytes = UITools.GetIcon(item, true),
                        IsFolder  = true
                    };

                    if (!loa.AppExists(app)) //Check if app exists in the list
                    {
                        loa.Add(app);
                    }
                }

                lv.ItemsSource = loa;

                await DataLogic.SaveDataAsync(loa).ConfigureAwait(false); //Save apps to Apps.json
            }

            cofd.Dispose();
        }
Exemplo n.º 21
0
            public override View GetView(int position, View convertView, ViewGroup parent)
            {
                ApplicationItem item = GetItem(position) as ApplicationItem;

                if (item == null)
                {
                    return(null);
                }

                if (convertView == null)
                {
                    convertView = m_inflater.Inflate(Resource.Layout.package_chooser_item, null);
                }

                convertView.Visibility = ViewStates.Visible;

                ImageView itemIcon = convertView.FindViewById <ImageView>(Resource.Id.packages_picker_item_icon);

                itemIcon.SetImageDrawable(item.Icon);

                CheckBox itemCheckbox = convertView.FindViewById <CheckBox>(Resource.Id.packages_picker_item_selection);

                itemCheckbox.Checked   = item.Selected;
                itemCheckbox.Clickable = false;
                itemCheckbox.Selected  = false;

                TextView itemTitle = convertView.FindViewById <TextView>(Resource.Id.packages_picker_item_title);

                itemTitle.Text = item.Title;

                TextView itemDescription = convertView.FindViewById <TextView>(Resource.Id.packages_picker_item_description);

                itemDescription.Text = item.Description;

                return(convertView);
            }
Exemplo n.º 22
0
        private async void MenuItem_Click_plus(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog()
            {
                AddExtension    = true,
                CheckPathExists = true,
                DefaultExt      = "exe",
                Filter          = "Applications (*.exe)|*.exe|Batch Files (*.bat)|*.bat",
                Multiselect     = true,
                Title           = "Add Shortcuts",
                ValidateNames   = true
            };

            if (ofd.ShowDialog() == true)
            {
                foreach (var item in ofd.FileNames)
                {
                    var app = new ApplicationItem()
                    {
                        Name      = item.Remove(0, item.LastIndexOf('\\') + 1),
                        Path      = item,
                        IconBytes = UITools.GetIcon(item, false),
                        IsFolder  = false
                    };

                    if (!loa.AppExists(app)) //Check if app exists in the list
                    {
                        loa.Add(app);
                    }
                }

                lv.ItemsSource = loa;

                await DataLogic.SaveDataAsync(loa).ConfigureAwait(false);  //Save apps to Apps.json
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Implement Command that Load the templates list
        /// </summary>
        void ExecuteReloadTemplatesCommand(object parameter)
        {
            switch (SelectedTab)
            {
            case 0:
                SelectedCategory      = null;
                _SelectedCategory     = null;
                _SelectedTemplateFile = null;
                SelectedTemplateFile  = null;
                TemplateFiles         = SettingsBLL.GetTemplateFileList();
                break;

            case 1:
                SelectedApplication  = null;
                SelectedSnapshot     = null;
                _SelectedApplication = null;
                _SelectedSnapshot    = null;
                TemplateFiles        = SettingsBLL.GetTemplateFileListPortfolio();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 24
0
 public IApplicationItem MaybeApplicationItemFromCommand(string cmd)
 {
     return(ApplicationItem.MaybeCreateFromCmd(cmd));
 }
        private ApplicationItem CreateApplicationItem(Application application, ProductFeatureApplicability productFeature, DateTime today)
        {
            ApplicationItem applicationItem = new ApplicationItem();
            applicationItem.Application = application;
            applicationItem.ProductFeatureApplicability = productFeature;
            applicationItem.EffectiveDate = today;

            return applicationItem;
        }
        public void PrepareForSave(LoanApplication loanApplication, DateTime today)
        {
            if (this.IsNew)
            {
                ProductFeatureApplicability featureApp;
                if (this.IsFromPickList == false)
                {
                    ProductFeature feature = ProductFeature.GetByName(this.Name);
                    if (feature == null)
                    {
                        feature = new ProductFeature();
                        feature.Name = this.Name;
                        feature.ProductFeatureCategory = ProductFeatureCategory.FeeType;
                        Context.ProductFeatures.AddObject(feature);
                    }

                    FinancialProduct financialProduct = FinancialProduct.GetById(this.FinancialProductId);
                    featureApp = ProductFeatureApplicability.GetActive(feature, financialProduct);
                    if (featureApp == null)
                        featureApp = ProductFeatureApplicability.Create(feature, financialProduct, today);

                }
                else
                {
                    featureApp = ProductFeatureApplicability.GetById(this.ProductFeatureApplicabilityId);
                }

                ApplicationItem item = new ApplicationItem();
                item.Application = loanApplication.Application;
                item.ProductFeatureApplicability = featureApp;
                item.FeeComputedValue = this.TotalChargePerFee;
                item.EffectiveDate = today;

                LoanApplicationFee fee = new LoanApplicationFee();
                fee.LoanApplication = loanApplication;
                fee.Particular = this.Name;
                fee.Amount = this.Amount;
                //fee.ApplicationItem = item;

                Context.LoanApplicationFees.AddObject(fee);
                Context.ApplicationItems.AddObject(item);
            }
            else if (this.ToBeDeleted)
            {
                LoanApplicationFee applicationFee = Context.LoanApplicationFees.SingleOrDefault(entity => entity.Id == this.LoanApplicationFeeId);
                if (applicationFee != null)
                {
                    var application = applicationFee.LoanApplication.Application;
                    var productFeature = ProductFeature.GetByName(applicationFee.Particular);
                    var applicationItem = ApplicationItem.Get(application, productFeature);
                    applicationItem.EndDate = today;
                    Context.LoanApplicationFees.DeleteObject(applicationFee);
                }
            }
            else if (this.IsNew == false && this.ToBeDeleted == false)
            {
                ProductFeatureApplicability featureApp;
                if (this.IsFromPickList == false)
                {
                    ProductFeature feature = ProductFeature.GetByName(this.Name);
                    if (feature == null)
                    {
                        feature = new ProductFeature();
                        feature.Name = this.Name;
                        feature.ProductFeatureCategory = ProductFeatureCategory.FeeType;
                        Context.ProductFeatures.AddObject(feature);
                    }

                    FinancialProduct financialProduct = FinancialProduct.GetById(this.FinancialProductId);
                    featureApp = ProductFeatureApplicability.GetActive(feature, financialProduct);
                    if (featureApp == null)
                        featureApp = ProductFeatureApplicability.Create(feature, financialProduct, today);

                }
                else
                {
                    featureApp = ProductFeatureApplicability.GetById(this.ProductFeatureApplicabilityId);
                }

                ApplicationItem item = new ApplicationItem();
                item.Application = loanApplication.Application;
                item.ProductFeatureApplicability = featureApp;
                item.FeeComputedValue = this.TotalChargePerFee;
                item.EffectiveDate = today;

                LoanApplicationFee fee = new LoanApplicationFee();
                fee.LoanApplication = loanApplication;
                fee.Particular = this.Name;
                fee.Amount = this.Amount;
                //fee.ApplicationItem = item;

                Context.LoanApplicationFees.AddObject(fee);
                Context.ApplicationItems.AddObject(item);
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// Implement Command that Load the templates list
        /// </summary>
        void ExecuteReloadTemplatesCommand(object parameter)
        {
            //if (_SelectedTag != null && _SelectedTemplateFile != null)
            //{
            //    return true;
            //}
            //else
            //{
            //    return _SelectedApplication != null &&
            //           _SelectedSnapshot != null &&
            //           _SelectedTemplateFile != null;
            //}
            if (SelectedTab == 0)
            {
                SelectedCategory = null;
                _SelectedCategory = null;
                _SelectedTemplateFile = null;
                SelectedTemplateFile = null;
                TemplateFiles = SettingsBLL.GetTemplateFileList();
            }
            else
                if (SelectedTab == 1)
                {
                    SelectedApplication = null;
                    SelectedSnapshot = null;
                    _SelectedApplication = null;
                    _SelectedSnapshot = null;

                    TemplateFiles = SettingsBLL.GetTemplateFileListPortfolio();
                }
        }
Exemplo n.º 28
0
        public static string createXML_AllicationItem(PublishedApplication[] arrApplicatioItem)
        {
            string res_xml = "";

            #region commented applivcation attibutes
            //appInStartmenu = arrApplicatioItem[0].AppInStartmenu
            //appOnDesktop = arrApplicatioItem[0].AppOnDesktop
            //changeCount = arrApplicatioItem[0].ChangeCount;
            //clientType = arrApplicatioItem[0].ClientType
            //contentAddress = arrApplicatioItem[0].ContentAddress
            //description = arrApplicatioItem[0].Description
            //encryption = arrApplicatioItem[0].Encryption
            //encryptionMinimum = arrApplicatioItem[0].EncryptionMinimum
            //fileTypes = arrApplicatioItem[0].fileTypes   array!!!!
            //folderName = arrApplicatioItem[0].FolderName
            //freindlyName = arrApplicatioItem[0].FreindlyName
            //icon = arrApplicatioItem[0].Icon
            //internalName = arrApplicatioItem[0].InternalName
            //publisherName = arrApplicatioItem[0].PublisherName
            //remoteAccessEnabled = arrApplicatioItem[0].RemoteAccessEnabled
            //serverType = arrApplicatioItem[0].ServerType
            //soundType= arrApplicatioItem[0].SoundType
            //soundTypeMinimum = arrApplicatioItem[0].SoundTypeMinimum
            //SSLEnabled = arrApplicatioItem[0].SSLEnabled
            //startmenuFolder = arrApplicatioItem[0].StartmenuFolder
            //startMenuRoot = arrApplicatioItem[0].StartMenuRoot
            //users = arrApplicatioItem[0].users    array !!!!
            //videoType = arrApplicatioItem[0].VideoType
            //videoTypeMinimum = arrApplicatioItem[0].VideoTypeMinimum
            //winColor = arrApplicatioItem[0].WinColor
            //winHeight = arrApplicatioItem[0].WinHeight
            //winScale = arrApplicatioItem[0].WinScale
            //winType = arrApplicatioItem[0].WinType
            //winWidth = arrApplicatioItem[0].WinWidth
            #endregion

            XmlDocument xmlDoc = new XmlDocument();

            //create xml document
            XmlElement root = xmlDoc.CreateElement(XML_ELEMENT_APPLICATIONS);
            root.SetAttribute("ID", "root");

            xmlDoc.AppendChild(root);

            int size = arrApplicatioItem.Length;

            foreach (PublishedApplication item in arrApplicatioItem)
            {
                //XmlElement app = xmlDoc.CreateElement(XML_ELEMENT_APP_ITEM);
                ApplicationItem appItem = item.Item;
                XmlElement      app     = CreateXMLApplicaitonItem(xmlDoc, appItem, item.FarmName);

                XmlElement p = null;
                if (!appItem.FolderName.Equals(String.Empty))
                {
                    p = getXMLParentElement(xmlDoc, appItem.FolderName);
                    p.AppendChild(app);
                }
                else
                {
                    root.AppendChild(app);
                }


                #region create xml item
                //    //add Application In start menu
                //    XmlElement appInStartmenu = xmlDoc.CreateElement("AppInStartmenu");
                //    appInStartmenu.InnerText = item.AppInStartmenu;
                //    app.AppendChild(appInStartmenu);

                //    XmlElement appOnDesktop = xmlDoc.CreateElement("AppOnDesktop");
                //    appOnDesktop.InnerText = item.AppOnDesktop;
                //    app.AppendChild(appOnDesktop);

                //    XmlElement changeCount = xmlDoc.CreateElement("ChangeCount");
                //    changeCount.InnerText = item.ChangeCount;
                //    app.AppendChild(changeCount);

                //    XmlElement clientType = xmlDoc.CreateElement("ClientType");
                //    clientType.InnerText = item.ClientType;
                //    app.AppendChild(clientType);

                //    XmlElement contentAddress = xmlDoc.CreateElement("ContentAddress");
                //    contentAddress.InnerText = item.ContentAddress;
                //    app.AppendChild(contentAddress);

                //    XmlElement description = xmlDoc.CreateElement("Description");
                //    description.InnerText = item.Description;
                //    app.AppendChild(description);

                //    XmlElement encryption = xmlDoc.CreateElement("Encryption");
                //    encryption.InnerText = item.Encryption;
                //    app.AppendChild(encryption);

                //    XmlElement encryptionMinimum = xmlDoc.CreateElement("EncryptionMinimum");
                //    encryptionMinimum.InnerText = item.EncryptionMinimum;
                //    app.AppendChild(encryptionMinimum);

                //    FileType[] fileTypes = item.fileTypes;
                //    XmlElement filetypeRoot = xmlDoc.CreateElement("FileTypes");
                //    if (fileTypes != null)
                //    {
                //        foreach (FileType ft in fileTypes)
                //        {
                //            XmlElement fileType = xmlDoc.CreateElement("FileType");
                //            XmlElement fileName = xmlDoc.CreateElement("FileTypeName");
                //            fileName.InnerXml = ft.FileTypeName;
                //            fileType.AppendChild(fileName);

                //            XmlElement isDef = xmlDoc.CreateElement("IsDefault");
                //            isDef.InnerXml = ft.IsDefault.ToString();
                //            fileType.AppendChild(isDef);

                //            XmlElement ow = xmlDoc.CreateElement("Overwrite");
                //            ow.InnerXml = ft.Overwrite.ToString();
                //            fileType.AppendChild(ow);

                //            XmlElement exts = xmlDoc.CreateElement("FileExtentions");
                //            if (ft.FileExtension != null)
                //            {
                //                foreach (string ext in ft.FileExtension)
                //                {
                //                    XmlElement ee = xmlDoc.CreateElement("Extention");
                //                    ee.InnerXml = ext;
                //                    exts.AppendChild(ee);
                //                }
                //            }
                //            fileType.AppendChild(exts);

                //            XmlElement mms = xmlDoc.CreateElement("MimeTypes");
                //            if (ft.MimeType != null)
                //            {
                //                foreach (string mm in ft.MimeType)
                //                {
                //                    XmlElement me = xmlDoc.CreateElement("mime");
                //                    me.InnerXml = mm;
                //                    mms.AppendChild(me);
                //                }
                //            }
                //            fileType.AppendChild(mms);

                //            XmlElement param = xmlDoc.CreateElement("Parameters");
                //            param.InnerXml = ft.Parameters;
                //            fileType.AppendChild(param);

                //            filetypeRoot.AppendChild(fileType);
                //        }
                //    }
                //    app.AppendChild(filetypeRoot);

                //    XmlElement folderName = xmlDoc.CreateElement("FolderName");
                //    folderName.InnerText = item.FolderName;
                //    app.AppendChild(folderName);

                //    XmlElement freindlyName = xmlDoc.CreateElement("FreindlyName");
                //    freindlyName.InnerText = item.FreindlyName;
                //    app.AppendChild(freindlyName);

                //    XmlElement icon = xmlDoc.CreateElement("Icon");
                //    icon.InnerText = item.Icon;
                //    app.AppendChild(icon);

                //    XmlElement internalName = xmlDoc.CreateElement("InternalName");
                //    internalName.InnerText = item.InternalName;
                //    app.AppendChild(internalName);

                //    XmlElement publisherName = xmlDoc.CreateElement("PublisherName");
                //    publisherName.InnerText = item.PublisherName;
                //    app.AppendChild(publisherName);

                //    XmlElement remoteAccessEnabled = xmlDoc.CreateElement("RemoteAccessEnabled");
                //    remoteAccessEnabled.InnerText = item.RemoteAccessEnabled;
                //    app.AppendChild(remoteAccessEnabled);

                //    XmlElement serverType = xmlDoc.CreateElement("ServerType");
                //    serverType.InnerText = item.ServerType;
                //    app.AppendChild(serverType);

                //    XmlElement soundType = xmlDoc.CreateElement("SoundType");
                //    soundType.InnerText = item.SoundType;
                //    app.AppendChild(soundType);

                //    XmlElement soundTypeMinimum = xmlDoc.CreateElement("SoundTypeMinimum");
                //    soundTypeMinimum.InnerText = item.SoundTypeMinimum;
                //    app.AppendChild(soundTypeMinimum);

                //    XmlElement SSLEnabled = xmlDoc.CreateElement("SSLEnabled");
                //    SSLEnabled.InnerText = item.SSLEnabled;
                //    app.AppendChild(SSLEnabled);

                //    XmlElement startmenuFolder = xmlDoc.CreateElement("StartmenuFolder");
                //    startmenuFolder.InnerText = item.StartmenuFolder;
                //    app.AppendChild(startmenuFolder);

                //    XmlElement startMenuRoot = xmlDoc.CreateElement("StartMenuRoot");
                //    startMenuRoot.InnerText = item.StartMenuRoot;
                //    app.AppendChild(startMenuRoot);

                //    User[] users = item.users;
                //    XmlElement usrs = xmlDoc.CreateElement("Users");
                //    if (users != null)
                //    {
                //        foreach (User usr in users)
                //        {
                //            XmlElement ue = xmlDoc.CreateElement("User");
                //            XmlElement uname = xmlDoc.CreateElement("UserName");
                //            uname.InnerXml = usr.Name;
                //            ue.AppendChild(uname);

                //            XmlElement udomain = xmlDoc.CreateElement("UserDomain");
                //            udomain.InnerXml = usr.DomainName;
                //            ue.AppendChild(udomain);

                //            XmlElement udt = xmlDoc.CreateElement("UserDomainType");
                //            udt.InnerXml = usr.DomainType;
                //            ue.AppendChild(udt);
                //            usrs.AppendChild(ue);
                //        }
                //    }
                //    app.AppendChild(usrs);


                //    XmlElement videoType = xmlDoc.CreateElement("VideoType");
                //    videoType.InnerText = item.VideoType;
                //    app.AppendChild(videoType);

                //    XmlElement videoTypeMinimum = xmlDoc.CreateElement("VideoTypeMinimum");
                //    videoTypeMinimum.InnerText = item.VideoTypeMinimum;
                //    app.AppendChild(videoTypeMinimum);

                //    XmlElement winColor = xmlDoc.CreateElement("WinColor");
                //    winColor.InnerText = item.WinColor;
                //    app.AppendChild(winColor);

                //    XmlElement winHeight = xmlDoc.CreateElement("WinHeight");
                //    winHeight.InnerText = item.WinHeight;
                //    app.AppendChild(winHeight);

                //    XmlElement winScale = xmlDoc.CreateElement("WinScale");
                //    winScale.InnerText = item.WinScale;
                //    app.AppendChild(winScale);

                //    XmlElement winType = xmlDoc.CreateElement("WinType");
                //    winType.InnerText = item.WinType;
                //    app.AppendChild(winType);

                //    XmlElement winWidth = xmlDoc.CreateElement("WinWidth");
                //    winWidth.InnerText = item.WinWidth;
                //    app.AppendChild(winWidth);

                //    root.AppendChild(app);

                ////            xmlDoc.AppendChild(root);
                #endregion
            }
            res_xml = xmlDoc.OuterXml;

            return(res_xml);
        }
Exemplo n.º 29
0
 public int UpdateApplication(ApplicationItem item)
 {
     return(0);
 }
Exemplo n.º 30
0
 public int DeleteApplication(ApplicationItem item)
 {
     return(0);
 }
Exemplo n.º 31
0
 public int AddApplication(ApplicationItem item)
 {
     return(0);
 }
Exemplo n.º 32
0
        internal static bool AppExists(this ObservableCollection <ApplicationItem> items, ApplicationItem app)
        {
            foreach (var item in items)
            {
                if (item.Path == app.Path)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 33
0
        private static XmlElement CreateXMLApplicaitonItem(XmlDocument xmlDoc, ApplicationItem item, string farmName)
        {
            XmlElement app = xmlDoc.CreateElement(XML_ELEMENT_APP_ITEM);

            app.SetAttribute("ID", item.InternalName);

            //add Application In start menu
            XmlElement appInStartmenu = xmlDoc.CreateElement("AppInStartmenu");

            appInStartmenu.InnerText = item.AppInStartmenu;
            app.AppendChild(appInStartmenu);

            XmlElement appOnDesktop = xmlDoc.CreateElement("AppOnDesktop");

            appOnDesktop.InnerText = item.AppOnDesktop;
            app.AppendChild(appOnDesktop);

            XmlElement changeCount = xmlDoc.CreateElement("ChangeCount");

            changeCount.InnerText = item.ChangeCount;
            app.AppendChild(changeCount);

            XmlElement clientType = xmlDoc.CreateElement("ClientType");

            clientType.InnerText = item.ClientType;
            app.AppendChild(clientType);

            XmlElement contentAddress = xmlDoc.CreateElement("ContentAddress");

            contentAddress.InnerText = item.ContentAddress;
            app.AppendChild(contentAddress);

            XmlElement description = xmlDoc.CreateElement("Description");

            description.InnerText = item.Description;
            app.AppendChild(description);

            XmlElement encryption = xmlDoc.CreateElement("Encryption");

            encryption.InnerText = item.Encryption;
            app.AppendChild(encryption);

            XmlElement encryptionMinimum = xmlDoc.CreateElement("EncryptionMinimum");

            encryptionMinimum.InnerText = item.EncryptionMinimum;
            app.AppendChild(encryptionMinimum);

            FileType[] fileTypes    = item.fileTypes;
            XmlElement filetypeRoot = xmlDoc.CreateElement("FileTypes");

            if (fileTypes != null)
            {
                foreach (FileType ft in fileTypes)
                {
                    XmlElement fileType = xmlDoc.CreateElement("FileType");
                    XmlElement fileName = xmlDoc.CreateElement("FileTypeName");
                    fileName.InnerXml = ft.FileTypeName;
                    fileType.AppendChild(fileName);

                    XmlElement isDef = xmlDoc.CreateElement("IsDefault");
                    isDef.InnerXml = ft.IsDefault.ToString();
                    fileType.AppendChild(isDef);

                    XmlElement ow = xmlDoc.CreateElement("Overwrite");
                    ow.InnerXml = ft.Overwrite.ToString();
                    fileType.AppendChild(ow);

                    XmlElement exts = xmlDoc.CreateElement("FileExtentions");
                    if (ft.FileExtension != null)
                    {
                        foreach (string ext in ft.FileExtension)
                        {
                            XmlElement ee = xmlDoc.CreateElement("Extention");
                            ee.InnerXml = ext;
                            exts.AppendChild(ee);
                        }
                    }
                    fileType.AppendChild(exts);

                    XmlElement mms = xmlDoc.CreateElement("MimeTypes");
                    if (ft.MimeType != null)
                    {
                        foreach (string mm in ft.MimeType)
                        {
                            XmlElement me = xmlDoc.CreateElement("mime");
                            me.InnerXml = mm;
                            mms.AppendChild(me);
                        }
                    }
                    fileType.AppendChild(mms);

                    XmlElement param = xmlDoc.CreateElement("Parameters");
                    param.InnerXml = ft.Parameters;
                    fileType.AppendChild(param);

                    filetypeRoot.AppendChild(fileType);
                }
            }
            app.AppendChild(filetypeRoot);

            XmlElement folderName = xmlDoc.CreateElement("FolderName");

            folderName.InnerText = item.FolderName;
            app.AppendChild(folderName);

            XmlElement freindlyName = xmlDoc.CreateElement("FreindlyName");

            freindlyName.InnerText = item.FreindlyName;
            app.AppendChild(freindlyName);

            XmlElement icon = xmlDoc.CreateElement("Icon");

            icon.InnerText = item.Icon;
            app.AppendChild(icon);

            XmlElement internalName = xmlDoc.CreateElement("InternalName");

            internalName.InnerText = item.InternalName;
            app.AppendChild(internalName);

            XmlElement publisherName = xmlDoc.CreateElement("PublisherName");

            publisherName.InnerText = item.PublisherName;
            app.AppendChild(publisherName);

            XmlElement remoteAccessEnabled = xmlDoc.CreateElement("RemoteAccessEnabled");

            remoteAccessEnabled.InnerText = item.RemoteAccessEnabled;
            app.AppendChild(remoteAccessEnabled);

            XmlElement serverType = xmlDoc.CreateElement("ServerType");

            serverType.InnerText = item.ServerType;
            app.AppendChild(serverType);

            XmlElement soundType = xmlDoc.CreateElement("SoundType");

            soundType.InnerText = item.SoundType;
            app.AppendChild(soundType);

            XmlElement soundTypeMinimum = xmlDoc.CreateElement("SoundTypeMinimum");

            soundTypeMinimum.InnerText = item.SoundTypeMinimum;
            app.AppendChild(soundTypeMinimum);

            XmlElement SSLEnabled = xmlDoc.CreateElement("SSLEnabled");

            SSLEnabled.InnerText = item.SSLEnabled;
            app.AppendChild(SSLEnabled);

            XmlElement startmenuFolder = xmlDoc.CreateElement("StartmenuFolder");

            startmenuFolder.InnerText = item.StartmenuFolder;
            app.AppendChild(startmenuFolder);

            XmlElement startMenuRoot = xmlDoc.CreateElement("StartMenuRoot");

            startMenuRoot.InnerText = item.StartMenuRoot;
            app.AppendChild(startMenuRoot);

            User[]     users = item.users;
            XmlElement usrs  = xmlDoc.CreateElement("Users");

            if (users != null)
            {
                foreach (User usr in users)
                {
                    XmlElement ue    = xmlDoc.CreateElement("User");
                    XmlElement uname = xmlDoc.CreateElement("UserName");
                    uname.InnerXml = usr.Name;
                    ue.AppendChild(uname);

                    XmlElement udomain = xmlDoc.CreateElement("UserDomain");
                    udomain.InnerXml = usr.DomainName;
                    ue.AppendChild(udomain);

                    XmlElement udt = xmlDoc.CreateElement("UserDomainType");
                    udt.InnerXml = usr.DomainType;
                    ue.AppendChild(udt);
                    usrs.AppendChild(ue);
                }
            }
            app.AppendChild(usrs);


            XmlElement videoType = xmlDoc.CreateElement("VideoType");

            videoType.InnerText = item.VideoType;
            app.AppendChild(videoType);

            XmlElement videoTypeMinimum = xmlDoc.CreateElement("VideoTypeMinimum");

            videoTypeMinimum.InnerText = item.VideoTypeMinimum;
            app.AppendChild(videoTypeMinimum);

            XmlElement winColor = xmlDoc.CreateElement("WinColor");

            winColor.InnerText = item.WinColor;
            app.AppendChild(winColor);

            XmlElement winHeight = xmlDoc.CreateElement("WinHeight");

            winHeight.InnerText = item.WinHeight;
            app.AppendChild(winHeight);

            XmlElement winScale = xmlDoc.CreateElement("WinScale");

            winScale.InnerText = item.WinScale;
            app.AppendChild(winScale);

            XmlElement winType = xmlDoc.CreateElement("WinType");

            winType.InnerText = item.WinType;
            app.AppendChild(winType);

            XmlElement winWidth = xmlDoc.CreateElement("WinWidth");

            winWidth.InnerText = item.WinWidth;
            app.AppendChild(winWidth);

            XmlElement farm = xmlDoc.CreateElement("FarmName");

            farm.InnerText = farmName;
            app.AppendChild(farm);

            //parent.AppendChild(app);

            return(app);
        }