示例#1
0
        protected async System.Threading.Tasks.Task Load()
        {
            var monthlyStatsResult = MonthlyStats();

            monthlyStats = monthlyStatsResult;

            var revenueByCompanyResult = RevenueByCompany();

            revenueByCompany = revenueByCompanyResult;

            var revenueByEmployeeResult = RevenueByEmployee();

            revenueByEmployee = revenueByEmployeeResult;

            var revenueByMonthResult = RevenueByMonth();

            revenueByMonth = revenueByMonthResult;

            var crmGetOpportunitiesResult = await Crm.GetOpportunities(new Query()
            {
                OrderBy = $"CloseDate desc"
            });

            getOpportunitiesResult = crmGetOpportunitiesResult;

            var crmGetTasksResult = await Crm.GetTasks(new Query()
            {
                OrderBy = $"DueDate desc"
            });

            getTasksResult = crmGetTasksResult;
        }
示例#2
0
        private static void BorrarPrueba(Crm crm)
        {
            var q = new QueryExpression("account");

            q.Criteria.Conditions.AddRange(
                new ConditionExpression("createdon", ConditionOperator.Today)
                );
            var terceros = new EntityCollection();

            while (true)
            {
                var res = crm.GetIOS().RetrieveMultiple(q);
                terceros.Entities.AddRange(res.Entities);
                if (res.MoreRecords)
                {
                    q.PageInfo.PageNumber++;
                    q.PageInfo.PagingCookie = res.PagingCookie;
                }
                else
                {
                    break;
                }
            }
            foreach (var t in terceros.Entities)
            {
                crm.AnadirElementoEmr(new DeleteRequest()
                {
                    Target = new EntityReference("account", t.Id)
                });
            }
            crm.ProcesarUltimosEmr();
        }
        public MonkeyFactory(Workspace workspace, IInfrastructureEnvironment environment)
        {
            System = workspace.Model.AddSoftwareSystem(
                Location.Internal,
                "Monkey Factory",
                "Azure cloud based backend for processing data created during production of monkeys");

            KeyVault         = new MonkeyKeyVault(this, environment);
            Hub              = new MonkeyHub(this, environment);
            CrmConnector     = new MonkeyCrmConnector(this, environment);
            EventStore       = new MonkeyEventStore(this, environment);
            UI               = new MonkeyUI(this, EventStore, environment);
            MessageProcessor = new MonkeyMessageProcessor(this, Hub, CrmConnector, EventStore, environment);
            DPS              = new MonkeyDeviceProvisioningService(this, Hub, environment);

            TechnicalSupportUser = workspace.Model.AddPerson("Technical support user", "Responds to incidents during monkey production");
            TechnicalSupportUser.Uses(UI, "Gather information about system failures");

            ProductionShiftLead = workspace.Model.AddPerson("Production Shift leader", "Monitors monkey production");
            ProductionShiftLead.Uses(UI, "Monitor load on production systems");

            MonkeyProductionLine = workspace.Model.AddSoftwareSystem(Location.External, "Production Line", "Produces the actual monkeys");
            MonkeyProductionLine.Uses(Hub, "Send production telemetry data and failure events", "MQTT");
            MonkeyProductionLine.Uses(DPS, "Provision device that produces monkeys", "HTTPS");

            Crm = workspace.Model.AddSoftwareSystem(Location.External, "CRM", "");
            Crm.Uses(CrmConnector, "Process failure events in order to create support tickets", "AMQP");

            StoreSecretsInKeyVault();
        }
示例#4
0
        private static void BorrarPruebas(Crm crm, Comun co)
        {
            #region BORRAR PRODUCTOS
            var queprod = new QueryExpression("product");
            //quece.TopCount = 5000;

            var prods = new EntityCollection();
            while (true)
            {
                var res1 = crm.GetIOS().RetrieveMultiple(queprod);
                prods.Entities.AddRange(res1.Entities);
                if (res1.MoreRecords)
                {
                    queprod.PageInfo.PageNumber++;
                    queprod.PageInfo.PagingCookie = res1.PagingCookie;
                }
                else
                {
                    break;
                }
            }
            foreach (var ce in prods.Entities)
            {
                crm.AnadirElementoEmr(new DeleteRequest()
                {
                    Target = new EntityReference("product", ce.Id)
                });
            }
            crm.ProcesarUltimosEmr();
            #endregion BORRAR PRODuCTOS
            co.LogText("\n=============================== PRODUCTOS  BORRADOS ===================================\n");
        }
        // Method to remove customer from the crm file
        public void RemoveCustomerSubmenu(bool clear = true)
        {
            if (clear)
            {
                Console.Clear();
            }

            Console.WriteLine("### Delete Customer Submenu ###\n");
            DeleteCRMValidationInput();
            // Ensure that the desired ID to be deleted exists in the customer list to execute deletion
            if (Crm.CustomerList.Any(customer => customer.ID == DeleteRecordID))
            {
                // deletion is successful if customer is not renting a vehicle
                if (Crm.RemoveCustomer(DeleteRecordID, Fleet))
                {
                    Crm.SaveToFile();
                    Console.WriteLine($"\nSuccessfully deleted the Customer with an ID of '{DeleteRecordID}'");
                }
                else
                {
                    Console.WriteLine($"\nDeletion Unsuccessful. Customer '{DeleteRecordID}' is currently renting a vehicle.");
                }
                LastMRRCscreen(() => SubMenu("Customer"), () => RemoveCustomerSubmenu());
            }
            // If the desired ID to be deleted is not in the list, prompt a message
            else
            {
                Console.Clear();
                Console.WriteLine("Customer with an ID of '{0}' does not exist in the Customers List\n", DeleteRecordID);
                RemoveCustomerSubmenu(false);
                LastMRRCscreen(() => SubMenu("Customer"), () => RemoveCustomerSubmenu());
            }
        }
示例#6
0
        public Oracle(Crm crm, Comun comun)
        {
            Crm   = crm;
            Comun = comun;

            OraConnParaLog = new OracleConnection(Comun.ConnStringOracle);
            OraConnParaLog.Open();
        }
示例#7
0
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var crmGetOpportunityStatusByIdResult = await Crm.GetOpportunityStatusById(Id);

            opportunitystatus = crmGetOpportunityStatusByIdResult;
        }
示例#8
0
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var crmGetTaskTypeByIdResult = await Crm.GetTaskTypeById(Id);

            tasktype = crmGetTaskTypeByIdResult;
        }
示例#9
0
        protected async void Load()
        {
            var crmGetContactsResult = await Crm.GetContacts();

            getContactsResult = crmGetContactsResult;

            contactFilter = "";
        }
        protected async void Load()
        {
            canEdit = true;

            var crmGetOpportunityStatusByIdResult = await Crm.GetOpportunityStatusById(int.Parse(Id));

            opportunitystatus = crmGetOpportunityStatusByIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var crmGetContactByIdResult = await Crm.GetContactById(Id);

            contact = crmGetContactByIdResult;
        }
示例#12
0
        protected async void Load()
        {
            canEdit = true;

            var crmGetTaskTypeByIdResult = await Crm.GetTaskTypeById(int.Parse($"{Id}"));

            tasktype = crmGetTaskTypeByIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var crmGetContactsResult = await Crm.GetContacts();

            getContactsResult = crmGetContactsResult;

            contactFilter = "";
        }
        protected async void Load()
        {
            canEdit = true;

            var crmGetTaskStatusByIdResult = await Crm.GetTaskStatusById(int.Parse(Id));

            taskstatus = crmGetTaskStatusByIdResult;
        }
示例#15
0
        protected async void Load()
        {
            canEdit = true;

            var crmGetContactByIdResult = await Crm.GetContactById(int.Parse(Id));

            contact = crmGetContactByIdResult;
        }
示例#16
0
        protected async void Button1Click(MouseEventArgs args)
        {
            var crmGetContactsResult = await Crm.GetContacts(new Query()
            {
                Filter = $@"i => i.Email.Contains(""{contactFilter}"") || i.Company.Contains(""{contactFilter}"") || i.FirstName.Contains(""{contactFilter}"") || i.LastName.Contains(""{contactFilter}"")"
            });

            getContactsResult = crmGetContactsResult;
        }
示例#17
0
        //Busca médico na tabela hash com base em um CRM
        public Doctor GetDoctor(Crm crm)
        {
            if (!_doctors.Exist(crm))
            {
                throw new InvalidOperationException("Médico não existe.");
            }

            return(_doctors.Find(crm));
        }
示例#18
0
        // Main method interface to do modify operations on vehicle
        public void ModifyVehicleSubmenu(bool clear = true)
        {
            if (clear)
            {
                Console.Clear();
            }

            Console.WriteLine("### Modify Vehicle Submenu ###\n");
            // Require the operator to enter the vehicle registration to be modified
            ModifyRegoValidInput();
            // Save the changed ID to -1 in case customer decideds to retain the same ID in the modification menu.
            Crm.SaveToFile();
            string subMenu = "a) Modify Default Vehicle Fields" + "\nb) Modify All Vehicle Fields";

            Console.WriteLine("\nPlease enter a character from the options below:\n");
            Console.WriteLine(subMenu);
            // Return the vehicle which matches the provided registration to modify and assign to vehicle object
            Vehicle vehicle = Fleet.GetVehicle(regoToModify);

            // Wait for user to input the next key
            inputkey = Console.ReadKey();
            switch (inputkey.Key)
            {
            case A_Pressed:
                ModifyVehicle(vehicle);
                break;

            case B_Pressed:
                ModifyVehicle(vehicle, true);
                break;

            case H_Pressed:
                MRRCInterface();
                break;

            case Backspace_Pressed:
                ModifyVehicleSubmenu();
                break;

            case Escape_Pressed:
                QuitMessage();
                break;

            case Q_Pressed:
                SubMenu("Fleet");
                break;

            default:     // if any key other than above listed is pressed, do:
                Console.Clear();
                Console.WriteLine("You Pressed '{0}', Please enter a valid option\n", inputkey.Key.ToString());
                ModifyVehicleSubmenu(false);
                break;
            }
        }
        // Method to modify a specific customer which exists in the crm file
        public void ModifyCustomerSubmenu(bool clear = true)
        {
            if (clear)
            {
                Console.Clear();
            }

            Console.WriteLine("### Modify Customer Submenu ###\n");
            ModifyCRMValidationInput();
            // Return the customer which matches the provided ID to modify and assign to modifiedcustomer object
            Customer customer = Crm.GetCustomer(IDtoMofify);

            // if the returned customer in the modified customer object is not null, proceed to modify
            if (customer != null)
            {
                // Store old customers ID, title, first and last names into variables
                int    OldID = customer.ID;
                string OldTitle = customer.title, OldFirstName = customer.firstName, OldLastName = customer.lastName;
                // Set the customer ID to the highest id value + 1, in case the customer wants to retain his/her ID and only wants
                // to modify the fields. We set the ID to this so that the validation doesnt prompt an error that the ID wanting
                // to be retained already exists. If the ID is retained, there is still unique ID's in the list
                int HighestID = Crm.CustomerList.Max(Customer => Customer.ID) + 1;
                customer.ID = HighestID;
                // Save the changed ID value in case customer decideds to retain the same ID in the modification menu.
                Crm.SaveToFile();
                ModifyIDValidationInput();
                customer.ID = IDtoMofify;
                Console.Write("Title*: ");
                title          = StringToTitleCase(Console.ReadLine());
                customer.title = title;
                Console.Write("FirstName*: ");
                firstName          = StringToTitleCase(Console.ReadLine());
                customer.firstName = firstName;
                Console.Write("LastName*: ");
                lastName          = StringToTitleCase(Console.ReadLine());
                customer.lastName = lastName;
                GenderValidationInput();
                customer.gender = Gender;
                DOBValidationInput();
                customer.DOB = DOB;
                Console.Write("\nSuccessfully modified customer '{0} - {1} {2} {3}' to '{4} {5} {6} {7}' within the customers list",
                              OldID, OldTitle, OldFirstName, OldLastName, IDtoMofify, title, firstName, lastName);
                Crm.SaveToFile();
                LastMRRCscreen(() => SubMenu("Customer"), () => ModifyCustomerSubmenu());
            }
            // If the returned customer in the object is null, then the customer does not exist
            else
            {
                Console.Clear();
                Console.WriteLine("Customer with an ID of '{0}' does not exist in the Customers List\n", IDtoMofify);
                ModifyCustomerSubmenu(false);
                LastMRRCscreen(() => SubMenu("Customer"), () => ModifyCustomerSubmenu());
            }
        }
示例#20
0
        public async Task Update(string accessToken)
        {
            Crm.Setup(accessToken);

            crm = Crm.AuthenticatedCrmService;

            var accounts = await crm.GetAccounts();

            Accounts.RemoveAt(0);
            accounts.ForEach(a => Accounts.Add(a));
        }
示例#21
0
        protected async System.Threading.Tasks.Task Load()
        {
            var crmGetContactsResult = await Crm.GetContacts();

            getContactsResult = crmGetContactsResult;

            var crmGetOpportunityStatusesResult = await Crm.GetOpportunityStatuses();

            getOpportunityStatusesResult = crmGetOpportunityStatusesResult;

            opportunity = new RadzenCrm.Models.Crm.Opportunity();
        }
        protected async void Load()
        {
            var crmGetContactsResult = await Crm.GetContacts();

            getContactsResult = crmGetContactsResult;

            var crmGetOpportunityStatusesResult = await Crm.GetOpportunityStatuses();

            getOpportunityStatusesResult = crmGetOpportunityStatusesResult;

            opportunity = new RadzenCrm.Models.Crm.Opportunity();
        }
示例#23
0
        protected async System.Threading.Tasks.Task Load()
        {
            monthlyStats = await MonthlyStats();

            var crmGetOpportunitiesResult = await Crm.GetOpportunities(orderby : $@"CloseDate desc", expand : $"Contact,OpportunityStatus");

            getOpportunitiesResult = crmGetOpportunitiesResult.Value;

            var crmGetTasksResult = await Crm.GetTasks(orderby : $@"DueDate desc", expand : $"Opportunity($expand=User,Contact)");

            getTasksResult = crmGetTasksResult.Value;
        }
示例#24
0
        protected async void Form0Submit(RadzenCrm.Models.Crm.Contact args)
        {
            try
            {
                var crmUpdateContactResult = await Crm.UpdateContact(int.Parse(Id), contact);

                DialogService.Close(contact);
            }
            catch (Exception crmUpdateContactException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Contact");
            }
        }
示例#25
0
        protected async void Form0Submit(RadzenCrm.Models.Crm.TaskType args)
        {
            try
            {
                var crmUpdateTaskTypeResult = await Crm.UpdateTaskType(int.Parse($"{Id}"), tasktype);

                DialogService.Close(tasktype);
            }
            catch (Exception crmUpdateTaskTypeException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update TaskType");
            }
        }
示例#26
0
        protected async void Form0Submit(RadzenCrm.Models.Crm.Task args)
        {
            try
            {
                var crmCreateTaskResult = await Crm.CreateTask(task);

                DialogService.Close(task);
            }
            catch (Exception crmCreateTaskException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Task!");
            }
        }
示例#27
0
        protected async System.Threading.Tasks.Task Form0Submit(RadzenCrm.Models.Crm.Opportunity args)
        {
            try
            {
                var crmCreateOpportunityResult = await Crm.CreateOpportunity(opportunity);

                DialogService.Close(opportunity);
            }
            catch (System.Exception crmCreateOpportunityException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Opportunity!");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(RadzenCrm.Models.Crm.TaskType args)
        {
            try
            {
                var crmCreateTaskTypeResult = await Crm.CreateTaskType(tasktype);

                DialogService.Close(tasktype);
            }
            catch (System.Exception crmCreateTaskTypeException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new TaskType!");
            }
        }
        protected async void Form0Submit(RadzenCrm.Models.Crm.OpportunityStatus args)
        {
            try
            {
                var crmUpdateOpportunityStatusResult = await Crm.UpdateOpportunityStatus(int.Parse(Id), opportunitystatus);

                DialogService.Close(opportunitystatus);
            }
            catch (Exception crmUpdateOpportunityStatusException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update OpportunityStatus");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(BlazorCrmWasm.Models.Crm.TaskStatus args)
        {
            try
            {
                var crmUpdateTaskStatusResult = await Crm.UpdateTaskStatus(id : Id, taskStatus : taskstatus);

                DialogService.Close(taskstatus);
            }
            catch (Exception crmUpdateTaskStatusException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update TaskStatus");
            }
        }
示例#31
0
		public static CustomerPerson GetForCrmPerson(
			Crm.CrmPerson crmPerson )
		{
			DataRow row = AdoNetSqlHelper.ExecuteRow(
				"GetCustomerPersonFromCrmPerson",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@PersonID", crmPerson.ID )
				) );

			if ( row == null )
			{
				return null;
			}
			else
			{
				CustomerPerson o = new CustomerPerson();
				o.Load( row );

				if ( o.IsEmpty )
				{
					return null;
				}
				else
				{
					return o;
				}
			}
		}
示例#32
0
		public static CustomerCompany GetForCrmAddress( 
			Crm.CrmAddress crmAddress )
		{
			DataRow row = AdoNetSqlHelper.ExecuteRow(
				"GetCustomerCompanyFromCrmAddress",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@AddressID", crmAddress.ID )
				) );

			if ( row == null )
			{
				return null;
			}
			else
			{
				CustomerCompany o = new CustomerCompany();
				o.Load( row );

				if ( o.IsEmpty )
				{
					return null;
				}
				else
				{
					return o;
				}
			}
		}