| | |
| | | <?xml version="1.0" encoding="utf-8" ?> |
| | | <configuration> |
| | | <appSettings> |
| | | <add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/> |
| | | <add key="pgConn" value="Server=192.168.20.83;Port=5433;Database=moon;User Id=postgres;Password=postgres;"/> |
| | | </appSettings> |
| | | <startup> |
| | | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> |
| | |
| | | } |
| | | } |
| | | |
| | | private static readonly string insertMeta = "insert into lf.sys_meta (name, dirid, depid, verid, type, sizes, cs, scale, resolution, gather, batch, descr, create_user) values (@name, @dirid, @depid, @verid, @type, @sizes, @cs, @scale, @resolution, @gather, @batch, @descr, @create_user) returning id"; |
| | | |
| | | private static readonly string insertMetaFile = "insert into lf.sys_meta_file (name, metaid, fileid, guid, path, sizes, create_user) values (@name, @metaid, @fileid, @guid, @path, @sizes, @create_user)"; |
| | | private static readonly string insertMeta = "insert into lf.sys_meta (eventid, metaid, dirid, depid, verid, name, type, guid, path, sizes, tab, rows, create_user, create_time) values (@eventid, @metaid, @dirid, @depid, @verid, @name, @type, @guid, @path, @sizes, @tab, @rows, @create_user, now()) returning id"; |
| | | |
| | | public static string GetFilePathByGuid(string guid) |
| | | { |
| | |
| | | |
| | | public static int InsertMeta(SysMeta meta) |
| | | { |
| | | // string sql = "INSERT INTO public.data_files(mid, guid, name, ext, path, subs, remark) VALUES (@mid, @guid, @name, @ext, @path, @subs, @remark) returning id"; |
| | | List<DbParameter> list = Tool.GetParams<SysMeta>(insertMeta, meta); |
| | | |
| | | object obj = Helper.GetScalar(insertMeta, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | public static int InsertMetaFile(SysMetaFile metaFile) |
| | | { |
| | | List<DbParameter> list = Tool.GetParams<SysMetaFile>(insertMetaFile, metaFile); |
| | | |
| | | object obj = Helper.ExecuteNonQuery(insertMetaFile, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | |
| | | |
| | | vd.Meta = new SysMeta(); |
| | | vd.Meta.name = fi.Name; |
| | | vd.Meta.dirid = 0; |
| | | vd.Meta.depid = 0; |
| | | vd.Meta.dirid = 1; |
| | | vd.Meta.depid = 1; |
| | | vd.Meta.verid = 0; |
| | | vd.Meta.type = "file"; |
| | | vd.Meta.type = fi.Extension.ToLower().Replace(".", ""); |
| | | vd.Meta.sizes = Tool.SizeToMb(fi.Length); |
| | | vd.Meta.cs = null; |
| | | vd.Meta.scale = null; |
| | | vd.Meta.resolution = null; |
| | | vd.Meta.gather = DateTime.Now; |
| | | vd.Meta.batch = null; |
| | | vd.Meta.descr = null; |
| | | vd.Meta.create_user = Tool.UserId; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | vd.Status = "æå
¥æ°æ®åº..."; |
| | | int metaId = InsertMeta(vd.Meta); |
| | | start = GetSubPath(target, start); |
| | | SysMeta mf = GetMetaFile(vd, start, guid); |
| | | |
| | | int metaId = InsertMeta(mf); |
| | | if (metaId == 0) |
| | | { |
| | | vd.Status = "å
æ°æ®åºéï¼"; |
| | | continue; |
| | | } |
| | | |
| | | start = GetSubPath(target, start); |
| | | SysMetaFile mf = GetMetaFile(vd, metaId, start, guid); |
| | | InsertMetaFile(mf); |
| | | |
| | | vd.Status = "å¤å¶æä»¶..."; |
| | | CopyFile(vd.FilePath, Path.Combine(target, mf.path)); |
| | |
| | | } |
| | | } |
| | | |
| | | private static SysMetaFile GetMetaFile(ViewData vd, int metaId, int subPath, string guid) |
| | | private static SysMeta GetMetaFile(ViewData vd, int subPath, string guid) |
| | | { |
| | | SysMetaFile mf = new SysMetaFile(); |
| | | SysMeta mf = new SysMeta(); |
| | | mf.eventid = Guid.NewGuid().ToString(); |
| | | mf.metaid = 0; |
| | | mf.dirid = vd.Meta.dirid; |
| | | mf.depid = vd.Meta.depid; |
| | | mf.verid = vd.Meta.verid; |
| | | mf.name = vd.Meta.name; |
| | | mf.metaid = metaId; |
| | | mf.fileid = 0; |
| | | mf.type = vd.Meta.type; |
| | | mf.guid = guid; |
| | | mf.path = subPath + "\\" + mf.name; |
| | | mf.sizes = vd.Meta.sizes; |
| | | mf.tab = null; |
| | | mf.rows = 0; |
| | | mf.create_user = vd.Meta.create_user; |
| | | |
| | | return mf; |
| | |
| | | <Compile Include="CS\ModelHandler.cs" /> |
| | | <Compile Include="Model\NtstWeb.cs" /> |
| | | <Compile Include="CS\PostgreHelper.cs" /> |
| | | <Compile Include="Model\SysMetaFile.cs" /> |
| | | <Compile Include="Model\ViewData.cs" /> |
| | | <Compile Include="LoginWin.xaml.cs"> |
| | | <DependentUpon>LoginWin.xaml</DependentUpon> |
| | |
| | | |
| | | namespace DataLoader.Model |
| | | { |
| | | /// <summary> |
| | | /// å
æ°æ® |
| | | /// </summary> |
| | | public class SysMeta |
| | | { |
| | | public int id { set; get; } |
| | | |
| | | public string name { set; get; } |
| | | public string eventid { set; get; } |
| | | |
| | | public int metaid { set; get; } |
| | | |
| | | public int dirid { set; get; } |
| | | |
| | |
| | | |
| | | public int verid { set; get; } |
| | | |
| | | public string name { set; get; } |
| | | |
| | | public string type { set; get; } |
| | | |
| | | public string guid { set; get; } |
| | | |
| | | public string path { set; get; } |
| | | |
| | | public double sizes { set; get; } |
| | | |
| | | public string cs { set; get; } |
| | | public string tab { set; get; } |
| | | |
| | | public string scale { set; get; } |
| | | |
| | | public string resolution { set; get; } |
| | | |
| | | public DateTime gather { set; get; } |
| | | |
| | | public string batch { set; get; } |
| | | |
| | | public string descr { set; get; } |
| | | public int rows { set; get; } |
| | | |
| | | public int create_user { set; get; } |
| | | |
| | |
| | | |
| | | public DateTime update_time { set; get; } |
| | | |
| | | public string bak { set; get; } |
| | | |
| | | public string geom { set; get; } |
| | | |
| | | public string tab { set; get; } |
| | | |
| | | public int rows { set; get; } |
| | | |
| | | public SysMeta() { } |
| | | } |
| | |
| | | <div class="loginpwd" style='width: 400px; margin-right: 20px; margin-top: 30px; border-bottom: 1px solid #fff;'> |
| | | <span style="visibility: hidden;">请</span><label for="password">å¯ç ï¼</label> |
| | | <input class="required" placeholder="请è¾å
¥å¯ç " type="password" id="password" size="20" tabindex="2" |
| | | accesskey="p" autocomplete="off" name="password" value="Admin@123" /><span id="capslock-on" style="display: none;"> |
| | | accesskey="p" autocomplete="off" name="password" value="Admin@1234_lf" /><span id="capslock-on" style="display: none;"> |
| | | <i class="fa fa-exclamation-circle"></i> |
| | | <span>CAPSLOCK key is turned on!</span> |
| | | </span> |
| | |
| | | </section> |
| | | </div> |
| | | <script> |
| | | var url = "http://127.0.0.1:12316/server/"; |
| | | var url = "http://192.168.20.83:12316/server/"; |
| | | |
| | | var isBusy = false; |
| | | |