=====* unimarc *=====

- 마크 목록 정리 - [ Marc_mkList.cs ]
기타 풀막을 시방서 마크 목록으로 넘기는 소스코드 정리중.
This commit is contained in:
SeungHo Yang
2021-10-13 18:45:30 +09:00
parent 74108e9d1b
commit 772fbfeab6
28 changed files with 6525 additions and 62 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="UniMarc.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup>
<system.serviceModel>
@@ -20,4 +25,14 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<UniMarc.Properties.Settings>
<setting name="compidx" serializeAs="String">
<value />
</setting>
<setting name="User" serializeAs="String">
<value />
</setting>
</UniMarc.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -70,6 +70,8 @@ namespace WindowsFormsApp1
cmd = _DB.DB_Select_Search("`idx`", "Comp", "comp_name", result[5]);
com_idx = _DB.DB_Send_CMD_Search(cmd).Replace("|", "");
UniMarc.Properties.Settings.Default.compidx = com_idx;
UniMarc.Properties.Settings.Default.User = toolStripLabel1.Text;
this.Text = "[ '" + com_idx + "' : " + result[5] + " - " + result[3] + "]";
}

View File

@@ -12,8 +12,8 @@ namespace UniMarc.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -22,5 +22,29 @@ namespace UniMarc.Properties {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string compidx {
get {
return ((string)(this["compidx"]));
}
set {
this["compidx"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string User {
get {
return ((string)(this["User"]));
}
set {
this["User"] = value;
}
}
}
}

View File

@@ -1,7 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UniMarc.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="compidx" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="User" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,28 @@
namespace UniMarc.Properties {
// 이 클래스를 사용하여 설정 클래스에 대한 특정 이벤트를 처리할 수 있습니다.
// SettingChanging 이벤트는 설정 값이 변경되기 전에 발생합니다.
// PropertyChanged 이벤트는 설정 값이 변경된 후에 발생합니다.
// SettingsLoaded 이벤트는 설정 값이 로드된 후에 발생합니다.
// SettingsSaving 이벤트는 설정 값이 저장되기 전에 발생합니다.
public sealed partial class Settings {
public Settings() {
// // 설정을 저장 및 변경하기 위한 이벤트 처리기를 추가하려면 아래 줄에서 주석 처리를 제거하세요.
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// SettingChangingEvent 이벤트를 처리하는 코드를 여기에 추가하세요.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// SettingsSaving 이벤트를 처리하는 코드를 여기에 추가하세요.
}
}
}

View File

@@ -96,6 +96,8 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
<Compile Include="UserData.cs" />
<Compile Include="납품관리\Bring_Back.cs">
<SubType>Form</SubType>
</Compile>
@@ -1116,7 +1118,7 @@
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">

View File

@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="UniMarc.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup>
<system.serviceModel>
@@ -20,4 +25,14 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<UniMarc.Properties.Settings>
<setting name="compidx" serializeAs="String">
<value />
</setting>
<setting name="User" serializeAs="String">
<value />
</setting>
</UniMarc.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1 +1 @@
dfd41c0905a34d0eb5bb582ce372d3b46680e340
61865f8557e13cf94cb54354fa0d20fa0fb41da2

View File

@@ -127,7 +127,7 @@ namespace ExcelTest
if (a % 10 == 7) { grid[6] = db_data[a]; } // 6: count
if (a % 10 == 8) { grid[7] = db_data[a]; } // 7: pay
if (a % 10 == 9) { grid[8] = db_data[a]; // 8: image_url
List_Book.Rows.Add(grid);
List_Book.Rows.Add(grid);
}
}
chk_Marc();
@@ -773,21 +773,28 @@ namespace ExcelTest
}
bool click_Marc(int row)
{
// 마크 데이터
string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString();
if (Marc_data.Length < 3) { return false; }
List<string> TagNum = new List<string>();
List<string> field = new List<string>();
if (Marc_data.Length < 3) return false;
List<string> TagNum = new List<string>(); // 태그번호
List<string> field = new List<string>(); // 가변길이필드 저장
// 특수기호 육안으로 확인하기 쉽게 변환
Marc_data = Marc_data.Replace("", "▼");
Marc_data = Marc_data.Replace("", "▲");
Marc_data = Marc_data.Replace("₩", "\\");
// string leader = Marc_data.Substring(0, 24);
int startidx = 0;
string[] data = Marc_data.Substring(24).Split('▲');
string[] data = Marc_data.Substring(24).Split('▲'); // 리더부를 제외한 디렉터리, 가변길이필드 저장
// List에 필요한 데이터 집어넣는 작업.
for (int a = 1; a < data.Length - 1; a++)
{
TagNum.Add(data[0].Substring(startidx, 12));
TagNum.Add(data[0].Substring(startidx, 3));
startidx += 12;
field.Add(data[a] + "▲");
@@ -796,8 +803,8 @@ namespace ExcelTest
// List에 들어간 데이터를 메모장에 출력시키는 작업.
for (int a = 0; a < TagNum.Count; a++)
{
string result = TagNum[a].Substring(0, 3);
if (TagNum[a].Substring(0, 3) == "008")
string result = TagNum[a];
if (TagNum[a] == "008")
{
text008.Text = field[a].Replace("▲", "");
data008 = text008.Text;

View File

@@ -14,10 +14,13 @@ namespace UniMarc.마크
public partial class Marc_mkList : Form
{
Marc marc;
string compidx = Properties.Settings.Default.compidx;
public Marc_mkList(Marc _marc)
{
InitializeComponent();
marc = _marc;
}
private void Marc_mkList_Load(object sender, EventArgs e)
@@ -25,6 +28,7 @@ namespace UniMarc.마크
#region panel1 set
rb_basicNum.Checked = true;
rb_autoNum.Enabled = false;
string[] type = { "정리" };
cb_listType.Items.AddRange(type);
@@ -96,64 +100,79 @@ namespace UniMarc.마크
isAuthor = true;
if (cb_FirstBook.SelectedIndex == 0)
isBook = true;
if (listName == "") {
MessageBox.Show("목록명을 입력해주세요!");
return;
}
string[] update_col = {
"compidx", "work_list", "date", "ISBN", "book_name",
"s_book_name1", "s_book_num1", "author", "book_comp", "pubdate",
"price", "tag008", "class_symbol", "author_symbol", "marc",
"imageURL"
};
string[] update_data = {
"", "", "", "", "",
"", "", "", "", "",
"", "", "", "", "",
""
};
int[] row = checkGridRow();
// TODO: 필터링하여 DB에 집어넣는 작업 필요.
for (int a = 0; a < row.Length; a++)
{
#region
string Author = Take_Tag(marc.List_Book.Rows[a].Cells["db_marc"].Value.ToString(), "245d");
string Book = Take_Tag(marc.List_Book.Rows[a].Cells["book_name"].Value.ToString(), "245a");
// ISBN, book_name, s_book_name1, s_book_num1, author, book_comp, pubdate, price, tag008, class_symbol
string[] Search = { "020a", "245a", "440a", "440v", "245d", "260b", "260c", "950b", "008", "056a" };
// string[] Search = { "245d", "245a" };
string[] Marc = Take_Tag(marc.List_Book.Rows[row[a]].Cells["db_marc"].Value.ToString(), Search);
// string Author = Take_Tag(marc.List_Book.Rows[a].Cells["db_marc"].Value.ToString(), "245d");
// string Book = Take_Tag(marc.List_Book.Rows[a].Cells["book_name"].Value.ToString(), "245a");
char aut;
if (Author.Length <= 1)
aut = Author[0];
if (Marc[0].Length <= 1)
aut = Marc[0][0];
else
aut = Author[1];
aut = Marc[0][1];
AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol();
string res_Author = sb.Author_Fillter(Author[0], isAuthor);
string res_Author = sb.Author_Fillter(Marc[0][0], isAuthor);
#region
if (cb_authorType.SelectedIndex == 0) // 이재철 1표
Author = sb.Symbol_1(aut);
Marc[0] = sb.Symbol_1(aut);
if (cb_authorType.SelectedIndex == 1) // 이재철 2표
Author = sb.Symbol_2(aut);
Marc[0] = sb.Symbol_2(aut);
if (cb_authorType.SelectedIndex == 2) // 이재철 3표
Author = sb.Symbol_3(aut);
Marc[0] = sb.Symbol_3(aut);
if (cb_authorType.SelectedIndex == 3) // 이재철 4표
Author = sb.Symbol_4(aut);
Marc[0] = sb.Symbol_4(aut);
if (cb_authorType.SelectedIndex == 4) // 이재철 5표
Author = sb.Symbol_5(aut);
Marc[0] = sb.Symbol_5(aut);
if (cb_authorType.SelectedIndex == 5) // 이재철 6표
Author = sb.Symbol_6(aut);
Marc[0] = sb.Symbol_6(aut);
if (cb_authorType.SelectedIndex == 6) // 이재철 7표
Author = sb.Symbol_7(aut);
Marc[0] = sb.Symbol_7(aut);
if (cb_authorType.SelectedIndex == 7) // 이재철 7표 (동양서저자기호표)
Author = sb.Symbol_7_동서(aut);
Marc[0] = sb.Symbol_7_동서(aut);
if (cb_authorType.SelectedIndex == 8) // 이재철 8표
Author = sb.Symbol_8(aut);
Marc[0] = sb.Symbol_8(aut);
if (cb_authorType.SelectedIndex == 9) // 이재철 8표 (동양서저자기호표)
Author = sb.Symbol_8_동서(aut);
Marc[0] = sb.Symbol_8_동서(aut);
if (cb_authorType.SelectedIndex == 10) // 장일세
Author = sb.Symbol_Jang(Author);
Marc[0] = sb.Symbol_Jang(Marc[0]);
if (cb_authorType.SelectedIndex == 11) // 커터샌본
Author = sb.Cutter(Author);
Marc[0] = sb.Cutter(Marc[0]);
if (cb_authorType.SelectedIndex == 12) // 엘러드
Author = sb.Elord(Author);
Marc[0] = sb.Elord(Marc[0]);
if (cb_authorType.SelectedIndex == 13) // 동서양 저자기호표(국중)
Author = sb.NLK(Author);
#endregion
Author = Author.Replace("|", "");
res_Author += Author + sb.Book_Fillter(Book, isBook);
Marc[0] = sb.NLK(Marc[0]);
#endregion
Marc[0] = Marc[0].Replace("|", "");
res_Author += Marc[0] + sb.Book_Fillter(Marc[1], isBook);
#region
string res_Div = cb_divType.Text + cb_divNum.Text;
@@ -162,40 +181,56 @@ namespace UniMarc.마크
}
}
string Take_Tag(string marc, string search)
string[] Take_Tag(string marc, string[] search)
{
string[] ary = marc.Split('');
string[] tag = res_dir(ary[0].Substring(24));
(string[] jisi, string[] mrc) = jisi_Symbol(tag, ary);
string s_tag = "";
string scan = "";
string[] s_tag = new string[search.Length];
string[] scan = new string[search.Length];
try
{
s_tag = search.Substring(0, 3);
scan = "" + search.Substring(3);
for (int a = 0; a < search.Length; a++)
{
s_tag[a] = search[a].Substring(0, 3);
scan[a] = "" + search[a].Substring(3);
}
}
catch { }
string result = string.Empty;
string[] result = new string[search.Length];
string memo = string.Empty;
for (int a = 0; a < tag.Length; a++)
{
if (tag[a] == s_tag)
for (int b = 0; b < s_tag.Length; b++)
{
string marc_s = mrc[a];
int start = marc_s.IndexOf(scan);
if (start < 0)
result = "";
else
if (tag[a] == s_tag[b])
{
int end = marc_s.IndexOf("", start + 2);
if (end < 0)
result = marc_s.Substring(start);
string tmp = mrc[a];
int start = tmp.IndexOf(scan[b]);
if (start < 0)
{
int tag_num = Convert.ToInt16(s_tag[b]);
if (tag_num < 10)
result[b] = tmp;
else
result[b] = "";
}
else
result = marc_s.Substring(start, end - start);
break;
{
int end = tmp.IndexOf("", start + 2);
if (memo == result[b])
break;
if (end < 0)
result[b] = tmp.Substring(start);
else
result[b] = tmp.Substring(start, end - start);
memo = result[b];
}
}
}
}

View File

@@ -48,6 +48,7 @@
this.Controls.Add(this.label1);
this.Name = "Send_Notice";
this.Text = "Send_Notice";
this.Load += new System.EventHandler(this.Send_Notice_Load);
this.ResumeLayout(false);
this.PerformLayout();

View File

@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UniMarc.Properties;
namespace WindowsFormsApp1.Convenience
{
@@ -18,5 +19,10 @@ namespace WindowsFormsApp1.Convenience
InitializeComponent();
main = _main;
}
private void Send_Notice_Load(object sender, EventArgs e)
{
label1.Text = Settings.Default.User + " | " + Settings.Default.compidx;
}
}
}