コード例 #1
0
        public fileName GetLatestMawbDocuments(int TradelaneShipmentId)
        {
            fileName fn             = new fileName();
            var      LatestDocument = dbContext.TradelaneShipmentDocuments.Where(a => a.TradelaneShipmentId == TradelaneShipmentId && a.DocumentType == "MAWB").OrderByDescending(a => a.RevisionNumber).FirstOrDefault();

            if (LatestDocument != null)
            {
                fn.FileName = LatestDocument.DocumentName;
                fn.FilePath = AppSettings.UploadFolderPath + "/Tradelane/" + TradelaneShipmentId + "/" + LatestDocument.DocumentName;
            }

            return(fn);
        }
コード例 #2
0
        public fileName GenerateUnsucessfulShipmentsWithoutService(List <FrayteUserDirectShipment> ShipmentsWithoutService)
        {
            fileName fN   = new fileName();
            var      flag = true;

            //fN.FilePath = @"D:\ProjectFrayte\Frayte\Frayte.WebApi\Manifestedshipments\";

            fN.FilePath = AppSettings.WebApiPath + "Manifestedshipments/Incomplete Shipments Without Courier Service Download.csv";
            fN.FileName = "Incomplete Shipments Without Courier Service Download";

            List <FrayteUploadshipment> FUS    = new List <FrayteUploadshipment>();
            List <FrayteUploadshipment> FUSNew = new List <FrayteUploadshipment>();

            foreach (var Shipment in ShipmentsWithoutService)
            {
                var gmd = new DirectBookingUploadShipmentRepository().GetShipmentErrors(Shipment.ShipmentId, "ECOMMERCE_WS");
                var res = gmd[0];
                FUS.Add(res);
            }
            //new eCommerceUploadShipmentRepository().ErrorLog(gmd, ServiceType);

            //foreach (var g in FUS)
            //{
            //    if (g.Errors.Count > 0)
            //    {
            //        FUSNew.Add(g);
            //    }
            //}

            var Result = new DirectBookingUploadShipmentRepository().UnsuccessfulExcelWrite(FUS, "ECOMMERCE_WS");

            if (fN.FileName.Contains(".csv"))
            {
                fN.FileName = fN.FileName;
            }
            else
            {
                fN.FileName = fN.FileName + ".csv";
            }
            //fN.FilePath = filePath;
            if (Result.Message == "True")
            {
                foreach (var Shipment in ShipmentsWithoutService)
                {
                    new DirectBookingUploadShipmentRepository().DeleteShipment(Shipment.ShipmentId);
                }
            }

            return(fN);
        }
コード例 #3
0
        public fileName GenerateCustomManifest(int ManifestId, string ManifestName)
        {
            if (ManifestName != null && !ManifestName.Contains(".csv"))
            {
                ManifestName = ManifestName + ".csv";
            }

            TrackCustomManifest TCM = new TrackCustomManifest();
            fileName            fN  = new fileName();
            var flag      = true;
            var filePaths = Directory.GetFiles(AppSettings.ManifestFolderPath);
            var filePath  = AppSettings.WebApiPath + "Manifestedshipments/" + ManifestName;

            if (ManifestName != null && ManifestName != "")
            {
                for (int i = 0; i < filePaths.Length; i++)
                {
                    var filePathLength   = filePaths[i].Length;
                    var FileName         = filePaths[i].Split('\\');
                    var FileNameLength   = FileName.Length;
                    var ManifestFileName = FileName[FileNameLength - 1];

                    if (ManifestFileName == ManifestName)
                    {
                        flag        = false;
                        fN.FileName = ManifestName;
                        fN.FilePath = filePath;
                        break;
                    }
                }
            }
            if (flag == true && ManifestName != null && ManifestName != "")
            {
                var gmd = new ManifestRepository().GetMainfestDataUI(ManifestId, ManifestName);

                fN.FileName = new ManifestRepository().ManifestExcelWriteFromUI(gmd, ManifestName);
                if (fN.FileName.Contains(".csv"))
                {
                    fN.FileName = fN.FileName;
                }
                else
                {
                    fN.FileName = fN.FileName + ".csv";
                }
                fN.FilePath = filePath;
            }
            return(fN);
        }
コード例 #4
0
 AVIFileOpenW(out var fileHandle, fileName, OF_WRITE | OF_CREATE, 0);
コード例 #5
0
 ConnectToDatabase(fileName, enckey);
コード例 #6
0
 new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read),
コード例 #7
0
 set => Set(ref fileName, nameof(FileName), value);
コード例 #8
0
ファイル: ZipArchive.cs プロジェクト: doyoulikerock/cspspemu
 public ZipArchive(string fileName, bool caseInsensitive = true) => Load(fileName, caseInsensitive);
コード例 #9
0
 Execute(fileName, arguments == null ? null : string.Join(" ", arguments));
コード例 #10
0
 MoveTypeOperationKind.MoveTypeNamespaceScope => new MoveTypeNamespaceScopeEditor(service, state, fileName, cancellationToken),
コード例 #11
0
ファイル: NamedStream.cs プロジェクト: zbxzc35/BoostTree
			: base(GetHandle(fileName, forWriting, append), forWriting ? FileAccess.Write : FileAccess.Read, true)
コード例 #12
0
 => Initialize(stream, streamOwnership, fileName, endianness, encoding ?? Encoding.Default, blockSize);
コード例 #13
0
ファイル: CsvWriter.cs プロジェクト: FolkerKinzel/CsvTools
 : this(columnsCount, fieldSeparator, options) => _writer = InitStreamWriter(fileName, textEncoding);
コード例 #14
0
 => Initialize(stream, streamOwnership, fileName, endianness, encoding, blockSize);
コード例 #15
0
 public HttpResponseMessage DownloadCustomManifest(fileName fileName)
 {
     return(DownloadCustomManifest(fileName.FileName));
 }
コード例 #16
0
 public DbAttachment(string fileName, Stream dataStream, bool saveData = false) : this() => PopulateFrom(fileName, dataStream, saveData);
コード例 #17
0
 MoveTypeOperationKind.RenameFile => new RenameFileEditor(service, state, fileName, cancellationToken),
コード例 #18
0
 Class296 class = Class466.smethod_24(fileName);
コード例 #19
0
 => new MoveTypeEditor(service, state, fileName, cancellationToken),
コード例 #20
0
 => new RenameFileEditor(service, state, fileName, cancellationToken),
コード例 #21
0
ファイル: IOHelper.cs プロジェクト: mkalinov/DMM365
        internal static string getProjectSubfolderPath(AllSettings settings, subFolders folder, fileName extentionSelector, string fileNameAndExt = "")
        {
            string result = string.Empty;
            string dir    = Path.Combine(settings.ProjectPath, folder.ToString());

            if (Directory.Exists(dir))
            {
                string fileName = folder.ToString();

                switch (extentionSelector.ToString())
                {
                case "pathToFolderFromProjectRoot": result = dir; break;

                case "appendFolderNameNoExt": result = Path.Combine(dir, fileName); break;

                case "appendFolderNameDotXml": result = Path.Combine(dir, fileName + ".xml"); break;

                case "appendFolderNameDotZip": result = Path.Combine(dir, fileName + ".zip"); break;

                case "appendfolderNameDotPSscript": result = Path.Combine(dir, fileName + ".ps1"); break;

                case "dataFileXml": result = Path.Combine(dir, "data.xml"); break;

                case "dataSchemaXml": result = Path.Combine(dir, "data_schema.xml"); break;

                case "contentTypesXml": result = Path.Combine(dir, @"[Content_Types].xml"); break;

                case "log": result = Path.Combine(dir, "Log_" + DateTime.Now.ToLocalTime() + ".txt"); break;

                default:
                    if (GlobalHelper.isValidString(fileNameAndExt))
                    {
                        result = Path.Combine(dir, fileNameAndExt);
                    }
                    break;
                }
            }
            return(result);
        }
コード例 #22
0
 MoveTypeOperationKind.MoveType => (Editor) new MoveTypeEditor(service, state, fileName, cancellationToken),
コード例 #23
0
 _output              = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);
コード例 #24
0
 public FileTransmissionHelper(string fileName, FileMode fileMode) => _fileStream = new FileStream(fileName, fileMode);