コード例 #1
0
ファイル: VMAssignAction.cs プロジェクト: D2KXamarin/CMA
        public async Task LoadAssignActionStakeholderList()
        {
            var result = await APIRequest.Instance.GetLoadAssignActionStakeholderList(new AssignActionRequestModel {
                CustomerEntityID = GlobalVariables.CustomerEntityID,
                RemarkID         = GlobalVariables.RemarkID
            });

            if (result != null)
            {
                try {
                    AssignActionResponseModel responseModelList = JsonConvert.DeserializeObject <AssignActionResponseModel> (result);
                    SQLiteDatabase.Instance.InsertAssignActionStakHolderDetails(responseModelList);

                    if (responseModelList.AssignAction == null)
                    {
                        GlobalVariables.AssignActionID = 1;
                        CurrentMode = "ADD";
                    }
                    else
                    {
                        PAssignActionList = new ObservableCollection <AssignActionModel> (responseModelList.AssignAction);
                        //CurrentIndex = 0;
                        CurrentMode = "EDIT";
                    }
                } catch {
                }
            }
        }
コード例 #2
0
        public async Task LoadAssignActionStakeholderList()
        {
            var result = await APIRequest.Instance.GetLoadAssignActionStakeholderList(new AssignActionRequestModel {
                CustomerEntityID = GlobalVariables.CustomerEntityID,
                RemarkID         = GlobalVariables.RemarkID
            });

            if (result != null)
            {
                try {
                    AssignActionResponseModel responseModelList = JsonConvert.DeserializeObject <AssignActionResponseModel> (result);
                    SQLiteDatabase.Instance.InsertAssignActionStakHolderDetails(responseModelList);
                } catch {
                }
            }
        }
コード例 #3
0
        public bool InsertAssignActionStakHolderDetails(AssignActionResponseModel assignActionResponseModel)
        {
            try {
                database.CreateTable <AssignActionModel> ();
                database.CreateTable <AllocatedStakeholder> ();
                database.CreateTable <AssignedStakeholder> ();
                try {
                    database.DeleteAll <AssignActionModel> ();
                    database.DeleteAll <AllocatedStakeholder> ();
                    database.DeleteAll <AssignedStakeholder> ();
                } catch {
                }

                if (assignActionResponseModel.AssignAction != null)
                {
                    foreach (AssignActionModel am in assignActionResponseModel.AssignAction)
                    {
                        database.Insert(am);
                    }
                }

                if (assignActionResponseModel.AllocatedStakeholder != null)
                {
                    foreach (AllocatedStakeholder am in assignActionResponseModel.AllocatedStakeholder)
                    {
                        database.Insert(am);
                    }
                }

                if (assignActionResponseModel.AssignedStakeholder != null)
                {
                    foreach (AssignedStakeholder am in assignActionResponseModel.AssignedStakeholder)
                    {
                        database.Insert(am);
                    }
                }


                return(true);
            } catch {
                return(false);
            }
        }