Files
Groupware/SubProject/FPJ0000/Util.cs
2023-01-03 11:19:37 +09:00

108 lines
3.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FPJ0000
{
public static class Util
{
public static void openjobreportitem(int idx)
{
//업무일지 관려 ㄴ폴더 열기 -- 210708
OpenPath("JobReportItem", idx.ToString());
}
public static void openEboarditemPath(int idx)
{
//전자시 ㄹ업무일지 관련 폴더 열긴 -- 210708
OpenPath("EBoardJobItem", idx.ToString());
}
static void OpenPath(string group, string dataidx, Boolean openexplore = false)
{
//전자시 ㄹ업무일지 관련 폴더 열긴 -- 210708
var datapath = FCOMMON.DBM.getCodeSavlue("55", "01");
var serverpath = System.IO.Path.Combine(datapath, "Data", group);
if (System.IO.Directory.Exists(serverpath) == false)
{
try
{
System.IO.Directory.CreateDirectory(serverpath);
}
catch (Exception ex)
{
FCOMMON.Util.MsgE("기본 폴더 를 생성하지 못했습니다\n" + ex.Message);
}
}
var path = System.IO.Path.Combine(serverpath, dataidx);
if (System.IO.Directory.Exists(path) == false)
{
try
{
System.IO.Directory.CreateDirectory(path);
//string[] subdir = new string[] { "Source", "Document", "Draw", "Estimate" };
//foreach (var dir in subdir)
// System.IO.Directory.CreateDirectory(path + "\\" + dir);
}
catch (Exception eX)
{
FCOMMON.Util.MsgE("저장소 생성실패\n" + eX.Message);
return;
}
}
if (openexplore)
FCOMMON.Util.RunExplorer(path);
else
{
var f = new FCOMMON.fFileExplorer(path);
f.ShowDialog();
}
}
public static void OpenProjectPath(string tbPath)
{
if (tbPath.StartsWith("\\") == false)
{
if (tbPath.StartsWith("/")) tbPath = tbPath.Replace("/", "\\");
else tbPath = "\\" + tbPath;
}
//\\10.131.32.29\Data
var datapath = FCOMMON.DBM.getCodeSavlue("55", "01");
var serverpath = System.IO.Path.Combine(datapath, "Data", "Project");
if (System.IO.Directory.Exists(serverpath) == false)
{
FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" +
serverpath);
return;
}
var path = serverpath + tbPath;
if (System.IO.Directory.Exists(path) == false)
{
try
{
System.IO.Directory.CreateDirectory(path);
string[] subdir = new string[] { "Source", "Document", "Draw", "Estimate" };
foreach (var dir in subdir)
System.IO.Directory.CreateDirectory(path + "\\" + dir);
}
catch (Exception eX)
{
FCOMMON.Util.MsgE("프로젝트 저장소 생성실패\n" + eX.Message);
return;
}
}
FCOMMON.Util.RunExplorer(path);
}
}
}