private async void UpdateBranch()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();

            if (SelectedBranch != null)
            {
                if (SelectedBranch.id > 0)
                {
                    Branch i = await BranchRestService.UpdateBranchAsync(mapper, SelectedBranch);

                    if (i.id > 0)
                    {
                        _ = ShowMessageDialg("Branch Update", "Branch Updated Successfully", MsgDialogType.infor);
                        RizeSyncEvent();
                    }
                    else
                    {
                        _ = ShowMessageDialg("Branch Update", "Can't Save Branch", MsgDialogType.error);
                        return;
                    }
                }
                else
                {
                    _ = ShowMessageDialg("Branch Update", "Please Select Branch Before Update", MsgDialogType.warrning);
                    return;
                }
            }
            else
            {
                _ = ShowMessageDialg("Branch Update", "Please Select Branch Before Update", MsgDialogType.warrning);
                return;
            }
        }
Beispiel #2
0
        private async void SaveBranch()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();

            if (SelectedBank == null)
            {
                _ = ShowMessageDialg("New Branch Account Creation", "Can't Save Branch Account, Bank not selected", MsgDialogType.error);
            }
            if (SelectedBranchAcc.IsValidBranchAccount())
            {
                SelectedBranchAcc.bank   = SelectedBank;
                SelectedBranchAcc.branch = loggedUser.LoggedUser.branch;
                BranchAccount b = await BranchRestService.CreateBranchAccountAsync(mapper, SelectedBranchAcc);

                if (b.id > 0)
                {
                    _ = ShowMessageDialg("New Branch Account Creation", "Branch Account Created Successfully", MsgDialogType.infor);
                    RizeSyncEvent();
                    Initialize();
                }
                else
                {
                    _ = ShowMessageDialg("New Branch Account Creation", "Can't Save Branch Account", MsgDialogType.error);
                    return;
                }
            }
            else
            {
                _ = ShowMessageDialg("New Branch Account Creation", "Invalid Branch Account Details or Already Exist Branch Account", MsgDialogType.warrning);
                return;
            }
        }
        private async void LoadBranchNames()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();

            branches = await BranchRestService.GetAllBranchAsync(mapper);

            BranchNames = branches.Select(b => b.name).ToList();
        }
Beispiel #4
0
        private async void LoadAllItem()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();

            Branches = await BranchRestService.GetAllBranchAsync(mapper);

            Banks = await BankRestService.GetAllBankAsync(mapper);

            BrancheAcs = await BranchRestService.GetAllBranchAccountAsync(mapper, loggedUser.LoggedUser.branch.id);

            Measures = await ItemRestService.GetAllUnitAsync(mapper);
        }
Beispiel #5
0
        private async void LoadAutoData()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();
            ObservableCollection <SupplierCriteria> sus = await SupplierRestService.GetSupplierAttribsByBranchIdAsync(mapper, loggedUser.LoggedUser.branch.id);

            SupSugges = new SupplierSuggestionProvider()
            {
                supplierCriterias = sus
            };
            ObservableCollection <ItemCriteria> its = await ItemRestService.GetItemAttribsByBranchIdAsync(mapper);

            ItmSugges = new ItemSuggestionProvider()
            {
                itemCriterias = its, DisplayMember = DisplayMem
            };
            ObservableCollection <BranchAccount> bacs = await BranchRestService.GetAllBranchAccountAsync(mapper, loggedUser.LoggedUser.id);

            BacSugges = new BranchAccountSuggestionProvider()
            {
                brancgAcCriterias = bacs
            };
        }
        private async void SaveBranch()
        {
            IRestDataMapper mapper = containerExtension.Resolve <IRestDataMapper>();

            if (SelectedBranch.IsValidBranch())
            {
                Branch b = await BranchRestService.CreateBranchAsync(mapper, SelectedBranch);

                if (b.id > 0)
                {
                    b.code = $"BRN{b.id}";
                    b      = await BranchRestService.UpdateBranchAsync(mapper, b);

                    if (b.id > 0)
                    {
                        _ = ShowMessageDialg("New Branch Creation", "Branch Created Successfully", MsgDialogType.infor);
                        RizeSyncEvent();
                        Initialize();
                    }
                    else
                    {
                        _ = ShowMessageDialg("New Branch Creation", "Can't Branch Code", MsgDialogType.error);
                        return;
                    }
                }
                else
                {
                    _ = ShowMessageDialg("New Branch Creation", "Can't Save Branch", MsgDialogType.error);
                    return;
                }
            }
            else
            {
                _ = ShowMessageDialg("New Branch Creation", "Invalid Branch Details or Already Exist Branch", MsgDialogType.warrning);
                return;
            }
        }