示例#1
0
        public async void Close()
        {
            ShowDialog = false;
            await CloseEventCallback.InvokeAsync(null);

            StateHasChanged();
        }
示例#2
0
        protected async Task HandleSubmit()
        {
            var arrivalYearAndMonth = DateTime.Parse(CompletionDateVM.ArrivalYearAndMonth + ".01");
            var reports             = await ReportService.GetAsync(x =>
                                                                   x.ContractNumber.Equals(CompletionDateVM.ContractNumber) &&
                                                                   x.ArrivalYearAndMonth.Equals(arrivalYearAndMonth));

            var neakReports     = reports.Where(x => x.ReportTypeId == 1 && x.Head > 0).ToList();
            var providerReports = reports.Where(x => x.ReportTypeId == 2).ToList();

            foreach (var neakReport in neakReports)
            {
                neakReport.CompletionCertificateDate        = CompletionDateVM.CompletionCertificateDate;
                neakReport.CompletionCertificateSendingDate = CompletionDateVM.CompletionCertificateSendingDate;
                ReportService.Update(neakReport);

                var connectedProviderReports = providerReports.Where(x =>
                                                                     x.RegionId == neakReport.RegionId).ToList();
                foreach (var providerReport in connectedProviderReports)
                {
                    providerReport.CompletionCertificateDate        = CompletionDateVM.CompletionCertificateDate;
                    providerReport.CompletionCertificateSendingDate = CompletionDateVM.CompletionCertificateSendingDate;
                    ReportService.Update(providerReport);
                }
            }
            await ReportService.SaveChangesAsync(AppUser.Instance.FullName);

            ShowDialog = false;
            await CloseEventCallback.InvokeAsync(true);

            await InvokeAsync(StateHasChanged);
        }
示例#3
0
        protected async Task HandleSubmit()
        {
            if (SettlementVMEditContext.Validate())
            {
                var bill = (await BillService.GetAsync(x =>
                                                       x.BillNumber.Equals(BillHeadVM.BillNumber) &&
                                                       x.ContractNumber.Equals(BillHeadVM.ContractNumber))).FirstOrDefault();
                //&&
                //x.ArrivalYearAndMonth.Equals(NewBillHeadVM.ArrivalYearAndMonth))).FirstOrDefault();

                bill.SettlementDate = SettlementVM.SettlementDate;
                bill.BankStatNumber = SettlementVM.BankStatNumber;

                BillService.Update(bill);
                await BillService.SaveChangesAsync(AppUser.Instance.FullName);

                var reports = await ReportService.GetAsync(x => x.BillNumber.Equals(BillHeadVM.BillNumber));

                foreach (var report in reports)
                {
                    report.IsCompleted = true;
                    ReportService.Update(report);
                }
                await ReportService.SaveChangesAsync(AppUser.Instance.FullName);
            }

            ShowDialog = false;
            await CloseEventCallback.InvokeAsync(true);

            await InvokeAsync(StateHasChanged);
        }
示例#4
0
        protected async Task HandleValidSubmit()
        {
            await EmployeeDataService.AddEmployee(Employee);
            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);
            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            await(Product.Id == Guid.Empty ? ProductService.CreateProduct(Product): ProductService.UpdateProduct(Product.Id, Product));
            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#6
0
        protected async Task HandleValidSubmit()
        {
            await CommunityService.CreatePost(CommunityIdSave, Post);

            await CloseEventCallback.InvokeAsync(true);

            ShowDialog = false;
            StateHasChanged();
        }
示例#7
0
        protected async Task HandleValidSubmit()
        {
            ShowDialog = false;
            await scheduleUI.MakeAppointment(queryParamsVM, Schedules, UserName);

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task DeleteEmployee()
        {
            await EmployeeDataService.DeleteEmployee(DeleteId);

            ShowDialog = false;
            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            await _classEntityDataService.DeleteClassEntity(ClassEntity.OwnerIdentityName);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#10
0
        protected async Task HandleValidSubmit()
        {
            Employee.JobCategoryId = int.Parse(JobCategoryId);
            await EmployeeDataService.AddEmployee(Employee);

            await CloseEventCallback.InvokeAsync(true);

            ShowDialog = false;
            StateHasChanged();
        }
示例#11
0
        protected async Task HandleValidSubmit()
        {
            await registerUI.UpdateClient(registerVM, UserName);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            Asset.ClassificationId = Int32.Parse(Asset.ClassificationIdString);
            ShowDialog             = false;
            await AddAssetEventCallback.InvokeAsync(Asset);

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            Article = Article.Id == 0 ? await ArticleService.AddAsync(Article) : await ArticleService.UpdateAsync(Article);

            await JsRuntime.InvokeAsync <object>("HideModal", "articleModal");

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            Role = IsNew ? await RoleService.AddAsync(Role) : await RoleService.UpdateAsync(Role.Id, Role);

            await JsRuntime.InvokeAsync <object>("HideModal", "roleModal");

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#15
0
        protected async Task HandleValidSubmit()
        {
            await TeamService.EditTeamAsync(TeamEditResource);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            await PhotoModelDataService.AddPhotoModel(PhotoModel);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            await ProductService.DeleteProduct(Product.Id);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#18
0
        protected async Task HandleValidSubmit()
        {
            var newDP = Mapper.Map <DataPointForCreationDto>(DataPoint);

            var addedDP = await DataPointDataService.CreateDataPointForQuest(QuestId, newDP);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);
        }
示例#19
0
        protected async Task HandleValidSubmit()
        {
            await AnagraficaDataService.AddAnagrafica(Anagrafica);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#20
0
        protected async Task HandleValidSubmit()
        {
            await CustomerDataService.AddCustomer(Customer);

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#21
0
        //public async Task RegisterChild(BillItemFragment billItemFragment)
        //{
        //    await InvokeAsync(StateHasChanged);
        //}

        protected async Task HandleSubmit()
        {
            if (BillVMEditContext.Validate())
            {
                await BillService.AddOrUpdate(BillHeadVM);

                ShowDialog = false;
                await CloseEventCallback.InvokeAsync(true);
            }
            await InvokeAsync(StateHasChanged);
        }
示例#22
0
        protected async Task HandleValidSubmit()
        {
            if (MessageID == 0)
            {
                await messageUI.Add(MessageVM, MessageID);
            }

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#23
0
        //private void EditContext_InFieldChanged(object sender, FieldChangedEventArgs e)
        //{
        //    if (e.FieldIdentifier.FieldName.Equals("CTValue") || e.FieldIdentifier.FieldName.Equals("MRValue"))
        //    {
        //        var tempSum = 0;
        //        foreach (var item in ReportVM.NewReportItemVMs)
        //        {
        //            tempSum += (item.CTValue ?? 0 + item.MRValue ?? 0);
        //        }
        //        ValueSum = tempSum;
        //    }

        //    StateHasChanged();
        //}

        protected async Task HandleSubmit()
        {
            if (ReportVMEditContext.Validate())
            {
                await ReportService.AddOrUpdateReport(ReportVM);

                ReportVM = await ReportService.GetReportVM(_period, _contractNumber);

                ShowDialog = false;
                await CloseEventCallback.InvokeAsync(true);
            }
            await InvokeAsync(StateHasChanged);
        }
        protected async Task HandleValidSubmit()
        {
            var employee = new Employee();

            Employee.UpdateEntity(employee);
            await AppDbContext.Employees.AddAsync(employee);

            await AppDbContext.SaveChangesAsync();

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#25
0
        protected async Task HandleValidSubmit()
        {
            var response = await ItemService.AddItem(ItemToAdd);

            if (response.IsSuccess)
            {
                ShowDialog = false;
                await CloseEventCallback.InvokeAsync(true);
            }
            else
            {
                this.Error.Show(response.ErrorMessage);
            }

            await InvokeAsync(StateHasChanged);
        }
示例#26
0
        protected async Task DeleteItem()
        {
            var response = await ItemService.DeleteItem(Item.Id);

            if (!response.IsSuccess)
            {
                this.Error.Show(response.ErrorMessage);
            }
            else
            {
                ShowDialog = false;
                await CloseEventCallback.InvokeAsync(true);
            }

            StateHasChanged();
        }
示例#27
0
        protected async Task HandleValidSubmit()
        {
            if (file != null)
            {
                await fileUpload.UploadAsync(file);

                Employee.FileName = file.Name;
            }

            await EmployeeDataService.AddEmployee(Employee);

            await CloseEventCallback.InvokeAsync(true);

            ShowDialog = false;
            StateHasChanged();
        }
        protected async Task AddHousehold()
        {
            if (Household.HouseholdId == 0)
            {
                Household = await HouseholdDataService.AddNewHousehold(Household.Name);
            }
            else
            {
                await HouseholdDataService.UpdateHousehold(Household);
            }

            ShowDialog = false;
            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
示例#29
0
        protected async Task HandleValidSubmit()
        {
            if (this.Store.Id > 0)
            {
                await StoreDataService.UpdateStore(Store);
            }
            else
            {
                await StoreDataService.AddStore(Store);
            }
            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }
        protected async Task HandleValidSubmit()
        {
            //await EmployeeDataService.AddEmployee(Employee);
            expense.ExpenseCategoryId = int.Parse(SelectedCategoryId);
            expense.CurrencyId        = int.Parse(SelectedCurrencyId);
            expense.ExpensesAmount    = double.Parse(EnteredAmt);
            expense.PaymentMethod     = (ExpenseTracker.Data.PaymentMethod)Enum.Parse(typeof(ExpenseTracker.Data.PaymentMethod), SelectedPaymentMethod);
            expense.PaymentType       = (ExpenseTracker.Data.PaymentType)Enum.Parse(typeof(ExpenseTracker.Data.PaymentType), SelectedPaymentType);

            ExpnsesID = "";
            if (string.IsNullOrEmpty(ExpnsesID))
            {
                //expense.Id = -1;
                //await SrvExp.NewExpensesAsync(expense);
                ExpenseTracker.Data.Expense new_expense = new ExpenseTracker.Data.Expense();
                new_expense.ExpenseTitle      = expense.ExpenseTitle;
                new_expense.ExpensesAmount    = expense.ExpensesAmount;
                new_expense.ExpenseDate       = expense.ExpenseDate;
                new_expense.Signature         = expense.Signature;
                new_expense.PaymentType       = expense.PaymentType;
                new_expense.PaymentMethod     = expense.PaymentMethod;
                new_expense.ExpenseCategoryId = expense.ExpenseCategoryId;
                new_expense.CurrencyId        = expense.CurrencyId;
                new_expense.ExpenseDate       = todaysDate.Date;

                if (!string.IsNullOrEmpty(SelectedDetails))
                //dExpense.ExpenseDetail = new Domain.ExpenseDetail { Detail = newExpense.ExpenseDetail };
                {
                    ExpenseTracker.Data.ExpenseDetail expDetails = new ExpenseTracker.Data.ExpenseDetail {
                        Detail = "Some details from code directly."
                    };
                    new_expense.ExpenseDetail = expDetails;
                }

                await SrvExp.NewExpensesAsync(new_expense);
            }
            else
            {
                await SrvExp.EditExpensesAsync(expense, int.Parse(ExpnsesID));
            }

            ShowDialog = false;

            await CloseEventCallback.InvokeAsync(true);

            StateHasChanged();
        }