Пример #1
0
        protected override async Task <int> saveXML()
        {
            ge_data_file b = new ge_data_file();

            data_xml = new ge_data();

            b.data_xml = xml_data;

            ge_MimeTypes types = new ge_MimeTypes();
            string       stype;

            types.TryGetValue(FileExtension.XML, out stype);
            string filename = Path.GetFileNameWithoutExtension(data_ags.filename);

            data_xml.projectId  = data_ags.projectId;
            data_xml.createdDT  = DateTime.Now;
            data_xml.createdId  = userId;
            data_xml.filename   = filename + FileExtension.XML;
            data_xml.filesize   = xml_data.Length;
            data_xml.filetype   = stype;
            data_xml.filedate   = DateTime.UtcNow;
            data_xml.fileext    = FileExtension.XML;
            data_xml.encoding   = "ascii";
            data_xml.operations = "Read;Download;Update;Delete";
            data_xml.file       = b;

            await _dataService.CreateData(data_xml);

            return(1);
        }
Пример #2
0
        private void saveGISFile(Guid projectId, string filename, string userId, string data_string, string ext)
        {
            ge_data_file b = new ge_data_file();
            ge_data      d = new ge_data();

            b.data_string = data_string;

            ge_MimeTypes types = new ge_MimeTypes();
            string       stype;

            types.TryGetValue(ext, out stype);

            d.projectId  = projectId;
            d.createdDT  = DateTime.Now;
            d.createdId  = userId;
            d.filename   = filename + ext;
            d.filesize   = data_string.Length;
            d.filetype   = stype;
            d.filedate   = DateTime.UtcNow;
            d.fileext    = ext;
            d.encoding   = "ascii";
            d.operations = "Read;Download;Update;Delete";
            d.file       = b;
            _context.ge_data.Add(d);
            _context.SaveChanges();
            //    status = enumStatus.XMLSaved;
        }