프로젝트

일반

사용자정보

개정판 b6abb7b8

IDb6abb7b83afe7dd0d62d5025d41ad07f2284ba09
상위 135728e1
하위 eef9d0c2

유성호이(가) 일년 이상 전에 추가함

issue #0000
- excel userlist db->information userlist로 변경
- id2 project db 조회 함수 추가-global
- basecontroller 에 id2 project db 조회 함수 적용

Change-Id: I560b546852173c40e4fc351a799842327f10447f

차이점 보기:

ID2.Manager/ID2.Manager.Common/Globals.cs
7 7
using System.IO;
8 8
using System.Security.Cryptography;
9 9
using System.Text.RegularExpressions;
10
using System.Configuration;
11
using System.Xml.Linq;
12
using System.Xml.XPath;
10 13

  
11 14
namespace ID2.Manager.Common
12 15
{
......
74 77
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "ID2Manager");
75 78
            }
76 79
        }
80

  
81
        public static string GetProjectDBConnstr()
82
        {
83
            string prjDBPath = string.Empty;
84

  
85
            try
86
            {
87
                var userConfigPath = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath;
88
                if (File.Exists(userConfigPath))
89
                {
90
                    XDocument xdoc = XDocument.Load(userConfigPath);
91
                    XElement id2xElement = xdoc.XPathSelectElements("//setting[@name=\"ID2SQLiteInfo\"]").FirstOrDefault();
92
                    if (id2xElement != null)
93
                    {
94
                        if (!string.IsNullOrEmpty(id2xElement.Value))
95
                        {
96
                            if (File.Exists(id2xElement.Value))
97
                            {
98
                                prjDBPath = String.Format(ConfigurationManager.AppSettings["ID2SQLite"], id2xElement.Value);
99
                                return prjDBPath;
100
                            }
101
                        }
102
                    }
103
                }
104

  
105
                var appConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ConfigurationManager.AppSettings["ID2SQLiteInfo"]);
106
                if (File.Exists(appConfigPath))
107
                {
108
                    prjDBPath = String.Format(ConfigurationManager.AppSettings["ID2SQLite"], appConfigPath);
109
                    return prjDBPath;
110
                }
111
            }
112
            catch (Exception ex)
113
            {
114
                throw ex;
115
            }
116

  
117
            return prjDBPath;
118
        }
119

  
120
        public static bool IsProjectDBConnstr()
121
        {
122
            bool isDBPath = false;
123

  
124
            try
125
            {
126
                isDBPath = !string.IsNullOrEmpty(GetProjectDBConnstr());
127
            }
128
            catch (Exception ex)
129
            {
130
                throw ex;
131
            }
132
            //catch
133
            //{
134
            //    Program.logger.Error($"An exception occurred from {MethodBase.GetCurrentMethod().Name}", ex);
135
            //}
136

  
137
            return isDBPath;
138
        }
77 139
    }
78 140
}
ID2.Manager/ID2.Manager.Common/Helpers/ID2Excel.cs
4 4
using System.Linq;
5 5
using System.Text;
6 6
using System.Threading.Tasks;
7
using GemBox.Spreadsheet;
8
using ID2.Manager.Controller.Controllers;
7

  
9 8
using System.IO;
10 9
using System.IO.Compression;
11 10

  
11
using GemBox.Spreadsheet;
12

  
12 13
namespace ID2.Manager.Common.Helpers
13 14
{
14 15
    public class ID2Excel :IDisposable
......
32 33
            }
33 34
        }
34 35

  
35
        public ID2Excel()
36
        public ID2Excel(List<UserInfo> users)
36 37
        {
37
            UserlList = new UserController().GetAllUserInfo().ToList();
38
            UserlList = users;
38 39
        }
39 40

  
40 41
        private UserInfo GetUser(string user)
ID2.Manager/ID2.Manager.Common/ID2.Manager.Common.csproj
51 51
  </PropertyGroup>
52 52
  <ItemGroup>
53 53
    <Reference Include="System" />
54
    <Reference Include="System.Configuration" />
54 55
    <Reference Include="System.Core" />
55 56
    <Reference Include="System.Drawing" />
56 57
    <Reference Include="System.Windows.Forms" />
......
85 86
    </PackageReference>
86 87
  </ItemGroup>
87 88
  <ItemGroup>
88
    <ProjectReference Include="..\ID2.Manager.Controller\ID2.Manager.Controller.csproj">
89
      <Project>{83DACC10-43B1-4E38-ABEF-E5EF9492A82D}</Project>
90
      <Name>ID2.Manager.Controller</Name>
91
    </ProjectReference>
92 89
    <ProjectReference Include="..\ID2.Manager.Data\ID2.Manager.Data.csproj">
93 90
      <Project>{b17c0800-40f4-40e2-b5a6-d366d9c2e0f6}</Project>
94 91
      <Name>ID2.Manager.Data</Name>
ID2.Manager/ID2.Manager.Controller/Controllers/BaseController.cs
9 9

  
10 10
using ID2.Manager.Dapper;
11 11
using ID2.Manager.Data.Models;
12
using ID2.Manager.Common;
12 13

  
13 14
namespace ID2.Manager.Controller.Controllers
14 15
{
......
26 27
        public BaseController(ID2ProjectInfo id2Info)
27 28
        {
28 29
            this._MSSQLCONNSTR = ConfigurationManager.ConnectionStrings["ID2Manager"].ConnectionString;
29
            this._SQLITECONNSTR = String.Format(ConfigurationManager.AppSettings["ID2SQLite"], Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ConfigurationManager.AppSettings["ID2SQLiteInfo"]));
30
            this._SQLITECONNSTR = Globals.GetProjectDBConnstr(); //String.Format(ConfigurationManager.AppSettings["ID2SQLite"], Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ConfigurationManager.AppSettings["ID2SQLiteInfo"]));
30 31
            this._MARKUSCONNSTR = ConfigurationManager.ConnectionStrings["Markus"].ToString();
31 32

  
32 33
            if (id2Info == null || id2Info.Id <= 0)
ID2.Manager/ID2.Manager.Controller/ID2.Manager.Controller.csproj
71 71
    <Compile Include="Properties\AssemblyInfo.cs" />
72 72
  </ItemGroup>
73 73
  <ItemGroup>
74
    <ProjectReference Include="..\ID2.Manager.Common\ID2.Manager.Common.csproj">
75
      <Project>{d5abdf40-ca97-4b5a-a08c-63d7d53bca3a}</Project>
76
      <Name>ID2.Manager.Common</Name>
77
    </ProjectReference>
74 78
    <ProjectReference Include="..\ID2.Manager.Dapper\ID2.Manager.Dapper.csproj">
75 79
      <Project>{6d22aaa8-d584-43f4-b71c-b32c5c9288ed}</Project>
76 80
      <Name>ID2.Manager.Dapper</Name>
ID2.Manager/ID2.Manager/Main.cs
1274 1274

  
1275 1275
            if (dialogResult == DialogResult.OK)
1276 1276
            {
1277
                using (ID2Excel excel = new ID2Excel())
1277
                using (ID2Excel excel = new ID2Excel(informations.UserList.ToList()))
1278 1278
                {
1279 1279
                    var result = excel.ExcelDataImport(form.SelectItems);
1280 1280

  
......
1310 1310
                    //Error Message
1311 1311
                    StringBuilder sbErrMsg = new StringBuilder();
1312 1312

  
1313
                    using(ID2Excel excel = new ID2Excel())
1313
                    using(ID2Excel excel = new ID2Excel(informations.UserList.ToList()))
1314 1314
                    {
1315 1315
                       var result = excel.GemboxImport(ofd.FileName);
1316 1316

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)