private void btnSave_Click(object sender, EventArgs e)
        {
            if (dgvFolders.SelectedRows.Count.Equals(0))
            {
                return;
            }

            string folder = dgvFolders.SelectedRows[0].Cells[0].Value.ToString();

            if (!string.IsNullOrEmpty(folder))
            {
                LoanFolderRule current = CDO.Rules.Where(x => x.FolderName.Equals(folder)).FirstOrDefault();
                if (current == null)
                {
                    current            = new LoanFolderRule();
                    current.FolderName = folder;
                    CDO.Rules.Add(current);
                }
                current.Expression = txtCalculation.Text;
                current.Milestone  = cmbMilestone.Text;
                current.Order      = Convert.ToInt32(txtOrder.Value);
                current.Active     = chkActive.Checked;
            }

            CustomDataObject.Save <LoanFolderRules>(LoanFolderRules.Key, CDO);
            ClearFields();
        }
        public LinksAndResources()
        {
            RefreshControl();
            CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key);
            var rights            = cdo.Rights;

            CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo);

            //Links = cdo.Links == null || cdo.Links.Count.Equals(0) ? new Dictionary<string, Dictionary<string, string>>() : cdo.Links.ContainsKey(EncompassHelper.LastPersona) ? cdo.Links[EncompassHelper.LastPersona] : cdo.Links["Default"];
        }
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key);

            cdo.SideMenuOpenByDefault = chkSide.Checked ? "True" : "False";
            cdo.SuperAdminRun         = chkAdmin.Checked;
            cdo.TestServer            = txtTest.Text;
            CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo);
            MessageBox.Show($" Saved");
        }
Ejemplo n.º 4
0
        private void BtnDuplicate_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(TriggerName))
            {
                MailTrigger trigger    = CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault();
                MailTrigger newTrigger = trigger.Clone(trigger);
                CDO.Triggers.Add(newTrigger);

                CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO);
                SetupControls();
            }
        }
Ejemplo n.º 5
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            bool update = !string.IsNullOrEmpty(TriggerName);

            if (update)
            {
                MailTrigger trigger = CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault();
                CDO.Triggers.Remove(trigger);

                CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO);
                SetupControls();
            }
        }
Ejemplo n.º 6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ExportServiceConfig config = Config.Configs.FirstOrDefault(x => x.Service.Equals(cmbService.Text));
            bool add = config == null;

            if (add)
            {
                config = new ExportServiceConfig();
                Config.Configs.Add(config);
            }

            config.Forms           = chkForms.CheckedItems.Cast <string>().ToList();
            config.ExportControlID = txtFieldID.Text;
            config.Service         = cmbService.Text;
            CustomDataObject.Save <ExportServiceConfigs>(ExportServiceConfigs.Key, Config);
            MessageBox.Show("Changes Saved.");
            this.Close();
        }
Ejemplo n.º 7
0
        private void Item_Click(object sender, EventArgs e)
        {
            GridView gridView = FormWrapper.GetPipeline();
            VIPCDO   cdo      = CustomDataObject.Get <VIPCDO>(VIPCDO.Key);
            string   guid     = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID;

            if (cdo.Loans.Contains(guid))
            {
                cdo.Loans.Remove(guid);
            }
            else
            {
                cdo.Loans.Add(guid);
            }


            CustomDataObject.Save <VIPCDO>(VIPCDO.Key, cdo);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            string            Name  = comboBox1.Text;
            PluginAccessRight right = CDO.Rights.FirstOrDefault(x => x.PluginName.Equals(Name));

            if (right == null)
            {
                right            = new PluginAccessRight();
                right.PluginName = Name;
                CDO.Rights.Add(right);
            }

            right.AllAccess = chkAllAccess.Checked;
            right.Personas  = cbPersonas.CheckedItems.OfType <string>().ToList();
            right.UserIDs   = cbUsers.CheckedItems.OfType <string>().ToList();

            CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, CDO);
            MessageBox.Show($"{CommunitySettings.Key} Saved");
        }
Ejemplo n.º 9
0
        public override void DataExchangeReceived(object sender, DataExchangeEventArgs e)
        {
            if (!ConcurrentUser)
            {
                return;
            }

            RuleLockInfo info = JsonConvert.DeserializeObject <RuleLockInfo>(e.Data.ToString(), new Newtonsoft.Json.JsonSerializerSettings
            {
                TypeNameHandling  = Newtonsoft.Json.TypeNameHandling.Auto,
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });


            RuleLockCDO cdo = CustomDataObject.Get <RuleLockCDO>(RuleLockCDO.Key);

            cdo.Rules.Add(info);
            CustomDataObject.Save <RuleLockCDO>(RuleLockCDO.Key, cdo);
        }
        private void Save_Click(object sender, EventArgs e)
        {
            PipelineScreen  mainScreen = FormWrapper.EncompassForm.Controls.Find("pipelineScreen", true)[0] as PipelineScreen;
            FieldFilterList filter     = mainScreen.GetCurrentFilter();

            cdo.Filters.Add(new PipelineFilter()
            {
                Name         = Filter.Text,
                Filter       = filter,
                Public       = false,
                Owner        = EncompassHelper.User.ID,
                Folder       = GetSelectedFolderList(),
                PipelineView = View.Text
            });

            CustomDataObject.Save <PipelineFilterCDO>(PipelineFilterCDO.Key, cdo);
            LoadFilters(Filter);
            Filter.Text = string.Empty;
        }
Ejemplo n.º 11
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            bool update = !string.IsNullOrEmpty(TriggerName);

            if (CDO.Triggers.Any(x => x.Name.Equals(txtName.Text)) && !update)
            {
                MessageBox.Show("There is already a Trigger with this name.");
                return;
            }

            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show("Name cannot be blank.");
                return;
            }

            MailTrigger trigger = update ? CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault() : new MailTrigger();

            trigger.Name         = txtName.Text;
            trigger.ReportFilter = cmbReports.SelectedItem.ToString();
            trigger.Frequency    = (FrequencyType)Enum.Parse(typeof(FrequencyType), cmbFrequency.SelectedItem.ToString());
            trigger.Time         = dtpTime.Value;
            trigger.Date         = dtpDate.Value;
            trigger.Days         = chkDays.CheckedIndices.Cast <int>().ToArray();
            trigger.To           = txtTo.Text;
            trigger.CC           = txtCC.Text;
            trigger.BCC          = txtBcc.Text;
            trigger.Subject      = txtSubject.Text;
            trigger.Body         = txtHtml.Text;
            trigger.Active       = chkTriggerActive.Checked;

            if (!update)
            {
                CDO.Triggers.Add(trigger);
            }

            CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO);

            SetupControls();
        }
Ejemplo n.º 12
0
        public static bool CheckAccess(string pluginName)
        {
            CommunitySettings        cdo    = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key);
            List <PluginAccessRight> rights = cdo.Rights;

            if (rights.Count.Equals(0))
            {
                rights.Add(new PluginAccessRight()
                {
                    PluginName = nameof(TopMenuBase), AllAccess = true
                });
                rights.Add(new PluginAccessRight()
                {
                    PluginName = nameof(PluginManagement), AllAccess = true
                });
                CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo);
            }

            PluginAccessRight right = rights.Where(x => x.PluginName.Equals(pluginName)).FirstOrDefault();

            if (right == null)
            {
                return(false);
            }

            bool isAllowedToRun = right.AllAccess;

            if (!isAllowedToRun && right.Personas != null)
            {
                isAllowedToRun = EncompassHelper.ContainsPersona(right.Personas);
            }

            if (!isAllowedToRun && right.UserIDs != null)
            {
                isAllowedToRun = right.UserIDs.Contains(EncompassHelper.User.ID);
            }

            return(isAllowedToRun);
        }