修改圖資編輯api
This commit is contained in:
parent
d522e4e801
commit
d4d0c4d7b2
@ -226,93 +226,58 @@ namespace FrontendWebApi.ApiControllers
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
|
||||
Dictionary<string, object> graph_manage = new Dictionary<string, object>();
|
||||
|
||||
//edit file
|
||||
//原設計圖修改
|
||||
var new_guid = Guid.NewGuid();
|
||||
|
||||
//刪除原本檔案
|
||||
FolderFunction folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
||||
|
||||
var fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
||||
|
||||
var fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
if (gm.oriSavName != null)
|
||||
{
|
||||
gii.oriFile.CopyTo(stream);
|
||||
FolderFunction folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
||||
}
|
||||
|
||||
string fileName = null;
|
||||
if (gii.oriOrgName != null)
|
||||
{
|
||||
fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
||||
|
||||
var fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
gii.oriFile.CopyTo(stream);
|
||||
}
|
||||
}
|
||||
graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
||||
graph_manage.Add("@oriSavName", fileName);
|
||||
|
||||
fileName = null;
|
||||
//竣工圖修改
|
||||
new_guid = Guid.NewGuid();
|
||||
|
||||
//刪除原本檔案
|
||||
folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
||||
|
||||
fileName = new_guid + "." + gii.donOrgName.Split('.')[1];
|
||||
|
||||
fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
if (gm.donSavName != null)
|
||||
{
|
||||
gii.donFile.CopyTo(stream);
|
||||
var folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
||||
}
|
||||
|
||||
graph_manage.Add("@oriOrgName", gii.donOrgName);
|
||||
graph_manage.Add("@oriSavName", fileName);
|
||||
if (gii.donOrgName != null)
|
||||
{
|
||||
fileName = new_guid + "." + gii.donOrgName.Split('.')[1];
|
||||
|
||||
//edit file
|
||||
//if (gii.oriOrgName != null || gii.donOrgName != null)
|
||||
//{
|
||||
// if (!System.IO.Directory.Exists(graphManageFileSaveAsPath))
|
||||
// System.IO.Directory.CreateDirectory(graphManageFileSaveAsPath);
|
||||
var fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
// if (gm.oriSavName != null && gii.oriOrgName != null)
|
||||
// {
|
||||
// var new_guid = Guid.NewGuid();
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
gii.donFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
// //刪除原本檔案
|
||||
// FolderFunction folderFunction = new FolderFunction();
|
||||
// folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
||||
}
|
||||
graph_manage.Add("@donOrgName", gii.donOrgName);
|
||||
graph_manage.Add("@donSavName", fileName);
|
||||
|
||||
// var fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
||||
|
||||
// var fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
// using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
// {
|
||||
// gii.oriFile.CopyTo(stream);
|
||||
// }
|
||||
|
||||
// graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
||||
// graph_manage.Add("@oriSavName", fileName);
|
||||
// }
|
||||
|
||||
// if (gm.donSavName != null && gii.donOrgName != null)
|
||||
// {
|
||||
// var new_guid = Guid.NewGuid();
|
||||
|
||||
// //刪除原本檔案
|
||||
// FolderFunction folderFunction = new FolderFunction();
|
||||
// folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
||||
|
||||
// var fileName = new_guid + "." + gii.donOrgName.Split('.')[1];
|
||||
|
||||
// var fullPath = Path.Combine(graphManageFileSaveAsPath, fileName);
|
||||
|
||||
// using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
// {
|
||||
// gii.donFile.CopyTo(stream);
|
||||
// }
|
||||
|
||||
// graph_manage.Add("@oriOrgName", gii.donOrgName);
|
||||
// graph_manage.Add("@oriSavName", fileName);
|
||||
// }
|
||||
//}
|
||||
graph_manage.Add("@code", gii.code);
|
||||
graph_manage.Add("@name", gii.name);
|
||||
graph_manage.Add("@main_system_tag", gii.main_system_tag);
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 826 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
Loading…
Reference in New Issue
Block a user