protected async void Load()
        {
            canEdit = true;

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

            opportunitystatus = crmGetOpportunityStatusByIdResult;
        }
예제 #2
0
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var crmGetOpportunityStatusByIdResult = await Crm.GetOpportunityStatusById(Id);

            opportunitystatus = crmGetOpportunityStatusByIdResult;
        }
예제 #3
0
        public async Task <Models.Crm.OpportunityStatus> CreateOpportunityStatus(Models.Crm.OpportunityStatus opportunityStatus)
        {
            OnOpportunityStatusCreated(opportunityStatus);

            context.OpportunityStatuses.Add(opportunityStatus);
            context.SaveChanges();

            return(opportunityStatus);
        }
        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");
            }
        }
예제 #5
0
        protected async System.Threading.Tasks.Task Form0Submit(RadzenCrm.Models.Crm.OpportunityStatus args)
        {
            try
            {
                var crmUpdateOpportunityStatusResult = await Crm.UpdateOpportunityStatus(Id, opportunitystatus);

                DialogService.Close(opportunitystatus);
            }
            catch (System.Exception crmUpdateOpportunityStatusException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update OpportunityStatus");
            }
        }
        protected async void GridDeleteButtonClick(MouseEventArgs args, RadzenCrm.Models.Crm.OpportunityStatus data)
        {
            try
            {
                var crmDeleteOpportunityStatusResult = await Crm.DeleteOpportunityStatus(data.Id);

                if (crmDeleteOpportunityStatusResult != null)
                {
                    grid0.Reload();
                }
            }
            catch (Exception crmDeleteOpportunityStatusException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to delete OpportunityStatus");
            }
        }
        protected async void Grid0RowSelect(RadzenCrm.Models.Crm.OpportunityStatus args)
        {
            var result = await DialogService.OpenAsync <EditOpportunityStatus>("Edit Opportunity Status", new Dictionary <string, object>() { { "Id", args.Id } });

            await InvokeAsync(() => { StateHasChanged(); });
        }
예제 #8
0
        public async Task <Models.Crm.OpportunityStatus> UpdateOpportunityStatus(int?id, Models.Crm.OpportunityStatus opportunityStatus)
        {
            OnOpportunityStatusUpdated(opportunityStatus);

            var item = context.OpportunityStatuses
                       .Where(i => i.Id == id)
                       .First();
            var entry = context.Entry(item);

            entry.CurrentValues.SetValues(opportunityStatus);
            entry.State = EntityState.Modified;
            context.SaveChanges();

            return(opportunityStatus);
        }
예제 #9
0
 partial void OnOpportunityStatusUpdated(Models.Crm.OpportunityStatus item);
예제 #10
0
        public async Task <Models.Crm.OpportunityStatus> CancelOpportunityStatusChanges(Models.Crm.OpportunityStatus item)
        {
            var entity = context.Entry(item);

            entity.CurrentValues.SetValues(entity.OriginalValues);
            entity.State = EntityState.Unchanged;

            return(item);
        }
예제 #11
0
 partial void OnOpportunityStatusGet(Models.Crm.OpportunityStatus item);
 protected async void Load()
 {
     opportunitystatus = new RadzenCrm.Models.Crm.OpportunityStatus();
 }
예제 #13
0
        public async Task <Models.Crm.OpportunityStatus> UpdateOpportunityStatus(int?id, Models.Crm.OpportunityStatus opportunityStatus)
        {
            OnOpportunityStatusUpdated(opportunityStatus);

            var item = context.OpportunityStatuses
                       .Where(i => i.Id == id)
                       .FirstOrDefault();

            if (item == null)
            {
                throw new Exception("Item no longer available");
            }
            var entry = context.Entry(item);

            entry.CurrentValues.SetValues(opportunityStatus);
            entry.State = EntityState.Modified;
            context.SaveChanges();

            return(opportunityStatus);
        }
 protected async System.Threading.Tasks.Task Load()
 {
     opportunitystatus = new RadzenCrm.Models.Crm.OpportunityStatus();
 }