Exemple #1
0
        public async Task <List <SubProjectFile> > ReturnListOfSubProjectFiles(string v_sSubProjectNo)
        {
            SubProjectFilesResult sfResult   = null;
            List <SubProjectFile> sfFileList = new List <SubProjectFile>();

            try
            {
                sfResult = await DependencyService.Get <IWcfExt116>().ReturnSubProjectFilesAsync(
                    this.m_cCompanyName,
                    v_sSubProjectNo,
                    Settings.p_sSetting_AuthID,
                    Session.Token);

                if (sfResult != null)
                {
                    if (sfResult.bSuccessfull == true)
                    {
                        sfFileList = new List <SubProjectFile>(sfResult.pdSubProjectFiles);
                    }
                }

                return(sfFileList);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + " - SubProjectNo(" + v_sSubProjectNo + ")");
            }
        }
Exemple #2
0
        public async Task <SubProjectFilesResult> ReturnSubProjectFilesAsync(
            string v_sCompanyName,
            string v_sProjectNo,
            string v_sAuthID,
            string v_sToken)
        {
            m_wcfClient = new WcfExt116.ServiceClient();
            SubProjectFilesResult result = new SubProjectFilesResult();

            try
            {
                WcfExt116.SubProjectFilesResult sResult = await m_wcfClient.ReturnSubProjectFilesAsync(
                    v_sCompanyName,
                    v_sProjectNo,
                    v_sAuthID,
                    v_sToken);

                if (sResult.bSuccessfull == true)
                {
                    result.bSuccessfull      = sResult.bSuccessfull;
                    result.pdSubProjectFiles = new ObservableCollection <SubProjectFile>();
                    foreach (WcfExt116.SubProjectFile o in sResult.pdSubProjectFiles)
                    {
                        SubProjectFile oSPF = new SubProjectFile();
                        oSPF.bFileDeleted = o.bFileDeleted;
                        oSPF.Comments     = o.Comments;
                        oSPF.FileName     = o.FileName;
                        oSPF.ModifiedDate = o.ModifiedDate;
                        result.pdSubProjectFiles.Add(oSPF);
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }