Beispiel #1
0
        public async Task LoadData()
        {
            VMAssignAction vm = BindingContext as VMAssignAction;
            await vm.LoadAssignActionStakeholderList();

            LoadAssignAction();
        }
Beispiel #2
0
        public AssignAction()
        {
            InitializeComponent();

            GetAction = 0;
            LoadData();

            btnSearchPAS.Clicked += async(object sender, EventArgs e) => {
                (BindingContext as VMAssignAction).CurrentMode = "EDIT_STAKE";
                GlobalVariables.StakeholderType = "P";
                GetAction = 2;
                await Navigation.PushAsync(new AssignActionStakeholderList());
            };

            btnSearchSAS.Clicked += async(object sender, EventArgs e) => {
                (BindingContext as VMAssignAction).CurrentMode = "EDIT_STAKE";
                GlobalVariables.StakeholderType = "S";
                GetAction = 2;
                await Navigation.PushAsync(new AssignActionStakeholderList());
            };

            btnSearchIS.Clicked += async(object sender, EventArgs e) => {
                (BindingContext as VMAssignAction).CurrentMode = "EDIT_STAKE";
                GlobalVariables.StakeholderType = "I";
                GetAction = 2;
                await Navigation.PushAsync(new AssignActionStakeholderList());
            };

            btnNext.Clicked += (object sender, EventArgs e) => {
                (BindingContext as VMAssignAction).CurrentIndex++;
                VMAssignAction vm = BindingContext as VMAssignAction;
                vm.LoadAssignActionStakeholderList();
                LoadAssignAction();
            };

            btnPrev.Clicked += (object sender, EventArgs e) => {
                (BindingContext as VMAssignAction).CurrentIndex--;
                VMAssignAction vm = BindingContext as VMAssignAction;
                vm.LoadAssignActionStakeholderList();
                LoadAssignAction();
            };

            btnAddMore.Clicked += (object sender, EventArgs e) => {
                VMAssignAction vm = BindingContext as VMAssignAction;
                vm.ClearAll();
                vm.ChangeControlsState(true);
                this.PrimaryActionStakeholderPicker.Items.Clear();
                this.SecondaryActionStakeholderPicker.Items.Clear();
                this.InfoActionStakeholderPicker.Items.Clear();
                GlobalVariables.AssignActionID++;
            };

            btnCancel.Clicked += (object sender, EventArgs e) => {
                VMAssignAction vm = BindingContext as VMAssignAction;
                if (vm.CurrentMode == "ADD")
                {
                    this.txtAction.Text     = "";
                    this.dtpActionDate.Date = DateTime.Now;
                    this.PrimaryActionStakeholderPicker.Items.Clear();
                    this.SecondaryActionStakeholderPicker.Items.Clear();
                    this.InfoActionStakeholderPicker.Items.Clear();
                }
            };
        }