Compare commits

37 Commits

Author SHA1 Message Date
b13f01a3dd 마크정리->마크파일불러오기(fullparser 를 적용하여 데이터를 추출 함)
DLS 조회입력 화면 null 개체오류 분석 : 해당 화면은 고친적 없는 원본화면  https://reading.jnei.go.kr  페이지를 열어서 작업하는 것을 추정되나 해당 사이트가 접속이 되지 않은 것이 원인이됨 (프로그램이 멈추지 않고 오류 메세지가 나오도록 수정 함)
마크등급용 전용컨트롤 생성 및 공유
Grade - E 추가
마크목록 데이터 조회시 (ISBN검색결과 서명,저자,출판사,설명,URL 추가 )
2026-02-25 23:42:49 +09:00
5978d45af6 마크정리->마크파일불러오기(fullparser 를 적용하여 데이터를 추출 함) 2026-02-25 22:20:45 +09:00
3a503dda6d ISBN검색시 지연시간 추가 (설정에 저장됨)
ISBN검색중 알라딘의 경우 도서정보(html),URL 가 추가됨
ISBN검색결과  도서명, 저자, 출판사, 도서정보,URL이  DB에 저장되도록 함
2026-02-24 22:57:34 +09:00
c813ffe9e6 등급저장기능 추가, 비고기능 추가 2026-02-23 23:49:30 +09:00
c5571a98ab 유사본 저장시 마크외 정보도 저장되도록 함 2026-02-23 23:37:21 +09:00
3cfd7ff12c Messagebox 모두 변경 2026-02-23 23:11:54 +09:00
1b77fd02b0 마크작성기능 완료, fullmarc 해석기 1차완료 2026-02-23 22:29:01 +09:00
5271f9f1c3 마크파서 추가,, 신규 마크 추가 테스트 중. 2026-02-23 00:31:59 +09:00
6add9a00bc 마크편집창 및 신규생성 수정 중 2026-02-22 13:33:12 +09:00
c2c9122c55 편집기 통합작업 중, 등급 미적용 데이터 수정 2026-02-22 01:04:35 +09:00
ad866c1384 마크편집기를 공용으로 분리작업(90%) 2026-02-21 23:22:03 +09:00
86dbda1d21 ¸¶ũ º¹Á¦ ±â´É ±¸Çö ¹× Dµî±Þ »ö»ó ¼öÁ¤ (Grade E Ã߰¡ Ãë¼Ò) 2026-02-21 11:21:52 +09:00
82aa5a21d9 미소장 전체가져오기 기능 정상화 2026-02-20 16:17:17 +09:00
ed60319978 마크목록등록 ctrl+v 기능 오류 수정
목록창에서 isbn 조회 창으로 바로 진입할 수 있는 버튼이 필요(ppt15)
마크편집창 저장시 ISBN중복여부 확인
마크편집창 서브필드 정렬수정(245,440)- PPT21
2026-02-20 14:39:19 +09:00
35792b0a72 마크목록(new), 정렬,필터 기능 업데이트 2026-02-19 18:42:25 +09:00
77ef720197 .. 2026-02-19 18:28:22 +09:00
c0782ea5c1 마크편집창에서 isbn 을 복사할 수있도록 텍스트박스로 변경 2026-02-14 22:49:17 +09:00
6e25a3d4e9 일부 폼. .신규파일이름 2로 추가 2026-02-14 22:10:32 +09:00
f6dcd5630a 목록 생성 이후 수정 할 수 있는 기능이 필요
Ex) 목록일, 완료일, 목록명, 납품처, 담당자 등
2026-02-14 21:58:29 +09:00
9108993612 현재 마크목록 -> 목록생성(추후 목록 등록으로 수정요망) 버튼을 누르면
마크 목록 생성(추후 목록 등록으로 수정요망) 창이 뜨는 데 항목 순서 변경이 필요기존 가격 수량 합계 순서를 수량 가격 합계 순서로 변경요망
(북엔피에 적용된 순서와 동일하게 하려고 함)
2026-02-14 21:38:57 +09:00
f9d29c7629 marc2에서 마크목록생성시 색상불일치로 데이터 생성갯수가 달라진 부분 수정, 연결된 폼들때문에 addmarc2 도 수정하고 marcopyselect2 생성, marc_mklist2 생성 2026-02-04 22:31:27 +09:00
ad0be3fef5 마크목록생성 화면에서 오류 발생 가능성 분석 및 예상 코드 업데이트
트(null object ->  convert.tostring)
2026-02-03 22:45:26 +09:00
cfe68509f6 단축키 입력 관련 오류 수정 및 요청사항 수정
반출 오류 수정 (에디터 분리 건으로 인함)
2026-01-30 23:52:14 +09:00
87dbe17ec9 마크정리 목록오류 수정(compidx 전체 적용항목 수정, suername 도 전체 login정보로 수정), 매크로목록안나오는거(이상없음 -1번항목오류엿을수있음) , 문학형식 만환관련 오류 수정 2026-01-28 22:14:49 +09:00
92f36e78a5 DB 연결 관리 개선 및 연결 해제(Dispose) 오류 해결: Helper_DB의 연결 생성 및 해제 로직을 안전하게 리팩토링하고 Search_Infor에서 지역 변수를 사용하도록 수정 2026-01-25 13:56:18 +09:00
e3d5674b0a DB_Send_CMD_reVoid 를 ExecuteNoneQuery 로 대체 2026-01-25 13:21:54 +09:00
6c66cdb54a 마크편집창 alt+(a~z), alt+enter 단축키 추가
D등급자료의 색상을 Red -> Darkviolet 변경, red는 데이터가 신규로 저장된다.
신규로 저장되는 자료의 인덱스를 저장하면서 바로 수집하도록 한다
2026-01-25 11:19:12 +09:00
b7a2474ec2 메인화면의 compidx 와 username 을 . 전역 변수 PUB.user 로 이동 2026-01-24 16:30:24 +09:00
6e4e2eb982 마크목록 데이터바인딩 적용 2026-01-24 15:16:33 +09:00
47c443e9a3 네임스페이스 통일 UniMarc 2026-01-24 14:55:53 +09:00
568868602f 편집창 100 700 900 에서 쩜(.) 이 제거되지 않도록 함 2026-01-24 11:47:13 +09:00
c44f40a651 addmar2 작업중 2026-01-24 00:35:09 +09:00
4ffbb2fa2e 마크정리 에디터컨트롤 통합 작업 1차완료 2026-01-23 22:40:36 +09:00
ed9afeab80 미소장 화면이 폼에 직접 연결되지 않도록 수정 중 2026-01-22 23:11:25 +09:00
0f0f745964 마크정리화면에서 에디터통합 작업 중 일단 화면 open 성공 2026-01-22 23:00:08 +09:00
d40ffda4fd 마크정리에서 목록선택하면 나오는 목록창 바인딩소스 연결 2026-01-22 21:38:11 +09:00
409317c099 marc2 목록을 바인딩소스에 연결 2026-01-22 21:32:27 +09:00
344 changed files with 19361 additions and 4103 deletions

View File

@@ -56,12 +56,6 @@
</runtime>
<userSettings>
<UniMarc.Properties.Settings>
<setting name="compidx" serializeAs="String">
<value />
</setting>
<setting name="User" serializeAs="String">
<value />
</setting>
<setting name="IP" serializeAs="String">
<value>1.11010111.11111010.10000010</value>
</setting>

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
namespace ExcelTest
namespace UniMarc
{
public static class CExt
{
@@ -121,5 +121,4 @@ namespace ExcelTest
catch { }
}
}
}

View File

@@ -0,0 +1,34 @@
using AR;
namespace UniMarc
{
public static class DB_Utils
{
public static bool ExistISBN(string value)
{
if (value.isEmpty())
{
UTIL.MsgE("중복검사할 ISBN값이 입력되지 않았습니다");
return false;
}
// ISBN 중복체크
string checkSql = string.Format("SELECT COUNT(*) FROM Marc WHERE isbn = '{0}' AND compidx = '{1}'", value, PUB.user.CompanyIdx);
var ret = Helper_DB.ExcuteScalar(checkSql);
if (ret.value == null)
{
UTIL.MsgE($"Database error [ExistISBN]\n{ret.errorMessage}");
return false;
}
if (int.TryParse(ret.value.ToString(), out int cnt) == false)
return false;
else
{
if (cnt > 0)
{
return true;
}
return false;
}
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
using System.Web.Mail;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
class Email
{
@@ -74,12 +75,12 @@ namespace WindowsFormsApp1
{
SmtpMail.SmtpServer = smtp_server;
SmtpMail.Send(msg);
MessageBox.Show("다음 메일 전송 성공");
UTIL.MsgI("다음 메일 전송 성공");
return true;
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
return false;
}
}
@@ -118,12 +119,12 @@ namespace WindowsFormsApp1
try
{
smtp.Send(mail);
MessageBox.Show("메일 전송 완료");
UTIL.MsgI("메일 전송 완료");
return true;
}
catch (SmtpException e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
return false;
}
}
@@ -156,7 +157,7 @@ namespace WindowsFormsApp1
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
}
}
else
@@ -187,7 +188,7 @@ namespace WindowsFormsApp1
}
catch (SmtpException e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
}
}
}

View File

@@ -0,0 +1,378 @@
using Org.BouncyCastle.Pkcs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UniMarc
{
public class MarcSubfield
{
public char Code { get; set; }
public string Value { get; set; }
public MarcSubfield(char code, string value)
{
Code = code;
Value = value;
}
public override string ToString()
{
return $"▼{Code}{Value}";
}
}
public class MarcField
{
public string Tag { get; set; }
public string Indicators { get; set; } = " ";
public string ControlValue { get; set; }
public List<MarcSubfield> Subfields { get; set; } = new List<MarcSubfield>();
public bool IsControlField => int.TryParse(Tag, out int tagNum) && tagNum < 10;
public MarcField(string tag)
{
Tag = tag;
}
public string GetSubfieldValue(char code)
{
var sub = Subfields.FirstOrDefault(s => s.Code == code);
return sub != null ? sub.Value : string.Empty;
}
public override string ToString()
{
if (IsControlField)
return $"{Tag}\t \t{ControlValue}▲";
StringBuilder sb = new StringBuilder();
sb.Append($"{Tag}\t{Indicators}\t");
foreach (var sub in Subfields)
{
sb.Append(sub.ToString());
}
sb.Append("▲");
return sb.ToString();
}
}
public class MarcParser
{
public string Leader { get; set; } = "00000nam 2200000 k 4500";
public List<MarcField> Fields { get; set; } = new List<MarcField>();
private const char SUBFIELD_MARKER = '▼';
private const char FIELD_TERMINATOR = '▲';
private const char RECORD_TERMINATOR = '\x1D';
public MarcParser() { }
public void ParseMnemonic(string data)
{
Fields.Clear();
if (string.IsNullOrEmpty(data)) return;
string[] lines = data.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
string cleanLine = line.Trim();
if (cleanLine.Length < 3) continue;
string tag = cleanLine.Substring(0, 3);
MarcField field = new MarcField(tag);
string[] parts = cleanLine.Split('\t');
if (field.IsControlField)
{
if (parts.Length >= 3)
field.ControlValue = parts[2].TrimEnd(FIELD_TERMINATOR, ' ');
else
field.ControlValue = cleanLine.Substring(Math.Min(cleanLine.Length, 3)).Trim('\t', ' ', FIELD_TERMINATOR);
}
else
{
if (parts.Length >= 2)
field.Indicators = parts[1].PadRight(2).Substring(0, 2);
string dataPart = parts.Length >= 3 ? parts[2] : "";
if (parts.Length < 3 && cleanLine.Length > 5)
dataPart = cleanLine.Substring(5);
dataPart = dataPart.TrimEnd(FIELD_TERMINATOR);
ParseSubfields(field, dataPart);
}
Fields.Add(field);
}
}
private void ParseSubfields(MarcField field, string dataPart)
{
if (string.IsNullOrEmpty(dataPart)) return;
if (dataPart.Contains(SUBFIELD_MARKER))
{
string[] subfields = dataPart.Split(new[] { SUBFIELD_MARKER }, StringSplitOptions.RemoveEmptyEntries);
foreach (var s in subfields)
{
if (s.Length >= 1)
field.Subfields.Add(new MarcSubfield(s[0], s.Substring(1).TrimEnd(FIELD_TERMINATOR)));
}
}
else if (dataPart.Contains('\x1F'))
{
string[] subfields = dataPart.Split(new[] { '\x1F' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var s in subfields)
{
if (s.Length >= 1)
field.Subfields.Add(new MarcSubfield(s[0], s.Substring(1)));
}
}
else
{
for (int k = 0; k < dataPart.Length; k++)
{
if (char.IsLetter(dataPart[k]) && (k == 0 || dataPart[k - 1] == ' ' || dataPart[k - 1] == '^' || dataPart[k - 1] == '\x1F'))
{
char code = dataPart[k];
int next = -1;
for (int m = k + 1; m < dataPart.Length - 1; m++)
{
if (dataPart[m] == ' ' && char.IsLetter(dataPart[m + 1]))
{
next = m;
break;
}
}
string val = next == -1 ? dataPart.Substring(k + 1) : dataPart.Substring(k + 1, next - k - 1);
field.Subfields.Add(new MarcSubfield(code, val.Trim()));
if (next != -1) k = next;
else break;
}
}
}
}
public (bool success, string message) ParseFullMarc(string data)
{
System.Text.StringBuilder AlertMessage = new StringBuilder();
Fields.Clear();
if (data.Length < 24) return (false, "마크데이터가 24보다 작습니다");
//리더부는 항상 24바이트이다. 0~23까지이다.
Leader = data.Substring(0, 24);
if (!int.TryParse(Leader.Substring(12, 5), out int baseAddress)) return (false, string.Empty);
//data Length
if (int.TryParse(Leader.Substring(0, 5), out int dataLength) == false)
{
return (false, "Leader 전체 데이터 길이를 확인할 수 없습니다");
}
bool isScaled = false;
int directoryLength = baseAddress - 24;
int entryCount = directoryLength / 12;
var directory = data.Substring(24, directoryLength);
var RealData = data.Substring(24 + directoryLength);
if (RealData.Contains((char)0x1D) == false)
{
AlertMessage.AppendLine($"레코드식별기호 0x1D 가 없습니다");
}
else RealData = RealData.Trim((char)0x1D);
//태그별식별기호로 분리한다.
if (RealData[RealData.Length - 1] == (char)0x1E)
RealData = RealData.Substring(0, RealData.Length - 1);
var Tags = RealData.Split((char)0x1E);
if(Tags.Length != entryCount)
{
AlertMessage.AppendLine($"디렉토리 카운트({entryCount})와 태그수량({Tags.Length})이 일치하지 않습니다");
}
for (int i = 0; i < Math.Min(entryCount,Tags.Length); i++)
{
int entryStart = (i * 12);
//TAG(3)+LENGTH(4)+OFFSET(5)=12
if (entryStart + 12 > directory.Length) break;
if (directory[entryStart] == '\x1E' || directory[entryStart] == '^' || directory[entryStart] == FIELD_TERMINATOR) break;
string tag = directory.Substring(entryStart, 3);
var tag_len = directory.Substring(entryStart + 3, 4);
var tag_off = directory.Substring(entryStart + 7, 5);
if (!int.TryParse(tag_len, out int length))
{
AlertMessage.AppendLine($"태그({tag}) 길이를 확인할 수 없습니다 값:{tag_len}");
}
if (!int.TryParse(tag_off, out int offset))
{
AlertMessage.AppendLine($"태그({tag}) 오프셋을 확인할 수 없습니다 값:{offset}");
}
string fieldData = Tags[i];
fieldData = fieldData.TrimEnd('\x1E', '\x1D', FIELD_TERMINATOR, '^', ' ');
MarcField field = new MarcField(tag);
if (field.IsControlField)
field.ControlValue = fieldData;
else
{
var subfieldIndex = fieldData.IndexOf((char)0x1f);
string fielddata = "";
if (subfieldIndex < 0)
{
//1f가 없는 것은 오류 처리한다.
continue;
}
else if (subfieldIndex < 1)
{
//지시기호없이 데이터가 시작되는경우이다.
field.Indicators = " ";
ParseSubfields(field, fieldData);
}
else if (subfieldIndex < 2)
{
//지시기호가1개이다 뒤에 공백을 넣자
field.Indicators = fieldData.Substring(0, subfieldIndex) + " ";
ParseSubfields(field, fieldData.Substring(1));
}
else if (subfieldIndex > 2)
{
//지시기호가 2자리보다 길다? 이건 오류처리하자.
field.Indicators = " ";
ParseSubfields(field, fieldData.Substring(subfieldIndex));
}
else
{
field.Indicators = fieldData.Substring(0, 2);
ParseSubfields(field, fieldData.Substring(2));
}
}
Fields.Add(field);
}
return (true, AlertMessage.ToString());
}
public List<T> GetTag<T>(string path)
{
if (string.IsNullOrEmpty(path)) return new List<T>();
string tag = path.Substring(0, 3);
char? subCode = path.Length > 3 ? (char?)path[3] : null;
var fields = Fields.Where(f => f.Tag == tag).ToList();
if (fields.Count == 0) return new List<T>();
if (typeof(T) == typeof(MarcField))
return fields.Cast<T>().ToList();
if (typeof(T) == typeof(MarcSubfield))
{
if (!subCode.HasValue) return new List<T>();
var subResults = new List<MarcSubfield>();
foreach (var f in fields)
subResults.AddRange(f.Subfields.Where(s => s.Code == subCode.Value));
return subResults.Cast<T>().ToList();
}
if (typeof(T) == typeof(string))
{
var stringResults = new List<string>();
foreach (var f in fields)
{
if (f.IsControlField)
stringResults.Add(f.ControlValue);
else
{
if (subCode.HasValue)
stringResults.AddRange(f.Subfields.Where(s => s.Code == subCode.Value).Select(s => s.Value));
else
stringResults.AddRange(f.Subfields.Select(s => s.Value));
}
}
return stringResults.Cast<T>().ToList();
}
return new List<T>();
}
public List<string> GetTag(string path)
{
return GetTag<string>(path);
}
public void SetTag(string path, string value, string indicators = " ")
{
if (string.IsNullOrEmpty(path) || path.Length < 3) return;
string tag = path.Substring(0, 3);
bool isControl = int.TryParse(tag, out int tagNum) && tagNum < 10;
var field = Fields.FirstOrDefault(f => f.Tag == tag);
if (field == null)
{
field = new MarcField(tag) { Indicators = indicators };
Fields.Add(field);
Fields = Fields.OrderBy(f => f.Tag).ToList();
}
if (isControl)
field.ControlValue = value;
else
{
if (path.Length < 4) throw new ArgumentException("Subfield code required for data fields");
char subCode = path[3];
var sub = field.Subfields.FirstOrDefault(s => s.Code == subCode);
if (sub != null) sub.Value = value;
else field.Subfields.Add(new MarcSubfield(subCode, value));
}
}
public string Get008Segment(int offset, int length)
{
var valLine = GetTag("008").FirstOrDefault();
if (string.IsNullOrEmpty(valLine) || valLine.Length < offset + length) return string.Empty;
return valLine.Substring(offset, length);
}
public void Set008Segment(int offset, int length, string value)
{
var valLine = GetTag("008").FirstOrDefault() ?? new string(' ', 40);
if (valLine.Length < 40) valLine = valLine.PadRight(40);
StringBuilder sb = new StringBuilder(valLine);
for (int i = 0; i < length; i++)
{
char c = (i < value.Length) ? value[i] : ' ';
if (offset + i < sb.Length)
sb[offset + i] = c;
}
SetTag("008", sb.ToString());
}
public string ToMnemonicString()
{
StringBuilder sb = new StringBuilder();
foreach (var field in Fields)
sb.AppendLine(field.ToString());
return sb.ToString();
}
}
}

View File

@@ -0,0 +1 @@
00559nam 2200229 k 4500008004100000020003300041020002400074041000800098049000600106056001300112082001200125090001800137100001100155245004500166260002500211300001600236520000500252653003900257700001100296740001100307950001100318200306s2011 ggk 000 f kor  a9788954615860g04810c^158001 a9788954615853(세트)1 akor v1 a813.6240 a895.734 a813.6b이67퇴1 a이우혁00a퇴마록x退魔錄n1b국내편d이우혁 [지음] a파주b엘릭시르c2011 a663p.c20cm a a퇴마록a한국현대소설a한국장편소설1 a이우혁 0a국내편0 b^15800

View File

@@ -0,0 +1,15 @@
020 ▼a9788954615877▼g04810▼c\15800▲
020 1 ▼a9788954615853(세트)▲
049 ▼v2▲
056 ▼a813.6▼24▲
082 0 ▼a895.734▲
090 ▼a813.6▼b이67퇴▲
100 1 ▼a이우혁▲
245 00 ▼a퇴마록▼x退魔錄▼n2▼b국내편▼d이우혁 [지음]▲
260 ▼a파주▼b엘릭시르▼c2011▲
300 ▼a600p.▼c20cm▲
520 ▼a▲
653 ▼a퇴마록▼a한국현대소설▼a한국장편소설▲
700 1 ▼a이우혁▲
740 0 ▼a국내편▲
950 0 ▼b\15800▲

View File

@@ -1,20 +1,201 @@
using System;
using AR;
using MySql.Data.MySqlClient;
using Renci.SshNet;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using Renci.SshNet;
using UniMarc.BaroService_TI;
using UniMarc.Properties;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class Helper_DB
{
//static string cs = "";
public enum eDbType
{
unimarc,
cl_marc
}
public static MySqlConnection CreateConnection(eDbType dbtype)
{
var dbname = dbtype.ToString();
string strConnection = string.Format(
"Server={0};" +
"Port={1};" +
$"Database={dbname};" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
return new MySqlConnection(strConnection);
}
/// <summary>
/// 입력한 쿼리의 결과를 데이터테이블로 반환합니다
/// </summary>
/// <param name="query"></param>
/// <param name="cn"></param>
/// <returns></returns>
public static DataTable ExecuteDataTable(string query, MySqlConnection cn=null)
{
var bLocalCN = cn == null;
DataTable dt = new DataTable();
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);// new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd))
{
adapter.Fill(dt);
}
cmd.Dispose();
cn.Close();
if (bLocalCN) cn.Dispose();
return dt;
}
catch (Exception ex)
{
UTIL.MsgE(ex.ToString());
return null;
}
}
/// <summary>
/// 오류발생시 null을 반환합니다
/// </summary>
/// <param name="tableName"></param>
/// <param name="columns"></param>
/// <param name="wheres"></param>
/// <param name="orders"></param>
/// <returns></returns>
public static DataTable ExecuteQueryData(string tableName, string columns = "*", string wheres = "", string orders = "", MySqlConnection cn = null)
{
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
return ExecuteDataTable(sql, cn);
}
/// <summary>
/// 오류발생시 -1을 반환합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (int applyCount, string errorMessage) ExcuteNonQuery(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var cnt = cmd.ExecuteNonQuery();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (cnt, string.Empty);
}
catch (Exception ex)
{
return (-1, ex.Message);
}
}
public static (long value, string errorMessage) ExcuteInsertGetIndex(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
string message;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
message = "";
}
catch (Exception ex)
{
lastId = -1;
message = ex.Message;
}
return (lastId, message);
}
/// <summary>
/// 단일항목값을 반환 합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (object value, string errorMessage) ExcuteScalar(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var val = cmd.ExecuteScalar();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (val, string.Empty);
}
catch (Exception ex)
{
return (null, ex.Message);
}
}
/// <summary>
/// Insert 명령을 수행한 후 자동 생성된 index값을 반환합니다.
/// 오류발생시에는 -1을 반환합니다
/// </summary>
/// <param name="cmd"></param>
/// <param name="cn"></param>
/// <returns></returns>
public long DB_Send_CMD_Insert_GetIdx(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
}
catch (Exception ex)
{
UTIL.MsgE($"데이터베이스 실행오류\n{ex.Message}");
}
return lastId;
}
}
/// <summary>
/// DB접속을 도와주는 클래스
/// </summary>
public class Helper_DB
public partial class Helper_DB
{
// 접속
MySqlConnection conn;
@@ -22,14 +203,14 @@ namespace WindowsFormsApp1
/// <summary>
/// IP / Port / Uid / pwd
/// </summary>
string[] ServerData = {
static string[] ServerData = {
Settings.Default.IP,
Settings.Default.Uid,
Settings.Default.pwd
};
int port = Settings.Default.Port;
string[] DBData = {
static string[] DBData = {
Settings.Default.dbPort,
Settings.Default.dbUid,
Settings.Default.dbPwd
@@ -39,47 +220,12 @@ namespace WindowsFormsApp1
MySqlCommand sqlcmd = new MySqlCommand();
MySqlDataReader sd;
public string comp_idx { get; internal set; }
/// <summary>
/// DB를 사용하고 싶을 때 미리 저장된 DB의 기본 접속정보를 이용하여 DB에 접근한다.
/// </summary>
public void DBcon() // DB접속 함수
{
//"Server=1.215.250.130;Port=3306;Database=unimarc;uid=root;pwd=Admin21234;"
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo(ServerData[0], port, ServerData[1], ServerData[2]);
connectionInfo.Timeout = TimeSpan.FromSeconds(30);
using (var client = new SshClient(connectionInfo))
{
if (conn != null) {
conn.Close();
conn.Dispose();
}
client.Connect();
if (client.IsConnected)
{
string strConnection = string.Format(
"Server={0};" +
"Port={1};" +
"Database=unimarc;" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
conn = new MySqlConnection(strConnection);
}
}
}
public MySql.Data.MySqlClient.MySqlConnection CreateConnection()
public MySqlConnection CreateConnection()
{
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo(ServerData[0], port, ServerData[1], ServerData[2]);
connectionInfo.Timeout = TimeSpan.FromSeconds(30);
using (var client = new SshClient(connectionInfo))
{
if (conn != null)
{
conn.Close();
conn.Dispose();
}
client.Connect();
if (client.IsConnected)
{
@@ -96,6 +242,37 @@ namespace WindowsFormsApp1
return null;
}
/// <summary>
/// DB를 사용하고 싶을 때 미리 저장된 DB의 기본 접속정보를 이용하여 DB에 접근한다.
/// </summary>
public void DBcon() // DB접속 함수
{
//"Server=1.215.250.130;Port=3306;Database=unimarc;uid=root;pwd=Admin21234;"
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo(ServerData[0], port, ServerData[1], ServerData[2]);
connectionInfo.Timeout = TimeSpan.FromSeconds(30);
using (var client = new SshClient(connectionInfo))
{
if (conn != null)
{
conn.Close();
conn.Dispose();
}
client.Connect();
if (client.IsConnected)
{
var cs = string.Format(
"Server={0};" +
"Port={1};" +
"Database=unimarc;" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
conn = new MySqlConnection(cs);
}
}
}
/// <summary>
/// 국중DB를 사용하고 싶을 때 미리 저장된 DB의 기본 접속정보를 이용하여 DB에 접근한다.
/// </summary>
@@ -123,8 +300,11 @@ namespace WindowsFormsApp1
}
}
}
public string DB_Send_CMD_Search(string cmd)
{
// DB 연결
conn.Open();
// 쿼리 맵핑
@@ -147,6 +327,32 @@ namespace WindowsFormsApp1
conn.Close();
return result;
}
public DataTable DB_Send_CMD_Search_DataTable(string cmd)
{
DataTable dt = new DataTable();
try
{
if (conn.State == ConnectionState.Closed)
conn.Open();
using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd, conn))
{
adapter.Fill(dt);
}
}
catch (Exception ex)
{
UTIL.MsgE($"데이터베이스 실행오류\n{ex.Message}");
return null;
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
return dt;
}
public void DB_Send_CMD_Search_ApplyGrid(string cmd, DataGridView dgv)
{
// DB 연결
@@ -157,7 +363,7 @@ namespace WindowsFormsApp1
sqlcmd.Connection = conn;
// 쿼리 날리기, sqlDataReader에 결과값 저장
sd = sqlcmd.ExecuteReader();
int colCount = dgv.ColumnCount;
string[] grid = new string[colCount];
int AddCol = 0;
@@ -184,7 +390,7 @@ namespace WindowsFormsApp1
conn.Close();
}
public void DB_Send_CMD_Search_GetGridData(string cmd,DataGridView pDgv)
public void DB_Send_CMD_Search_GetGridData(string cmd, DataGridView pDgv)
{
// DB 연결
conn.Open();
@@ -209,7 +415,7 @@ namespace WindowsFormsApp1
if (colCount - 1 == AddCol)
{
AddCol = 0;
grid[colCount]="추가";
grid[colCount] = "추가";
pDgv.Rows.Add(grid);
}
else
@@ -220,34 +426,8 @@ namespace WindowsFormsApp1
}
conn.Close();
}
public void DB_Send_CMD_reVoid(string cmd)
{
//using (conn)
{
conn.Open();
MySqlTransaction tran = conn.BeginTransaction();
sqlcmd.Connection = conn;
sqlcmd.Transaction = tran;
try
{
sqlcmd.CommandText = cmd;
sqlcmd.ExecuteNonQuery();
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (conn != null && conn.State != System.Data.ConnectionState.Closed)
conn.Close();
}
}
}
/// <summary>
/// DBcon이 선진행되어야함.
/// SELECT * FROM [DB_Table_Name] WHERE [DB_Where_Table] LIKE \"%DB_Search_Data%\"
@@ -257,10 +437,10 @@ namespace WindowsFormsApp1
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Contains(string DB_Table_Name, string compidx,
public string DB_Contains(string DB_Table_Name, string compidx,
string DB_Where_Table = "", string DB_Search_Data = "",
string Search_col = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "" )
string Search_col = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "")
{
string cmd = "SELECT ";
if (Search_col == "") { cmd += "*"; }
@@ -270,16 +450,16 @@ namespace WindowsFormsApp1
if (DB_Table_Name == "Obj_List") { cmd += " WHERE `comp_num` = \"" + compidx + "\""; }
else if (DB_Table_Name == "Client") { cmd += " WHERE `campanyidx` = \"" + compidx + "\""; }
else if (DB_Table_Name == "Purchase") { cmd += " WHERE `comparyidx` = \"" + compidx + "\""; }
else if(compidx == "none") { cmd += " WHERE `grade` = \"2\""; }
else if (compidx == "none") { cmd += " WHERE `grade` = \"2\""; }
else { cmd += " WHERE `compidx` = \"" + compidx + "\""; }
if(DB_Search_Data != "")
{
cmd += " AND `"+ DB_Where_Table + "` LIKE \"%" + DB_Search_Data + "%\"";
if (DB_Search_Data != "")
{
cmd += " AND `" + DB_Where_Table + "` LIKE \"%" + DB_Search_Data + "%\"";
}
if(DB_Search_Data1 != "")
{
cmd += " AND `"+ DB_Where_Table1 + "` LIKE \"%" + DB_Search_Data1 + "%\"";
if (DB_Search_Data1 != "")
{
cmd += " AND `" + DB_Where_Table1 + "` LIKE \"%" + DB_Search_Data1 + "%\"";
}
cmd += ";";
return cmd;
@@ -292,17 +472,17 @@ namespace WindowsFormsApp1
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Select_Search(string Search_Area, string DB_Table_Name,
public string DB_Select_Search(string Search_Area, string DB_Table_Name,
string DB_Where_Table = "", string DB_Search_Data = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "")
{
string cmd = string.Format("SELECT {0} FROM ", Search_Area);
cmd += DB_Table_Name;
if(DB_Where_Table != "" && DB_Search_Data != "")
if (DB_Where_Table != "" && DB_Search_Data != "")
{
cmd += string.Format(" WHERE `{0}` = \"{1}\"", DB_Where_Table, DB_Search_Data);
}
if(DB_Where_Table1 != "" && DB_Search_Data1 != "")
if (DB_Where_Table1 != "" && DB_Search_Data1 != "")
{
cmd += string.Format(" AND `{0}` = \"{1}\"", DB_Where_Table1, DB_Search_Data1);
}
@@ -316,15 +496,15 @@ namespace WindowsFormsApp1
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Search(string DB_Table_Name,
public string DB_Search(string DB_Table_Name,
string DB_Where_Table = "", string DB_Search_Data = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "")
{
string cmd = "SELECT * FROM ";
cmd += DB_Table_Name;// + " where id=\"id\"";
if(DB_Search_Data != "")
{
cmd += " WHERE "+ DB_Where_Table + "=\"" + DB_Search_Data +"\"";
if (DB_Search_Data != "")
{
cmd += " WHERE " + DB_Where_Table + "=\"" + DB_Search_Data + "\"";
}
if (DB_Where_Table1 != "" && DB_Search_Data1 != "")
{
@@ -341,18 +521,18 @@ namespace WindowsFormsApp1
/// <param name="DB_Search_Data"></param>
/// <param name="Search_Table">추출할 열의 이름."`num1`, `num2`" 이런식으로</param>
/// <returns></returns>
public string More_DB_Search(String DB_Table_Name, String[] DB_Where_Table,
public string More_DB_Search(String DB_Table_Name, String[] DB_Where_Table,
String[] DB_Search_Data, String Search_Table = "")
{
if(DB_Where_Table.Length != DB_Search_Data.Length) { return "오류발생"; }
if (DB_Where_Table.Length != DB_Search_Data.Length) { return "오류발생"; }
string cmd = "SELECT ";
if(Search_Table == "") { cmd += "*"; }
if (Search_Table == "") { cmd += "*"; }
else { cmd += Search_Table; }
cmd += " FROM " + DB_Table_Name + " WHERE ";
for(int a = 0; a < DB_Where_Table.Length; a++)
for (int a = 0; a < DB_Where_Table.Length; a++)
{
cmd += "`" + DB_Where_Table[a] + "` = \"" + DB_Search_Data[a] + "\" ";
if(a == DB_Where_Table.Length - 1) { cmd += ";"; }
if (a == DB_Where_Table.Length - 1) { cmd += ";"; }
else { cmd += " AND "; }
}
return cmd;
@@ -367,7 +547,7 @@ namespace WindowsFormsApp1
/// <param name="end_date">끝낼 날짜 0000-00-00</param>
/// <param name="compidx">회사 인덱스 main.com_idx</param>
/// <returns></returns>
public string Search_Date(string Table_name, string Search_Table, string Search_date,
public string Search_Date(string Table_name, string Search_Table, string Search_date,
string start_date, string end_date, string compidx)
{
if (Search_Table == "") { Search_Table = "*"; }
@@ -375,7 +555,7 @@ namespace WindowsFormsApp1
string cmd = "SELECT " + Search_Table + " FROM `" + Table_name + "` " +
"WHERE `comp_num` = '" + compidx + "' AND `" +
Search_date + "` >= '" + start_date + "'";
if(Table_name != "Obj_List") { cmd = cmd.Replace("`comp_num`", "`compidx`"); }
if (Table_name != "Obj_List") { cmd = cmd.Replace("`comp_num`", "`compidx`"); }
if (end_date != "") { cmd += " AND `" + Search_date + "` <= '" + end_date + "';"; }
else { cmd += ";"; }
return cmd;
@@ -383,13 +563,13 @@ namespace WindowsFormsApp1
public string DB_INSERT(String DB_Table_name, String[] DB_col_name, String[] setData)
{
string cmd = "INSERT INTO " + DB_Table_name + "(";
for(int a = 0; a < DB_col_name.Length; a++)
for (int a = 0; a < DB_col_name.Length; a++)
{
if (a == DB_col_name.Length - 1) { cmd += "`" + DB_col_name[a] + "`) "; }
else { cmd += "`" + DB_col_name[a] + "`, "; }
}
cmd += "values(";
for(int a = 0; a < setData.Length; a++)
for (int a = 0; a < setData.Length; a++)
{
setData[a] = setData[a].Replace("\"", "\"\"");
if (a == setData.Length - 1) { cmd += "\"" + setData[a] + "\")"; }
@@ -427,8 +607,8 @@ namespace WindowsFormsApp1
/// <param name="comp_idx">삭제할 대상의 인덱스</param>
/// <param name="target_area">삭제할 대상이 있는 열명</param>
/// <param name="target">삭제할 대상</param>
public string DB_Delete(string DB_Table_Name,
string target_idx, string comp_idx,
public string DB_Delete(string DB_Table_Name,
string target_idx, string comp_idx,
string target_area, string target)
{
string cmd = "DELETE FROM " + DB_Table_Name + " WHERE " +
@@ -444,12 +624,12 @@ namespace WindowsFormsApp1
/// <param name="comp_idx">회사 인덱스</param>
/// <param name="target_area">삭제 대상의 컬럼명</param>
/// <param name="target">삭제 대상</param>
public string DB_Delete_No_Limit(string DB_Table,
string target_idx, string comp_idx,
public string DB_Delete_No_Limit(string DB_Table,
string target_idx, string comp_idx,
string[] target_area, string[] target)
{
string cmd = string.Format("DELETE FROM {0} WHERE `{1}`= \"{2}\" AND", DB_Table, target_idx, comp_idx);
for(int a= 0; a < target_area.Length; a++)
for (int a = 0; a < target_area.Length; a++)
{
cmd += string.Format("`{0}`=\"{1}\"", target_area[a], target[a]);
if (a != target_area.Length - 1) { cmd += " AND"; }
@@ -460,13 +640,13 @@ namespace WindowsFormsApp1
/// <summary>
/// 대상 컬럼 삭제 / DELETE FROM "DB_Table_Name" WHERE "target_idx"="comp_idx" AND "target_area"="target";
/// </summary>
public string DB_Delete_More_term(string DB_Table_Name,
string target_idx, string comp_idx,
public string DB_Delete_More_term(string DB_Table_Name,
string target_idx, string comp_idx,
string[] target_area, string[] target)
{
string cmd = "DELETE FROM " + DB_Table_Name + " WHERE " +
"`" + target_idx + "`=\"" + comp_idx + "\" AND";
for(int a = 0; a < target_area.Length; a++)
for (int a = 0; a < target_area.Length; a++)
{
cmd += " `" + target_area[a] + "`=\"" + target[a] + "\" ";
if (a == target_area.Length - 1) { cmd += "LIMIT 1;"; }
@@ -484,7 +664,7 @@ namespace WindowsFormsApp1
/// <param name="Search_Data">검색할 데이터</param>
public string DB_Update(string DB_Tabel_Name, string Edit_colum, string Edit_Name, string Search_Name, string Search_Data)
{
string cmd = "UPDATE `" + DB_Tabel_Name + "` SET `" + Edit_colum + "`=\"" + Edit_Name + "\" WHERE `"+Search_Name+"`=\"" + Search_Data + "\";";
string cmd = "UPDATE `" + DB_Tabel_Name + "` SET `" + Edit_colum + "`=\"" + Edit_Name + "\" WHERE `" + Search_Name + "`=\"" + Search_Data + "\";";
cmd = cmd.Replace("|", "");
return cmd;
}
@@ -496,12 +676,12 @@ namespace WindowsFormsApp1
/// <param name="Edit_name">바꿀 데이터값</param>
/// <param name="Search_col">대상 테이블명</param>
/// <param name="Search_Name">대상 데이터값</param>
public string More_Update(String DB_Table_Name,
String[] Edit_col, String[] Edit_name,
public string More_Update(String DB_Table_Name,
String[] Edit_col, String[] Edit_name,
String[] Search_col, String[] Search_Name, int limit = 0)
{
string cmd = "UPDATE `" + DB_Table_Name + "` SET ";
for(int a = 0; a < Edit_col.Length; a++)
for (int a = 0; a < Edit_col.Length; a++)
{
Edit_name[a] = Edit_name[a].Replace("\"", "\"\"");
cmd += "`" + Edit_col[a] + "` = \"" + Edit_name[a] + "\"";
@@ -509,14 +689,14 @@ namespace WindowsFormsApp1
else { cmd += " "; }
}
cmd += "WHERE ";
for(int a = 0; a < Search_col.Length; a++)
for (int a = 0; a < Search_col.Length; a++)
{
cmd += "`" + Search_col[a] + "` = \"" + Search_Name[a] + "\" ";
if (a != Search_col.Length - 1) { cmd += "AND "; }
}
if(limit != 0) { cmd += string.Format("LIMIT {0}", limit); }
if (limit != 0) { cmd += string.Format("LIMIT {0}", limit); }
cmd += ";";
cmd = cmd.Replace("|", "");
cmd = cmd.Replace("|", "");
return cmd;
}
/// <summary>
@@ -572,10 +752,9 @@ namespace WindowsFormsApp1
}
}
}
catch(Exception e)
catch (Exception e)
{
MessageBox.Show("{0} Exception caught.\n"+ e.ToString());
MessageBox.Show(cmd);
UTIL.MsgE(e.ToString());
}
conn.Close();
return result;

View File

@@ -1,48 +0,0 @@
using AR;
using Microsoft.Vbe.Interop;
using MySql.Data.MySqlClient;
using OpenQA.Selenium.BiDi.Input;
using Renci.SshNet;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UniMarc;
using UniMarc.Properties;
namespace WindowsFormsApp1
{
public static class DB2
{
public static DataTable GetDT(string tableName, string columns="*" , string wheres="", string orders="")
{
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
Helper_DB db = new Helper_DB();
var cn = db.CreateConnection();
var da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
var dt = new DataTable();
da.Fill(dt);
dt.AcceptChanges();
return dt;
}
public static int ExcuteNonQuery(string query)
{
Helper_DB db = new Helper_DB();
var cn = db.CreateConnection();
var cmd = new MySqlCommand(query, cn);
cn.Open();
var cnt = cmd.ExecuteNonQuery();
cmd.Dispose();
cn.Dispose();
return cnt;
}
}
}

View File

@@ -123,7 +123,7 @@ namespace UniMarc.ListOfValue
{
if (this.bs.Current == null)
{
MessageBox.Show("선택된 데이터가 없습니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Warning);
UTIL.MsgE("선택된 데이터가 없습니다.");
return;
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class login
{

View File

@@ -11,8 +11,9 @@ using System.IO;
using System.Net;
using System.Net.Sockets;
using Application = System.Windows.Forms.Application;
using AR;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class login : Form
{
@@ -25,7 +26,7 @@ namespace WindowsFormsApp1
private void login_Load(object sender, EventArgs e)
{
lbl_IP.Text = String.Format("{0}", ip.GetIP);
lbl_IP.Text = String.Format("{0}", ip.GetIP());
lbl_Version.Text = string.Format("Ver.{0}", ip.VersionInfo());
this.ActiveControl = ID_text;
@@ -62,7 +63,7 @@ namespace WindowsFormsApp1
((Main)(this.Owner)).User_Name = ID_text.Text;
if (db_res == "")
{
MessageBox.Show("아이디 혹은 비밀번호가 정확하지않습니다.");
UTIL.MsgE("아이디 혹은 비밀번호가 정확하지않습니다.");
return;
}
@@ -75,11 +76,11 @@ namespace WindowsFormsApp1
WriteFile();
if (!CheckIP(lbl_IP.Text, result[4]))
{
MessageBox.Show("허용된 아이피가 아닙니다!");
UTIL.MsgE("허용된 아이피가 아닙니다!");
return;
}
((Main)(this.Owner)).IPText.Text = string.Format("접속 아이피 : {0}", lbl_IP.Text);
db.DB_Send_CMD_reVoid(
Helper_DB.ExcuteNonQuery(
string.Format("UPDATE `User_Data` SET `lastIP` = \"{0}\", `lastDate` = \"{2}\" WHERE `ID` = \"{1}\"",
lbl_IP.Text, ID_text.Text, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
);
@@ -88,12 +89,12 @@ namespace WindowsFormsApp1
}
else
{
MessageBox.Show("아이디 혹은 비밀번호가 정확하지않습니다.");
UTIL.MsgE("아이디 혹은 비밀번호가 정확하지않습니다.");
}
}
else
{
MessageBox.Show("아이디 혹은 비밀번호가 정확하지않습니다.");
UTIL.MsgE("아이디 혹은 비밀번호가 정확하지않습니다.");
}
}
#region CheckIP

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -12,32 +13,16 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UniMarc;
using UniMarc.Properties;
using UniMarc.;
using UniMarc.;
using UniMarc.;
using WindowsFormsApp1.Account;
using WindowsFormsApp1.Convenience;
using WindowsFormsApp1.Delivery;
using WindowsFormsApp1.DLS;
using WindowsFormsApp1.Home;
using WindowsFormsApp1.Mac;
using WindowsFormsApp1.Work_log;
using WindowsFormsApp1.;
using WindowsFormsApp1.;
using WindowsFormsApp1.;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class Main : Form
{
Helper_DB _DB = new Helper_DB();
IP ip = new IP();
public string DB_User_Data;
public string User;
public string com_idx;
public Main()
{
@@ -47,7 +32,7 @@ namespace WindowsFormsApp1
this.mdiTabControl.DrawItem += MdiTabControl_DrawItem;
PUB.Init();
this.btDevDb.Visible = System.Diagnostics.Debugger.IsAttached;
if(System.Diagnostics.Debugger.IsAttached)
if (System.Diagnostics.Debugger.IsAttached)
{
this.Size = new Size(1920, 1080);
this.WindowState = FormWindowState.Normal;
@@ -82,33 +67,38 @@ namespace WindowsFormsApp1
{
string[] result = DB_User_Data.Split('|');
if (result[3] == null) { }
if (result[3] == null) {
PUB.user.UserName = "";
PUB.user.CompanyName = string.Empty;
}
else
{
toolStripLabel2.Text = result[4];
botUserLabel.Text = result[3];
User = result[3];
PUB.user.CompanyName = result[4];
PUB.user.UserName = result[3];
}
cmd = _DB.DB_Select_Search("`idx`", "Comp", "comp_name", result[4]);
com_idx = _DB.DB_Send_CMD_Search(cmd).Replace("|", "");
PUB.user.CompanyIdx = _DB.DB_Send_CMD_Search(cmd).Replace("|", "");
if (com_idx != "1")
if (PUB.user.CompanyIdx != "1")
{
ToolStripMenuItem.Visible = false;
ToolStripMenuItem.Visible = false;
}
if (result[5] != "관리자") { ToolStripMenuItem.Visible = false; }
Settings.Default.compidx = com_idx;
Settings.Default.User = botUserLabel.Text;
lbCompanyName.Text = PUB.user.CompanyName;
botUserLabel.Text = PUB.user.UserName;
this.Text = "[ '" + com_idx + "' : " + result[4] + " - " + result[3] + "]";
this.Text = "[ '" + PUB.user.CompanyIdx + "' : " + result[4] + " - " + result[3] + "]";
isAccess();
SetBtnName();
}
catch (Exception ex) { MessageBox.Show(ex.ToString()); }
catch (Exception ex) { UTIL.MsgE(ex.ToString()); }
UpdaterCheck();
@@ -309,7 +299,7 @@ namespace WindowsFormsApp1
// 권한설정으로 인한 리턴
if (!MenuCheckT[count[0]][count[1]].Enabled)
{
MessageBox.Show("권한이 설정되지 않았습니다!");
UTIL.MsgE("권한이 설정되지 않았습니다!");
return;
}
@@ -660,7 +650,7 @@ namespace WindowsFormsApp1
#endregion
#region DLS
// Fields removed
@@ -668,14 +658,14 @@ namespace WindowsFormsApp1
private void dLS조회ToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFormInTab(() => new School_Lookup(this));
OpenFormInTab(() => new DLS_Lookup(this));
}
private void dLS복본조사ToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFormInTab(() => new DLS_Copy(this));
}
#endregion
#region
// Fields removed
// Make_Document, Mac_Stat, Mac_equip_Manage removed
@@ -787,7 +777,7 @@ namespace WindowsFormsApp1
{
OpenFormInTab(() => new Batch_processing(this));
}
private void 2_Click(object sender, EventArgs e)
{
OpenFormInTab(() =>
@@ -889,5 +879,15 @@ namespace WindowsFormsApp1
}
}
}
private void NewToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFormInTab<AddMarc2>(() => new AddMarc2(this));
}
private void NewToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFormInTab(() => new Search_Infor2(this));
}
}
}

View File

@@ -1,18 +1,26 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls.WebParts;
using System.Windows.Forms;
using UniMarc.Properties;
namespace UniMarc
{
public class LoginInfo
{
public string UserName { get; set; }
public string CompanyIdx { get; set; }
public string CompanyName { get; set; }
}
public static class PUB
{
public static arUtil.Log log;
public static UserSetting setting;
public static LoginInfo user;
public static void Init()
{
#region "Log setting"
@@ -22,10 +30,42 @@ namespace UniMarc
PUB.log.SubDirectory = logsubdir;
PUB.log.FileNameFormat = "{yyMMdd}";
#endregion
setting = new UserSetting();
setting.Load();
user = new LoginInfo();
}
/// <summary>
/// 빈 MARC String 을 생성한다
/// </summary>
/// <param name="ISBN13"></param>
/// <param name="BookName"></param>
/// <param name="Author"></param>
/// <param name="Publisher"></param>
/// <param name="Price"></param>
/// <returns></returns>
public static string MakeEmptyMarc(string ISBN13, string BookName, string Author, string Publisher, string Price)
{
string yyMMdd = DateTime.Now.ToString("yyMMdd");
string yyyy = DateTime.Now.ToString("yyyy");
string Empty_008 = yyMMdd + "s" + yyyy + " 000 kor ▲";
var tag_008 = Empty_008.Replace("▲", "");
string Empty_text = string.Format(
"020\t \t▼a{1}▼c\\{5}▲\n" +
"056\t \t▼a▼25▲\n" +
"100\t \t▼a{2}▲\n" +
"245\t \t▼a{2}▼d{3}▲\n" +
"260\t \t▼b{4}▲\n" +
"300\t \t▼a▼c▲\n" +
"653\t \t▼a▲\n" +
"700\t \t▼a▲\n" +
"950\t \t▼b\\{5}▲\n",
Empty_008, ISBN13, BookName, Author, Publisher, Price);
return Empty_text;
}
}
}

View File

@@ -1,10 +1,11 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
static class Program
{
@@ -16,6 +17,12 @@ namespace WindowsFormsApp1
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//var parserF = new UniMarc.MarcParser();
//var fullMarc = System.IO.File.ReadAllText(".\\Helper\\sample_fullmarc.txt");
//var rlt = parserF.ParseFullMarc(fullMarc);
//if(rlt.success==false)
//AR.UTIL.MsgE("unitmarc");
try
{
@@ -24,7 +31,7 @@ namespace WindowsFormsApp1
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
UTIL.MsgE(ex.Message);
}
Application.Run(new Main());

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2026.01.21.2318")]
[assembly: AssemblyFileVersion("2026.01.21.2318")]
[assembly: AssemblyVersion("2026.02.23.2400")]
[assembly: AssemblyFileVersion("2026.02.23.2400")]

View File

@@ -12,7 +12,7 @@ namespace UniMarc.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -23,30 +23,6 @@ namespace UniMarc.Properties {
}
}
[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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1.11010111.11111010.10000010")]

View File

@@ -2,12 +2,6 @@
<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>
<Setting Name="IP" Type="System.String" Scope="User">
<Value Profile="(Default)">1.11010111.11111010.10000010</Value>
</Setting>

View File

@@ -17,7 +17,6 @@ using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using UniMarc.SearchModel;
using UniMarc.;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

View File

@@ -12,7 +12,6 @@ using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using UniMarc.SearchModel;
using UniMarc.;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

View File

@@ -12,7 +12,6 @@ using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using UniMarc.SearchModel;
using UniMarc.;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

View File

@@ -12,7 +12,6 @@ using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using UniMarc.SearchModel;
using UniMarc.;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -15,7 +15,6 @@ using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using UniMarc.SearchModel;
using UniMarc.;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -9,7 +9,6 @@ using WebDriverManager.DriverConfigs.Impl;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using UniMarc.;
using OpenQA.Selenium.Chromium;
using UniMarc.SearchModel;
using System.Runtime.CompilerServices;

View File

@@ -5,11 +5,12 @@ namespace UniMarc.Properties {
public class UserSetting : AR.Setting
{
public int ISBNSearchDelay { get; set; }
public string LastSearchTarget { get; set; }
public string LastSearchTargetDLS { get; set; }
public override void AfterLoad()
{
if (ISBNSearchDelay == 0) ISBNSearchDelay = 500;
}
public override void AfterSave()

View File

@@ -24,8 +24,9 @@ using System.Globalization;
using System.Threading;
using System.Data.SqlTypes;
using AR;
using System.Runtime.InteropServices.WindowsRuntime;
namespace WindowsFormsApp1
namespace UniMarc
{
/// <summary>
/// 여러 기능들이 추가될 예정.
@@ -286,7 +287,7 @@ namespace WindowsFormsApp1
Helper_DB db = new Helper_DB();
db.DBcon();
if (Pur == "") { MessageBox.Show("입력된 주문처가 없습니다!"); return "False"; }
if (Pur == "") { UTIL.MsgE("입력된 주문처가 없습니다!"); return "False"; }
string Area = "`comp_name`, `tel`, `fax`, `bubin`, `uptae`, " +
"`jongmok`, `addr`, `boss`, `email`, `barea`";
@@ -304,7 +305,7 @@ namespace WindowsFormsApp1
if (db_res1.Length < 3)
{
MessageBox.Show("DB호출 에러!", "Error");
UTIL.MsgE("DB호출 에러!");
return "False";
}
string tel = string.Empty;
@@ -377,7 +378,7 @@ namespace WindowsFormsApp1
// 엑셀 파일 이름 설정
string now = DateTime.Now.ToString("yy-MM-dd-HH-mm");
string FileName = string.Format("{0}_{1}_{2}_{3}.xlsx", now.Replace("-", ""), emchk, Pur, db_data[0]);
MessageBox.Show(FileName);
UTIL.MsgI(FileName);
// 엑셀 파일 저장 경로
string Savepath = Path.Combine(tempPath, FileName);
@@ -602,7 +603,7 @@ namespace WindowsFormsApp1
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
return "False";
}
}
@@ -640,7 +641,7 @@ namespace WindowsFormsApp1
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
UTIL.MsgE(e.ToString());
}
}
#region MK_Excel_Sub
@@ -824,9 +825,9 @@ namespace WindowsFormsApp1
string ErrMsg = FAX_GetErrString(result);
if (ErrMsg != "")
MessageBox.Show(msg, "전송완료");
UTIL.MsgI(msg);
else
MessageBox.Show(ErrMsg, "Error");
UTIL.MsgE(ErrMsg);
return result;
}
@@ -1307,7 +1308,7 @@ namespace WindowsFormsApp1
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
UTIL.MsgE(ex.ToString());
this.LastException = ex;
System.Reflection.MemberInfo info = System.Reflection.MethodInfo.GetCurrentMethod();
string id = string.Format("{0}.{1}", info.ReflectedType.Name, info.Name);
@@ -1326,8 +1327,6 @@ namespace WindowsFormsApp1
string url = string.Format(@"FTP://{0}:{1}/{2}", ipAddr, Port, serverFullPathFile);
FtpWebRequest ftp = (FtpWebRequest)WebRequest.Create(url);
MessageBox.Show(url);
ftp.Credentials = new NetworkCredential(userId, Pwd);
ftp.KeepAlive = false;
ftp.UseBinary = true;
@@ -1365,7 +1364,7 @@ namespace WindowsFormsApp1
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
UTIL.MsgE(ex.ToString());
this.LastException = ex;
if (serverFullPathFile.Contains(@"\ZOOM\"))
@@ -1933,7 +1932,7 @@ namespace WindowsFormsApp1
/// <returns></returns>
public string[] Take_Tag(string marc, string[] search, bool pSearchTag = false)
{
string[] ary = marc.Split('');
string[] ary = marc.Split(''); //0x1E
string[] tag = res_dir(ary[0].Substring(24));
(string[] jisi, string[] mrc) = jisi_Symbol(tag, ary);
@@ -2341,9 +2340,9 @@ namespace WindowsFormsApp1
/// <param name="QueryType"></param>
/// <param name="Param"></param>
/// <returns></returns>
public string Aladin(string Query, string QueryType, string[] Param)
public List<string> Aladin(string Query, string QueryType, string[] Param)
{
string result = string.Empty;
List<string> result = new List<string>();
// 쿼리 생성
string key = "ttbgloriabook1512001";
string site = "http://www.aladin.co.kr/ttb/api/ItemSearch.aspx";
@@ -2384,7 +2383,7 @@ namespace WindowsFormsApp1
}
catch (Exception ex)
{
return "";
return result;
}
var json = JsonConvert.SerializeXmlNode(doc);
@@ -2402,7 +2401,7 @@ namespace WindowsFormsApp1
}
catch
{
return "";
return result;
}
int length = 0;
int ID_length = Param.Length;
@@ -2419,6 +2418,7 @@ namespace WindowsFormsApp1
object buf = docs;
length = 1;
}
// List<string> retval = new List<string>();
for (int a = 0; a < length; a++)
{
List<string> tmp_data = new List<string>();
@@ -2432,9 +2432,10 @@ namespace WindowsFormsApp1
{
tmp_data.Add(docs[a][Param[b]]);
}
result += tmp_data[b].Replace("|", "") + "|";
result.Add(tmp_data[b].Replace("|", ""));
//result += tmp_data[b].Replace("|", "") + "|";
}
result += "\n";
//result += "\n";
}
return result;
}
@@ -2459,7 +2460,7 @@ namespace WindowsFormsApp1
}
else
{
MessageBox.Show(status, "Error");
UTIL.MsgE(status);
return "Error";
}
@@ -3005,21 +3006,49 @@ namespace WindowsFormsApp1
public class IP
{
/// <summary>
/// 현 PC의 외부아이피를 가져옴
/// 프로그램에서 가져올 방법이 딱히 없어 꼼수로 웹사이트 크롤링을 통해 가져옴
/// </summary>
public string GetIP
public string GetIP()
{
get
{
string externalIp = new WebClient().DownloadString("http://ipinfo.io/ip").Trim(); // http://icanhazip.com
// 최신 사이트 접속을 위한 TLS 1.2 활성화 (강제 지정)
// Windows 7 / .NET 4.0에서는 이 설정이 없으면 HTTPS 접속이 실패할 수 있습니다.
try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; } catch { }
if (string.IsNullOrWhiteSpace(externalIp))
externalIp = GetIP;
return externalIp;
string[] urls = {
"http://checkip.amazonaws.com",
"http://ipinfo.io/ip",
"https://api.ipify.org"
};
foreach (var url in urls)
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = 2000;
// 브라우저처럼 보이게 하기 위해 User-Agent 추가 (많은 사이트가 이를 요구함)
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
string ip = reader.ReadToEnd().Trim();
// IP 형식인지 검증
IPAddress address;
if (IPAddress.TryParse(ip, out address))
{
// IPv4인 경우에만 반환 (필요시 IPv6 허용 가능)
if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
return ip;
}
}
}
catch { continue; } // 다음 URL 시도
}
return "IP 확인 실패";
}
public string VersionInfo()
{
string version = "0";

View File

@@ -0,0 +1,169 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace UniMarc
{
public class SortableBindingList<T> : BindingList<T>, IBindingListView
{
private bool _isSorted;
private ListSortDirection _sortDirection;
private PropertyDescriptor _sortProperty;
private string _filter;
private readonly List<T> _originalItems = new List<T>();
public SortableBindingList() : base() { }
public SortableBindingList(IList<T> list) : base(list)
{
foreach (var item in list)
_originalItems.Add(item);
}
protected override void OnListChanged(ListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemAdded)
{
_originalItems.Insert(e.NewIndex, this[e.NewIndex]);
}
else if (e.ListChangedType == ListChangedType.ItemDeleted)
{
// This is slightly tricky if filtered, but we assume basic usage for now
// Ideally we'd track IDs
}
base.OnListChanged(e);
}
#region Sorting
protected override bool SupportsSortingCore => true;
protected override bool IsSortedCore => _isSorted;
protected override ListSortDirection SortDirectionCore => _sortDirection;
protected override PropertyDescriptor SortPropertyCore => _sortProperty;
protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)
{
var items = this.Items as List<T>;
if (items != null)
{
PropertyComparer<T> pc = new PropertyComparer<T>(prop, direction);
items.Sort(pc);
_isSorted = true;
_sortDirection = direction;
_sortProperty = prop;
}
else
{
_isSorted = false;
}
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
protected override void RemoveSortCore()
{
_isSorted = false;
_sortProperty = null;
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
#endregion
#region Filtering (IBindingListView)
public string Filter
{
get => _filter;
set
{
_filter = value;
if (string.IsNullOrEmpty(_filter))
RemoveFilter();
else
ApplyFilter(_filter);
}
}
public bool SupportsFiltering => true;
public void ApplyFilter(string filter)
{
_filter = filter;
if (_originalItems.Count == 0 && this.Count > 0)
{
foreach (var item in this) _originalItems.Add(item);
}
// Simple parser for "Property=Value" or "Property='Value'"
var parts = filter.Split('=');
if (parts.Length != 2) return;
string propName = parts[0].Trim();
string valStr = parts[1].Trim().Trim('\'');
var prop = TypeDescriptor.GetProperties(typeof(T))[propName];
if (prop == null) return;
this.RaiseListChangedEvents = false;
this.Clear();
foreach (var item in _originalItems)
{
var val = prop.GetValue(item);
if (val != null && val.ToString().Equals(valStr, StringComparison.OrdinalIgnoreCase))
{
this.Add(item);
}
}
this.RaiseListChangedEvents = true;
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
public void RemoveFilter()
{
_filter = null;
if (_originalItems.Count > 0)
{
this.RaiseListChangedEvents = false;
this.Clear();
foreach (var item in _originalItems) this.Add(item);
this.RaiseListChangedEvents = true;
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
}
public ListSortDescriptionCollection SortDescriptions => null;
public bool SupportsAdvancedSorting => false;
public void ApplySort(ListSortDescriptionCollection sorts) => throw new NotSupportedException();
#endregion
private class PropertyComparer<TItem> : IComparer<TItem>
{
private readonly PropertyDescriptor _prop;
private readonly ListSortDirection _direction;
public PropertyComparer(PropertyDescriptor prop, ListSortDirection direction)
{
_prop = prop;
_direction = direction;
}
public int Compare(TItem x, TItem y)
{
object xVal = _prop.GetValue(x);
object yVal = _prop.GetValue(y);
int result;
if (xVal == null && yVal == null) result = 0;
else if (xVal == null) result = -1;
else if (yVal == null) result = 1;
else if (xVal is IComparable comparable)
result = comparable.CompareTo(yVal);
else if (xVal.Equals(yVal))
result = 0;
else
result = xVal.ToString().CompareTo(yVal.ToString());
return _direction == ListSortDirection.Ascending ? result : -result;
}
}
}
}

136
unimarc/unimarc/UC_SelectGrade.Designer.cs generated Normal file
View File

@@ -0,0 +1,136 @@
namespace UniMarc
{
partial class UC_SelectGrade
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
/// </summary>
private void InitializeComponent()
{
this.radD = new System.Windows.Forms.RadioButton();
this.radC = new System.Windows.Forms.RadioButton();
this.radB = new System.Windows.Forms.RadioButton();
this.radA = new System.Windows.Forms.RadioButton();
this.label6 = new System.Windows.Forms.Label();
this.radE = new System.Windows.Forms.RadioButton();
this.SuspendLayout();
//
// radD
//
this.radD.AutoSize = true;
this.radD.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.radD.Location = new System.Drawing.Point(147, 4);
this.radD.Name = "radD";
this.radD.Size = new System.Drawing.Size(34, 20);
this.radD.TabIndex = 328;
this.radD.TabStop = true;
this.radD.Text = "D";
this.radD.UseVisualStyleBackColor = true;
//
// radC
//
this.radC.AutoSize = true;
this.radC.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.radC.Location = new System.Drawing.Point(112, 4);
this.radC.Name = "radC";
this.radC.Size = new System.Drawing.Size(33, 20);
this.radC.TabIndex = 327;
this.radC.TabStop = true;
this.radC.Text = "C";
this.radC.UseVisualStyleBackColor = true;
//
// radB
//
this.radB.AutoSize = true;
this.radB.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.radB.Location = new System.Drawing.Point(77, 4);
this.radB.Name = "radB";
this.radB.Size = new System.Drawing.Size(33, 20);
this.radB.TabIndex = 326;
this.radB.TabStop = true;
this.radB.Text = "B";
this.radB.UseVisualStyleBackColor = true;
//
// radA
//
this.radA.AutoSize = true;
this.radA.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.radA.Location = new System.Drawing.Point(40, 4);
this.radA.Name = "radA";
this.radA.Size = new System.Drawing.Size(35, 20);
this.radA.TabIndex = 325;
this.radA.TabStop = true;
this.radA.Text = "A";
this.radA.UseVisualStyleBackColor = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.label6.Location = new System.Drawing.Point(7, 8);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(31, 12);
this.label6.TabIndex = 324;
this.label6.Text = "등급";
//
// radE
//
this.radE.AutoSize = true;
this.radE.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.radE.Location = new System.Drawing.Point(183, 4);
this.radE.Name = "radE";
this.radE.Size = new System.Drawing.Size(32, 20);
this.radE.TabIndex = 329;
this.radE.TabStop = true;
this.radE.Text = "E";
this.radE.UseVisualStyleBackColor = true;
//
// UC_SelectGrade
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.radE);
this.Controls.Add(this.radD);
this.Controls.Add(this.radC);
this.Controls.Add(this.radB);
this.Controls.Add(this.radA);
this.Controls.Add(this.label6);
this.Name = "UC_SelectGrade";
this.Size = new System.Drawing.Size(221, 29);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RadioButton radD;
private System.Windows.Forms.RadioButton radC;
private System.Windows.Forms.RadioButton radB;
private System.Windows.Forms.RadioButton radA;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.RadioButton radE;
}
}

View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc
{
public partial class UC_SelectGrade : UserControl
{
public UC_SelectGrade()
{
InitializeComponent();
}
public string GradeName
{
get
{
if(Grade == 0) return "A";
else if (Grade == 1) return "B";
else if (Grade == 2) return "C";
else if (Grade == 3) return "D";
else if (Grade == 4) return "E";
else return "";
}
set
{
if (value == "A") Grade = 0;
else if (value == "B") Grade = 1;
else if (value == "C") Grade = 2;
else if (value == "D") Grade = 3;
else if (value == "E") Grade = 4;
else Grade = -1;
}
}
public int Grade
{
get
{
if (radA.Checked) return 0;
else if (radB.Checked) return 1;
else if (radC.Checked) return 2;
else if (radD.Checked) return 3;
else if (radE.Checked) return 4;
else return -1;
}
set
{
if (value == -1)
{
radA.Checked = false;
radB.Checked = false;
radC.Checked = false;
radD.Checked = false;
radE.Checked = false;
}
else if (value == 0) radA.Checked = true;
else if (value == 1) radB.Checked = true;
else if (value == 2) radC.Checked = true;
else if (value == 3) radD.Checked = true;
else if (value == 4) radE.Checked = true;
}
}
}
}

View File

@@ -224,7 +224,8 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Helper_DB2.cs" />
<Compile Include="DB_Utils.cs" />
<Compile Include="Helper\MarcParser.cs" />
<Compile Include="Helper_LibraryDelaySettings.cs" />
<Compile Include="ListOfValue\fSelectDT.cs">
<SubType>Form</SubType>
@@ -268,18 +269,43 @@
<Compile Include="SearchModel\JunnamEduSearcher.cs" />
<Compile Include="SearchModel\NamguLibrarySearcher.cs" />
<Compile Include="SearchModel\SeleniumHelper.cs" />
<Compile Include="SortableBindingList.cs" />
<Compile Include="UC_SelectGrade.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC_SelectGrade.Designer.cs">
<DependentUpon>UC_SelectGrade.cs</DependentUpon>
</Compile>
<Compile Include="개발자용\fDevDB.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="개발자용\fDevDB.Designer.cs">
<DependentUpon>fDevDB.cs</DependentUpon>
</Compile>
<Compile Include="납품관리\Book_Lookup2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="납품관리\Book_Lookup2.Designer.cs">
<DependentUpon>Book_Lookup2.cs</DependentUpon>
</Compile>
<Compile Include="납품관리\Order_input_Search2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="납품관리\Order_input_Search2.Designer.cs">
<DependentUpon>Order_input_Search2.cs</DependentUpon>
</Compile>
<Compile Include="마스터\From_User_manage_List.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마스터\From_User_manage_List.Designer.cs">
<DependentUpon>From_User_manage_List.cs</DependentUpon>
</Compile>
<Compile Include="마크\AddMarc2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\AddMarc2.Designer.cs">
<DependentUpon>AddMarc2.cs</DependentUpon>
</Compile>
<Compile Include="마크\AddMarc.cs">
<SubType>Form</SubType>
</Compile>
@@ -292,6 +318,7 @@
<Compile Include="마크\AddMarc_FillBlank.Designer.cs">
<DependentUpon>AddMarc_FillBlank.cs</DependentUpon>
</Compile>
<Compile Include="마크\BookGridItem.cs" />
<Compile Include="마크\CD_LP.cs">
<SubType>Form</SubType>
</Compile>
@@ -340,6 +367,31 @@
<Compile Include="마크\Check_Copy_Sub_Selector.Designer.cs">
<DependentUpon>Check_Copy_Sub_Selector.cs</DependentUpon>
</Compile>
<Compile Include="마크\Check_ISBN2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Check_ISBN2.Designer.cs">
<DependentUpon>Check_ISBN2.cs</DependentUpon>
</Compile>
<Compile Include="마크\Check_ISBN_ItemEdit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Check_ISBN_ItemEdit.Designer.cs">
<DependentUpon>Check_ISBN_ItemEdit.cs</DependentUpon>
</Compile>
<Compile Include="마크\Check_ISBN_Sub2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Check_ISBN_Sub2.Designer.cs">
<DependentUpon>Check_ISBN_Sub2.cs</DependentUpon>
</Compile>
<Compile Include="마크\Check_ISBN_Yes242.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Check_ISBN_Yes242.Designer.cs">
<DependentUpon>Check_ISBN_Yes242.cs</DependentUpon>
</Compile>
<Compile Include="마크\FillBlankItem.cs" />
<Compile Include="마크\Help_007.cs">
<SubType>Form</SubType>
</Compile>
@@ -352,13 +404,35 @@
<Compile Include="마크\Help_008.Designer.cs">
<DependentUpon>Help_008.cs</DependentUpon>
</Compile>
<Compile Include="마크\IsbnGridItem.cs" />
<Compile Include="마크\MacEditorParameter.cs" />
<Compile Include="마크\MacListItem.cs" />
<Compile Include="마크\Mac_List_Add2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Mac_List_Add2.Designer.cs">
<DependentUpon>Mac_List_Add2.cs</DependentUpon>
</Compile>
<Compile Include="마크\Mac_List_Add.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Mac_List_Add.Designer.cs">
<DependentUpon>Mac_List_Add.cs</DependentUpon>
</Compile>
<Compile Include="마크\Mac_List_Edit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Mac_List_Edit.Designer.cs">
<DependentUpon>Mac_List_Edit.cs</DependentUpon>
</Compile>
<Compile Include="마크\MarcBookItem.cs" />
<Compile Include="마크\MarcCopyItem.cs" />
<Compile Include="마크\MarcCopySelect2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\MarcCopySelect2.Designer.cs">
<DependentUpon>MarcCopySelect2.cs</DependentUpon>
</Compile>
<Compile Include="마크\MarcCopySelect.cs">
<SubType>Form</SubType>
</Compile>
@@ -377,6 +451,10 @@
<Compile Include="마크\Marc.designer.cs">
<DependentUpon>Marc.cs</DependentUpon>
</Compile>
<Compile Include="마크\MarcPlanItem.cs" />
<Compile Include="마크\Marc_CopyForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Marc_FillBlank.cs">
<SubType>Form</SubType>
</Compile>
@@ -488,6 +566,12 @@
<DependentUpon>Mac_Stat_Stat.cs</DependentUpon>
</Compile>
<Compile Include="마크\Marc_Macro_Sub.cs" />
<Compile Include="마크\Marc_mkList2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Marc_mkList2.Designer.cs">
<DependentUpon>Marc_mkList2.cs</DependentUpon>
</Compile>
<Compile Include="마크\Marc_mkList.cs">
<SubType>Form</SubType>
</Compile>
@@ -512,11 +596,11 @@
<Compile Include="마크\Marc_Plan_PrintLabel.Designer.cs">
<DependentUpon>Marc_Plan_PrintLabel.cs</DependentUpon>
</Compile>
<Compile Include="마크\Marc_Plan_Sub_MarcEdit2.cs">
<Compile Include="마크\fMarc_Editor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Marc_Plan_Sub_MarcEdit2.Designer.cs">
<DependentUpon>Marc_Plan_Sub_MarcEdit2.cs</DependentUpon>
<Compile Include="마크\fMarc_Editor.Designer.cs">
<DependentUpon>fMarc_Editor.cs</DependentUpon>
</Compile>
<Compile Include="마크\Marc_Plan_Sub_MarcEdit.cs">
<SubType>Form</SubType>
@@ -566,11 +650,12 @@
<Compile Include="마크\Marc_memo.Designer.cs">
<DependentUpon>Marc_memo.cs</DependentUpon>
</Compile>
<Compile Include="마크\Search_Infor_Sub.cs">
<Compile Include="마크\SearchInforItem.cs" />
<Compile Include="마크\Search_Infor2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Search_Infor_Sub.Designer.cs">
<DependentUpon>Search_Infor_Sub.cs</DependentUpon>
<Compile Include="마크\Search_Infor2.Designer.cs">
<DependentUpon>Search_Infor2.cs</DependentUpon>
</Compile>
<Compile Include="마크\SHDocVw.cs" />
<Compile Include="마크\ShowDeleteMarc.cs">
@@ -1026,12 +1111,24 @@
<EmbeddedResource Include="ListOfValue\fSelectDT.resx">
<DependentUpon>fSelectDT.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC_SelectGrade.resx">
<DependentUpon>UC_SelectGrade.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="개발자용\fDevDB.resx">
<DependentUpon>fDevDB.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="납품관리\Book_Lookup2.resx">
<DependentUpon>Book_Lookup2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="납품관리\Order_input_Search2.resx">
<DependentUpon>Order_input_Search2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마스터\From_User_manage_List.resx">
<DependentUpon>From_User_manage_List.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\AddMarc2.resx">
<DependentUpon>AddMarc2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\AddMarc.resx">
<DependentUpon>AddMarc.cs</DependentUpon>
</EmbeddedResource>
@@ -1062,15 +1159,36 @@
<EmbeddedResource Include="마크\Check_Copy_Sub_Selector.resx">
<DependentUpon>Check_Copy_Sub_Selector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Check_ISBN2.resx">
<DependentUpon>Check_ISBN2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Check_ISBN_ItemEdit.resx">
<DependentUpon>Check_ISBN_ItemEdit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Check_ISBN_Sub2.resx">
<DependentUpon>Check_ISBN_Sub2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Check_ISBN_Yes242.resx">
<DependentUpon>Check_ISBN_Yes242.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Help_007.resx">
<DependentUpon>Help_007.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Help_008.resx">
<DependentUpon>Help_008.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Mac_List_Add2.resx">
<DependentUpon>Mac_List_Add2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Mac_List_Add.resx">
<DependentUpon>Mac_List_Add.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Mac_List_Edit.resx">
<DependentUpon>Mac_List_Edit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\MarcCopySelect2.resx">
<DependentUpon>MarcCopySelect2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\MarcCopySelect.resx">
<DependentUpon>MarcCopySelect.cs</DependentUpon>
</EmbeddedResource>
@@ -1080,6 +1198,9 @@
<EmbeddedResource Include="마크\MarcEditorControl.resx">
<DependentUpon>MarcEditorControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_CopyForm.resx">
<DependentUpon>Marc_CopyForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_FillBlank.resx">
<DependentUpon>Marc_FillBlank.cs</DependentUpon>
</EmbeddedResource>
@@ -1134,6 +1255,9 @@
<EmbeddedResource Include="마크\Mac_Stat_Stat.resx">
<DependentUpon>Mac_Stat_Stat.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_mkList2.resx">
<DependentUpon>Marc_mkList2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_mkList.resx">
<DependentUpon>Marc_mkList.cs</DependentUpon>
</EmbeddedResource>
@@ -1146,8 +1270,8 @@
<EmbeddedResource Include="마크\Marc_Plan_PrintLabel.resx">
<DependentUpon>Marc_Plan_PrintLabel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_Plan_Sub_MarcEdit2.resx">
<DependentUpon>Marc_Plan_Sub_MarcEdit2.cs</DependentUpon>
<EmbeddedResource Include="마크\fMarc_Editor.resx">
<DependentUpon>fMarc_Editor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Marc_Plan_Sub_MarcEdit.resx">
<DependentUpon>Marc_Plan_Sub_MarcEdit.cs</DependentUpon>
@@ -1173,8 +1297,8 @@
<EmbeddedResource Include="마크\Marc_memo.resx">
<DependentUpon>Marc_memo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Search_Infor_Sub.resx">
<DependentUpon>Search_Infor_Sub.cs</DependentUpon>
<EmbeddedResource Include="마크\Search_Infor2.resx">
<DependentUpon>Search_Infor2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\ShowDeleteMarc.resx">
<DependentUpon>ShowDeleteMarc.cs</DependentUpon>
@@ -1932,6 +2056,12 @@
<None Include="Connected Services\BaroService_TI\UniMarc.BaroService_TI.UpdateUserPWDResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<Content Include="Helper\sample_fullmarc.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Helper\sample_richtext.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
@@ -2069,6 +2199,7 @@
<Content Include="Resources\3_2_1_목록.png" />
<Content Include="Resources\3_2_2_편목.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Selenium.WebDriver.4.34.0\build\Selenium.WebDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.4.34.0\build\Selenium.WebDriver.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@@ -1,4 +1,4 @@
namespace UniMarc.
namespace UniMarc
{
partial class fDevDB
{

View File

@@ -8,9 +8,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1;
namespace UniMarc.
namespace UniMarc
{
public partial class fDevDB : Form
{

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Book_Lookup
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -9,10 +10,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Mac;
using WindowsFormsApp1.;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Book_Lookup : Form
{
@@ -22,7 +21,6 @@ namespace WindowsFormsApp1.Delivery
List_Lookup ll;
Bring_Back bb;
Check_ISBN cisbn;
string compidx;
string list_name;
int idx;
public Book_Lookup(Order_input _oin)
@@ -30,35 +28,30 @@ namespace WindowsFormsApp1.Delivery
InitializeComponent();
oin = _oin;
idx = oin.grididx;
compidx = oin.compidx;
}
public Book_Lookup(Purchase _pur)
{
InitializeComponent();
pur = _pur;
idx = pur.grididx;
compidx = pur.compidx;
}
public Book_Lookup(List_Lookup _ll)
{
InitializeComponent();
ll = _ll;
idx = ll.grididx;
compidx = ll.compidx;
}
public Book_Lookup(Bring_Back _bb)
{
InitializeComponent();
bb = _bb;
idx = bb.grididx;
compidx = bb.compidx;
}
public Book_Lookup(Check_ISBN _isbn)
{
InitializeComponent();
cisbn = _isbn;
idx = cisbn.rowidx;
compidx = cisbn.compidx;
}
private void Book_Lookup_Load(object sender, EventArgs e)
{
@@ -72,7 +65,7 @@ namespace WindowsFormsApp1.Delivery
* idx 도서명 저자 출판사 isbn
* 정가 수량 입고수 합계금액 비고
* 주문처 주문일자 */
string[] List_book = { compidx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
string[] List_book = { PUB.user.CompanyIdx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
tb_pay.Text, tb_count.Text, tb_stock.Text, tb_total.Text, tb_etc.Text,
tb_order1.Text, tb_order_date.Text, tb_List_name.Text };
}
@@ -81,7 +74,7 @@ namespace WindowsFormsApp1.Delivery
string Area = "`order`, `pay`, `count`, `persent`, " + // 0-3
"`order_date`, `import_date`, `chk_date`, `export_date`"; // 4-7
string[] Search_col = { "compidx", "list_name", "book_name", "author", "book_comp" };
string[] Search_data = { compidx, tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
string[] Search_data = { PUB.user.CompanyIdx, tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
string cmd = db.More_DB_Search("Obj_List_Book", Search_col, Search_data, Area);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] db_data = db_res.Split('|');
@@ -125,7 +118,7 @@ namespace WindowsFormsApp1.Delivery
"`total`, `header`, `num`, `order`, `etc`, " +
"`input_count`, `order_date`, `list_name`, `idx`";
string[] data = { compidx, book_name, author, book_comp, list_name };
string[] data = { PUB.user.CompanyIdx, book_name, author, book_comp, list_name };
string[] table = { "compidx", "book_name", "author", "book_comp", "list_name" };
string cmd = db.More_DB_Search("Obj_List_Book", table, data, search);
string db_res = db.DB_Send_CMD_Search(cmd);
@@ -138,7 +131,7 @@ namespace WindowsFormsApp1.Delivery
"`total`, `header`, `num`, `order`, `etc`, " +
"`input_count`, `order_date`, `list_name`, `idx`";
string[] data = { compidx, idx };
string[] data = { PUB.user.CompanyIdx, idx };
string[] table = { "compidx", "idx" };
string cmd = db.More_DB_Search("Obj_List_Book", table, data, search);
string db_res = db.DB_Send_CMD_Search(cmd);
@@ -169,7 +162,7 @@ namespace WindowsFormsApp1.Delivery
private void list_db()
{
string[] where_table = { "comp_num", "list_name" };
string[] search_data = { compidx, list_name };
string[] search_data = { PUB.user.CompanyIdx, list_name };
string cmd = db.More_DB_Search("Obj_List", where_table, search_data,
"`clt`, `dly`, `charge`, `date`, `date_res`");
cmd = db.DB_Send_CMD_Search(cmd);
@@ -186,7 +179,7 @@ namespace WindowsFormsApp1.Delivery
private string isbn()
{
string[] where_table = { "compidx", "list_name", "book_name", "author", "book_comp" };
string[] search_data = { compidx,
string[] search_data = { PUB.user.CompanyIdx,
list_name, tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
string cmd = db.More_DB_Search("Obj_List_Book", where_table, search_data, "`isbn`");
string db_res = db.DB_Send_CMD_Search(cmd);
@@ -211,15 +204,15 @@ namespace WindowsFormsApp1.Delivery
"pay", "count", "input_count", "total", "etc",
"order", "order_date", "list_name" };
string[] List_book = {
compidx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
PUB.user.CompanyIdx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
tb_pay.Text, tb_count.Text, tb_stock.Text, tb_total.Text, tb_etc.Text,
tb_order1.Text, tb_order_date.Text, tb_List_name.Text };
string[] idx_table = { "idx" };
string[] idx_col = { lbl_idx.Text };
string U_cmd = db.More_Update("Obj_List_Book", Table, List_book, idx_table, idx_col);
db.DB_Send_CMD_reVoid(U_cmd);
MessageBox.Show("저장되었습니다.");
Helper_DB.ExcuteNonQuery(U_cmd);
UTIL.MsgI("저장되었습니다.");
}
private void btn_close_Click(object sender, EventArgs e)
{
@@ -232,11 +225,11 @@ namespace WindowsFormsApp1.Delivery
string[] edit_tbl = { "input_count", "import", "import_date" };
string[] edit_col = { tb_stock.Text, "입고", DateTime.Today.ToString("yyyy-MM-dd") };
string[] search_tbl = { "compidx", "list_name", "book_name", "author", "book_comp", "isbn" };
string[] search_col = { compidx,
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
db.DB_Send_CMD_reVoid(U_cmd);
MessageBox.Show(tb_book_name.Text + "가 입고처리되었습니다.");
Helper_DB.ExcuteNonQuery(U_cmd);
UTIL.MsgI(tb_book_name.Text + "가 입고처리되었습니다.");
mk_Grid();
}
@@ -248,12 +241,12 @@ namespace WindowsFormsApp1.Delivery
string[] edit_col = { tb_stock.Text, "미입고", "" };
string[] search_tbl = { "compidx",
"list_name", "book_name", "author", "book_comp", "isbn" };
string[] search_col = { compidx,
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_book_name.Text + "가 미입고처리되었습니다.");
UTIL.MsgI(tb_book_name.Text + "가 미입고처리되었습니다.");
mk_Grid();
}
private void btn_order_ccl_Click(object sender, EventArgs e)

View File

@@ -0,0 +1,679 @@
namespace UniMarc
{
partial class Book_Lookup2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.lbl_idx = new System.Windows.Forms.Label();
this.tb_isbn = new System.Windows.Forms.TextBox();
this.tb_order_idx = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.tb_etc = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.tb_num = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.tb_order1 = new System.Windows.Forms.TextBox();
this.tb_charge = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.tb_total = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tb_pay = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.tb_stock = new System.Windows.Forms.TextBox();
this.tb_count = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.tb_order_date = new System.Windows.Forms.TextBox();
this.tb_book_comp = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.tb_author = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tb_book_name = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tb_date = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.btn_stock = new System.Windows.Forms.Button();
this.btn_order_ccl = new System.Windows.Forms.Button();
this.btn_order = new System.Windows.Forms.Button();
this.btn_close = new System.Windows.Forms.Button();
this.btn_save = new System.Windows.Forms.Button();
this.btn_printLine = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.tb_List_name = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.tb_date_res = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btn_unstock = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.lbl_idx);
this.panel1.Controls.Add(this.tb_isbn);
this.panel1.Controls.Add(this.tb_order_idx);
this.panel1.Controls.Add(this.label9);
this.panel1.Controls.Add(this.tb_etc);
this.panel1.Controls.Add(this.label10);
this.panel1.Controls.Add(this.tb_num);
this.panel1.Controls.Add(this.label17);
this.panel1.Controls.Add(this.label20);
this.panel1.Controls.Add(this.tb_order1);
this.panel1.Controls.Add(this.tb_charge);
this.panel1.Controls.Add(this.label12);
this.panel1.Controls.Add(this.tb_total);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.tb_pay);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.tb_stock);
this.panel1.Controls.Add(this.tb_count);
this.panel1.Controls.Add(this.label13);
this.panel1.Controls.Add(this.label22);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.tb_order_date);
this.panel1.Controls.Add(this.tb_book_comp);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.tb_author);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.tb_book_name);
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(9, 106);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(648, 199);
this.panel1.TabIndex = 0;
//
// lbl_idx
//
this.lbl_idx.AutoSize = true;
this.lbl_idx.Location = new System.Drawing.Point(212, 10);
this.lbl_idx.Name = "lbl_idx";
this.lbl_idx.Size = new System.Drawing.Size(62, 12);
this.lbl_idx.TabIndex = 2;
this.lbl_idx.Text = "idx 들어감";
//
// tb_isbn
//
this.tb_isbn.Location = new System.Drawing.Point(414, 7);
this.tb_isbn.Name = "tb_isbn";
this.tb_isbn.Size = new System.Drawing.Size(215, 21);
this.tb_isbn.TabIndex = 1;
this.tb_isbn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// tb_order_idx
//
this.tb_order_idx.BackColor = System.Drawing.SystemColors.Control;
this.tb_order_idx.Enabled = false;
this.tb_order_idx.Location = new System.Drawing.Point(214, 168);
this.tb_order_idx.Name = "tb_order_idx";
this.tb_order_idx.Size = new System.Drawing.Size(43, 21);
this.tb_order_idx.TabIndex = 1;
this.tb_order_idx.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label9.Location = new System.Drawing.Point(374, 11);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(33, 12);
this.label9.TabIndex = 0;
this.label9.Text = "ISBN";
//
// tb_etc
//
this.tb_etc.Location = new System.Drawing.Point(69, 141);
this.tb_etc.Name = "tb_etc";
this.tb_etc.Size = new System.Drawing.Size(560, 21);
this.tb_etc.TabIndex = 1;
this.tb_etc.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label10.Location = new System.Drawing.Point(22, 10);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(29, 12);
this.label10.TabIndex = 0;
this.label10.Text = "번호";
//
// tb_num
//
this.tb_num.BackColor = System.Drawing.SystemColors.Control;
this.tb_num.Enabled = false;
this.tb_num.Location = new System.Drawing.Point(69, 6);
this.tb_num.Name = "tb_num";
this.tb_num.Size = new System.Drawing.Size(124, 21);
this.tb_num.TabIndex = 1;
this.tb_num.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label17
//
this.label17.AutoSize = true;
this.label17.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label17.Location = new System.Drawing.Point(22, 145);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(29, 12);
this.label17.TabIndex = 0;
this.label17.Text = "비고";
//
// label20
//
this.label20.AutoSize = true;
this.label20.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label20.Location = new System.Drawing.Point(14, 172);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(41, 12);
this.label20.TabIndex = 0;
this.label20.Text = "주문처";
//
// tb_order1
//
this.tb_order1.Location = new System.Drawing.Point(69, 168);
this.tb_order1.Name = "tb_order1";
this.tb_order1.Size = new System.Drawing.Size(139, 21);
this.tb_order1.TabIndex = 1;
this.tb_order1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// tb_charge
//
this.tb_charge.BackColor = System.Drawing.SystemColors.Control;
this.tb_charge.Enabled = false;
this.tb_charge.Location = new System.Drawing.Point(487, 87);
this.tb_charge.Name = "tb_charge";
this.tb_charge.Size = new System.Drawing.Size(142, 21);
this.tb_charge.TabIndex = 1;
this.tb_charge.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label12
//
this.label12.AutoSize = true;
this.label12.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label12.Location = new System.Drawing.Point(430, 91);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(41, 12);
this.label12.TabIndex = 0;
this.label12.Text = "담당자";
//
// tb_total
//
this.tb_total.Location = new System.Drawing.Point(487, 114);
this.tb_total.Name = "tb_total";
this.tb_total.Size = new System.Drawing.Size(142, 21);
this.tb_total.TabIndex = 1;
this.tb_total.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label6.Location = new System.Drawing.Point(424, 118);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 12);
this.label6.TabIndex = 0;
this.label6.Text = "합계금액";
//
// tb_pay
//
this.tb_pay.Location = new System.Drawing.Point(69, 114);
this.tb_pay.Name = "tb_pay";
this.tb_pay.Size = new System.Drawing.Size(124, 21);
this.tb_pay.TabIndex = 1;
this.tb_pay.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label5.Location = new System.Drawing.Point(22, 118);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(29, 12);
this.label5.TabIndex = 0;
this.label5.Text = "정가";
//
// tb_stock
//
this.tb_stock.Location = new System.Drawing.Point(357, 114);
this.tb_stock.Name = "tb_stock";
this.tb_stock.Size = new System.Drawing.Size(57, 21);
this.tb_stock.TabIndex = 1;
this.tb_stock.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// tb_count
//
this.tb_count.Location = new System.Drawing.Point(242, 114);
this.tb_count.Name = "tb_count";
this.tb_count.Size = new System.Drawing.Size(57, 21);
this.tb_count.TabIndex = 1;
this.tb_count.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label13
//
this.label13.AutoSize = true;
this.label13.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label13.Location = new System.Drawing.Point(314, 118);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(41, 12);
this.label13.TabIndex = 0;
this.label13.Text = "입고수";
//
// label22
//
this.label22.AutoSize = true;
this.label22.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label22.Location = new System.Drawing.Point(349, 172);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(53, 12);
this.label22.TabIndex = 0;
this.label22.Text = "주문일자";
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label4.Location = new System.Drawing.Point(211, 118);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 12);
this.label4.TabIndex = 0;
this.label4.Text = "수량";
//
// tb_order_date
//
this.tb_order_date.BackColor = System.Drawing.SystemColors.Control;
this.tb_order_date.Enabled = false;
this.tb_order_date.Location = new System.Drawing.Point(409, 168);
this.tb_order_date.Name = "tb_order_date";
this.tb_order_date.Size = new System.Drawing.Size(220, 21);
this.tb_order_date.TabIndex = 1;
this.tb_order_date.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// tb_book_comp
//
this.tb_book_comp.Location = new System.Drawing.Point(69, 87);
this.tb_book_comp.Name = "tb_book_comp";
this.tb_book_comp.Size = new System.Drawing.Size(345, 21);
this.tb_book_comp.TabIndex = 1;
this.tb_book_comp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label3.Location = new System.Drawing.Point(16, 91);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 0;
this.label3.Text = "출판사";
//
// tb_author
//
this.tb_author.Location = new System.Drawing.Point(69, 60);
this.tb_author.Name = "tb_author";
this.tb_author.Size = new System.Drawing.Size(345, 21);
this.tb_author.TabIndex = 1;
this.tb_author.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label2.Location = new System.Drawing.Point(22, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 12);
this.label2.TabIndex = 0;
this.label2.Text = "저자";
//
// tb_book_name
//
this.tb_book_name.Location = new System.Drawing.Point(69, 33);
this.tb_book_name.Name = "tb_book_name";
this.tb_book_name.Size = new System.Drawing.Size(560, 21);
this.tb_book_name.TabIndex = 1;
this.tb_book_name.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label1.Location = new System.Drawing.Point(16, 37);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
this.label1.Text = "도서명";
//
// tb_date
//
this.tb_date.Enabled = false;
this.tb_date.Location = new System.Drawing.Point(69, 34);
this.tb_date.Name = "tb_date";
this.tb_date.Size = new System.Drawing.Size(230, 21);
this.tb_date.TabIndex = 1;
this.tb_date.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label7.Location = new System.Drawing.Point(10, 38);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(53, 12);
this.label7.TabIndex = 0;
this.label7.Text = "목록일자";
//
// btn_stock
//
this.btn_stock.Location = new System.Drawing.Point(90, 6);
this.btn_stock.Name = "btn_stock";
this.btn_stock.Size = new System.Drawing.Size(75, 23);
this.btn_stock.TabIndex = 3;
this.btn_stock.Text = "입고처리";
this.btn_stock.UseVisualStyleBackColor = true;
this.btn_stock.Click += new System.EventHandler(this.btn_stock_Click);
//
// btn_order_ccl
//
this.btn_order_ccl.Location = new System.Drawing.Point(171, 6);
this.btn_order_ccl.Name = "btn_order_ccl";
this.btn_order_ccl.Size = new System.Drawing.Size(75, 23);
this.btn_order_ccl.TabIndex = 3;
this.btn_order_ccl.Text = "주문취소";
this.btn_order_ccl.UseVisualStyleBackColor = true;
this.btn_order_ccl.Click += new System.EventHandler(this.btn_order_ccl_Click);
//
// btn_order
//
this.btn_order.Location = new System.Drawing.Point(252, 6);
this.btn_order.Name = "btn_order";
this.btn_order.Size = new System.Drawing.Size(75, 23);
this.btn_order.TabIndex = 3;
this.btn_order.Text = "주문처리";
this.btn_order.UseVisualStyleBackColor = true;
this.btn_order.Click += new System.EventHandler(this.btn_order_Click);
//
// btn_close
//
this.btn_close.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.btn_close.Location = new System.Drawing.Point(564, 6);
this.btn_close.Name = "btn_close";
this.btn_close.Size = new System.Drawing.Size(75, 23);
this.btn_close.TabIndex = 3;
this.btn_close.Text = "닫 기";
this.btn_close.UseVisualStyleBackColor = true;
this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
//
// btn_save
//
this.btn_save.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.btn_save.Location = new System.Drawing.Point(483, 6);
this.btn_save.Name = "btn_save";
this.btn_save.Size = new System.Drawing.Size(75, 23);
this.btn_save.TabIndex = 3;
this.btn_save.Text = "저 장";
this.btn_save.UseVisualStyleBackColor = true;
this.btn_save.Click += new System.EventHandler(this.btn_save_Click);
//
// btn_printLine
//
this.btn_printLine.Location = new System.Drawing.Point(333, 6);
this.btn_printLine.Name = "btn_printLine";
this.btn_printLine.Size = new System.Drawing.Size(75, 23);
this.btn_printLine.TabIndex = 3;
this.btn_printLine.Text = "띠지출력";
this.btn_printLine.UseVisualStyleBackColor = true;
this.btn_printLine.Visible = false;
this.btn_printLine.Click += new System.EventHandler(this.btn_printLine_Click);
//
// panel2
//
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.tb_List_name);
this.panel2.Controls.Add(this.label11);
this.panel2.Controls.Add(this.tb_date_res);
this.panel2.Controls.Add(this.label8);
this.panel2.Controls.Add(this.tb_date);
this.panel2.Controls.Add(this.label7);
this.panel2.Location = new System.Drawing.Point(9, 36);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(648, 64);
this.panel2.TabIndex = 4;
//
// tb_List_name
//
this.tb_List_name.Enabled = false;
this.tb_List_name.Location = new System.Drawing.Point(69, 7);
this.tb_List_name.Name = "tb_List_name";
this.tb_List_name.Size = new System.Drawing.Size(560, 21);
this.tb_List_name.TabIndex = 1;
this.tb_List_name.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label11
//
this.label11.AutoSize = true;
this.label11.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label11.Location = new System.Drawing.Point(16, 11);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(41, 12);
this.label11.TabIndex = 0;
this.label11.Text = "목록명";
//
// tb_date_res
//
this.tb_date_res.Enabled = false;
this.tb_date_res.Location = new System.Drawing.Point(399, 34);
this.tb_date_res.Name = "tb_date_res";
this.tb_date_res.Size = new System.Drawing.Size(230, 21);
this.tb_date_res.TabIndex = 1;
this.tb_date_res.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label8.Location = new System.Drawing.Point(340, 38);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(53, 12);
this.label8.TabIndex = 0;
this.label8.Text = "완료일자";
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2,
this.Column3,
this.Column4,
this.Column5,
this.Column6});
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dataGridView1.Location = new System.Drawing.Point(9, 311);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidth = 15;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(648, 190);
this.dataGridView1.TabIndex = 5;
//
// Column1
//
this.Column1.HeaderText = "처리일자";
this.Column1.Name = "Column1";
//
// Column2
//
this.Column2.HeaderText = "구분";
this.Column2.Name = "Column2";
//
// Column3
//
this.Column3.HeaderText = "거래처명";
this.Column3.Name = "Column3";
this.Column3.Width = 250;
//
// Column4
//
this.Column4.HeaderText = "단가";
this.Column4.Name = "Column4";
this.Column4.Width = 80;
//
// Column5
//
this.Column5.HeaderText = "수량";
this.Column5.Name = "Column5";
this.Column5.Width = 40;
//
// Column6
//
this.Column6.HeaderText = "%";
this.Column6.Name = "Column6";
this.Column6.Width = 40;
//
// btn_unstock
//
this.btn_unstock.Location = new System.Drawing.Point(9, 6);
this.btn_unstock.Name = "btn_unstock";
this.btn_unstock.Size = new System.Drawing.Size(75, 23);
this.btn_unstock.TabIndex = 6;
this.btn_unstock.Text = "미입고처리";
this.btn_unstock.UseVisualStyleBackColor = true;
this.btn_unstock.Click += new System.EventHandler(this.btn_unstock_Click);
//
// Book_Lookup
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(667, 510);
this.Controls.Add(this.btn_unstock);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.btn_save);
this.Controls.Add(this.btn_close);
this.Controls.Add(this.btn_printLine);
this.Controls.Add(this.btn_order);
this.Controls.Add(this.btn_order_ccl);
this.Controls.Add(this.btn_stock);
this.Controls.Add(this.panel1);
this.Name = "Book_Lookup";
this.Text = "도서 정보";
this.Load += new System.EventHandler(this.Book_Lookup_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Book_Lookup_KeyDown);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox tb_isbn;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox tb_etc;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox tb_charge;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox tb_num;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox tb_date;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox tb_total;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox tb_pay;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox tb_count;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox tb_book_comp;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox tb_author;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tb_book_name;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_order_idx;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.TextBox tb_order1;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox tb_order_date;
private System.Windows.Forms.Button btn_stock;
private System.Windows.Forms.Button btn_order_ccl;
private System.Windows.Forms.Button btn_order;
private System.Windows.Forms.Button btn_close;
private System.Windows.Forms.Button btn_save;
private System.Windows.Forms.Button btn_printLine;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TextBox tb_date_res;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox tb_List_name;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.TextBox tb_stock;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lbl_idx;
private System.Windows.Forms.Button btn_unstock;
}
}

View File

@@ -0,0 +1,321 @@
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc
{
public partial class Book_Lookup2 : Form
{
Helper_DB db = new Helper_DB();
Order_input oin;
Purchase pur;
List_Lookup ll;
Bring_Back bb;
Check_ISBN2 cisbn;
string list_name;
int idx;
public Book_Lookup2(Order_input _oin)
{
InitializeComponent();
oin = _oin;
idx = oin.grididx;
}
public Book_Lookup2(Purchase _pur)
{
InitializeComponent();
pur = _pur;
idx = pur.grididx;
}
public Book_Lookup2(List_Lookup _ll)
{
InitializeComponent();
ll = _ll;
idx = ll.grididx;
}
public Book_Lookup2(Bring_Back _bb)
{
InitializeComponent();
bb = _bb;
idx = bb.grididx;
}
public Book_Lookup2(Check_ISBN2 _isbn)
{
InitializeComponent();
cisbn = _isbn;
idx = cisbn.rowidx;
}
private void Book_Lookup_Load(object sender, EventArgs e)
{
db.DBcon();
tb_isbn.Text = isbn();
list_db();
this.Text = "도서 정보 - 『" + tb_book_name.Text + "』";
mk_Grid();
/* Obj_List_Book
* idx 도서명 저자 출판사 isbn
* 정가 수량 입고수 합계금액 비고
* 주문처 주문일자 */
string[] List_book = { PUB.user.CompanyIdx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
tb_pay.Text, tb_count.Text, tb_stock.Text, tb_total.Text, tb_etc.Text,
tb_order1.Text, tb_order_date.Text, tb_List_name.Text };
}
private void mk_Grid()
{
string Area = "`order`, `pay`, `count`, `persent`, " + // 0-3
"`order_date`, `import_date`, `chk_date`, `export_date`"; // 4-7
string[] Search_col = { "compidx", "list_name", "book_name", "author", "book_comp" };
string[] Search_data = { PUB.user.CompanyIdx, tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
string cmd = db.More_DB_Search("Obj_List_Book", Search_col, Search_data, Area);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] db_data = db_res.Split('|');
string[] add_grid = { "", "", db_data[0], db_data[1], db_data[2], db_data[3] };
// 처리일자 구분 거래처명 단가 수량 %
if (db_data[4] != "") {
add_grid[0] = db_data[4];
add_grid[1] = "주문";
dataGridView1.Rows.Add(add_grid);
}
if (db_data[5] != "") {
add_grid[0] = db_data[5];
add_grid[1] = "입고";
btn_printLine.Visible = true;
dataGridView1.Rows.Add(add_grid);
}
if (db_data[6] != "") {
add_grid[0] = db_data[6];
add_grid[1] = "검수";
dataGridView1.Rows.Add(add_grid);
}
if (db_data[7] != "") {
add_grid[0] = db_data[7];
add_grid[1] = "출고";
dataGridView1.Rows.Add(add_grid);
}
}
/// <summary>
/// 폼에 들어갈 데이터를 사전에 준비하여야함.
/// </summary>
/// <param name="book_name"></param>
/// <param name="author"></param>
/// <param name="book_comp"></param>
/// <param name="list_name"></param>
public void Lookup_Load(string book_name, string author, string book_comp, string list_name)
{
this.list_name = list_name;
db.DBcon();
string search = "`book_name`, `author`, `book_comp`, `count`, `pay`, " +
"`total`, `header`, `num`, `order`, `etc`, " +
"`input_count`, `order_date`, `list_name`, `idx`";
string[] data = { PUB.user.CompanyIdx, book_name, author, book_comp, list_name };
string[] table = { "compidx", "book_name", "author", "book_comp", "list_name" };
string cmd = db.More_DB_Search("Obj_List_Book", table, data, search);
string db_res = db.DB_Send_CMD_Search(cmd);
mk_Lookup(db_res);
}
public void Lookup_Load_tmp(string idx)
{
db.DBcon();
string search = "`book_name`, `author`, `book_comp`, `count`, `pay`, " +
"`total`, `header`, `num`, `order`, `etc`, " +
"`input_count`, `order_date`, `list_name`, `idx`";
string[] data = { PUB.user.CompanyIdx, idx };
string[] table = { "compidx", "idx" };
string cmd = db.More_DB_Search("Obj_List_Book", table, data, search);
string db_res = db.DB_Send_CMD_Search(cmd);
mk_Lookup(db_res);
}
private void mk_Lookup(string values)
{
string[] data = values.Split('|');
tb_book_name.Text = data[0];
tb_author.Text = data[1];
tb_book_comp.Text = data[2];
tb_count.Text = data[3];
tb_pay.Text = data[4];
tb_total.Text = data[5];
tb_num.Text = data[6] + " " + data[7];
tb_order1.Text = data[8];
tb_etc.Text = data[9];
tb_stock.Text = data[10];
if (data[11].Length < 3) { tb_order_date.Text = ""; }
else { tb_order_date.Text = data[11].Substring(0, 10); }
this.list_name = data[12];
lbl_idx.Text = data[13];
}
/// <summary>
/// 목록db에서 불러온 값을 적용시키는 함수
/// </summary>
private void list_db()
{
string[] where_table = { "comp_num", "list_name" };
string[] search_data = { PUB.user.CompanyIdx, list_name };
string cmd = db.More_DB_Search("Obj_List", where_table, search_data,
"`clt`, `dly`, `charge`, `date`, `date_res`");
cmd = db.DB_Send_CMD_Search(cmd);
string[] data = cmd.Split('|');
tb_List_name.Text = list_name;
tb_charge.Text = data[2];
tb_date.Text = data[3];
tb_date_res.Text = data[4];
}
/// <summary>
/// 목록도서DB에 저장된 isbn값을 가져오는 함수.
/// </summary>
/// <returns></returns>
private string isbn()
{
string[] where_table = { "compidx", "list_name", "book_name", "author", "book_comp" };
string[] search_data = { PUB.user.CompanyIdx,
list_name, tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
string cmd = db.More_DB_Search("Obj_List_Book", where_table, search_data, "`isbn`");
string db_res = db.DB_Send_CMD_Search(cmd);
db_res = db_res.Replace("|", "");
return db_res;
}
private void Book_Lookup_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
btn_close_Click(null, null);
}
}
private void btn_save_Click(object sender, EventArgs e)
{
/* Obj_List_Book
* idx 도서명 저자 출판사 isbn
* 정가 수량 입고수 합계금액 비고
* 주문처 주문일자 */
string[] Table = {
"compidx", "book_name", "author", "book_comp", "isbn",
"pay", "count", "input_count", "total", "etc",
"order", "order_date", "list_name" };
string[] List_book = {
PUB.user.CompanyIdx, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text,
tb_pay.Text, tb_count.Text, tb_stock.Text, tb_total.Text, tb_etc.Text,
tb_order1.Text, tb_order_date.Text, tb_List_name.Text };
string[] idx_table = { "idx" };
string[] idx_col = { lbl_idx.Text };
string U_cmd = db.More_Update("Obj_List_Book", Table, List_book, idx_table, idx_col);
Helper_DB.ExcuteNonQuery(U_cmd);
UTIL.MsgI("저장되었습니다.");
}
private void btn_close_Click(object sender, EventArgs e)
{
Close();
}
private void btn_stock_Click(object sender, EventArgs e)
{
tb_stock.Text = tb_count.Text;
string[] edit_tbl = { "input_count", "import", "import_date" };
string[] edit_col = { tb_stock.Text, "입고", DateTime.Today.ToString("yyyy-MM-dd") };
string[] search_tbl = { "compidx", "list_name", "book_name", "author", "book_comp", "isbn" };
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
Helper_DB.ExcuteNonQuery(U_cmd);
UTIL.MsgI(tb_book_name.Text + "가 입고처리되었습니다.");
mk_Grid();
}
private void btn_unstock_Click(object sender, EventArgs e)
{
tb_stock.Text = "0";
string[] edit_tbl = { "input_count", "import", "import_date" };
string[] edit_col = { tb_stock.Text, "미입고", "" };
string[] search_tbl = { "compidx",
"list_name", "book_name", "author", "book_comp", "isbn" };
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
Helper_DB.ExcuteNonQuery(U_cmd);
UTIL.MsgI(tb_book_name.Text + "가 미입고처리되었습니다.");
mk_Grid();
}
private void btn_order_ccl_Click(object sender, EventArgs e)
{
tb_order1.Text = "";
tb_order_date.Text = "";
tb_order_idx.Text = "";
}
private void btn_order_Click(object sender, EventArgs e)
{
tb_order_date.Text = DateTime.Now.ToString("G").Substring(0, 10);
}
private void btn_printLine_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
pd.DocumentName = "띠지 출력";
pd.DefaultPageSettings.Landscape = true;
pd.PrintPage += new PrintPageEventHandler(this.pd_Print_Page);
pd.Print();
}
#region PrintLine_Sub
private void pd_Print_Page(object sender, PrintPageEventArgs e)
{
string list_name = tb_List_name.Text.Replace("[", "");
list_name = list_name.Replace("]", "-");
string book_name = tb_book_name.Text;
string price = tb_pay.Text.Replace(",", "");
price = string.Format("{0:#,###}", Convert.ToInt32(price));
tb_pay.Text = price;
string[] text = { tb_num.Text, tb_count.Text, list_name, book_name, price, tb_book_comp.Text, tb_isbn.Text };
Graphics g = e.Graphics;
int xPos = 0;
int yPos = 0;
int MaxX = 133;
Pen p = new Pen(Color.Black);
Font title = new Font("굴림", 22, FontStyle.Bold);
Font count = new Font("굴림", 16, FontStyle.Bold);
Font list = new Font("굴림", 14, FontStyle.Regular);
Font book = new Font("굴림", 18, FontStyle.Regular);
Font price_f = new Font("굴림", 14, FontStyle.Regular);
RectangleF title_Area = new RectangleF(xPos, yPos, MaxX, 35);
yPos += 30;
RectangleF count_Area = new RectangleF(xPos, yPos, MaxX, 35);
yPos += 25;
RectangleF list_Area = new RectangleF(xPos, yPos, MaxX, 70);
yPos += 65;
RectangleF book_Area1 = new RectangleF(xPos, yPos, MaxX, 120);
yPos += 115;
RectangleF price_Area = new RectangleF(xPos, yPos, MaxX, 70);
//g.DrawLine(p, MaxX, 0, MaxX, yPos);
using (SolidBrush drawBrush = new SolidBrush(Color.Black))
{
g.DrawString(text[0], title, drawBrush, title_Area);
g.DrawString(text[1], count, drawBrush, count_Area);
g.DrawString(text[2], list, drawBrush, list_Area);
g.DrawString(text[3], book, drawBrush, book_Area1);
g.DrawString(text[4], price_f, drawBrush, price_Area);
}
}
#endregion
}
}

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -1,5 +1,5 @@
namespace WindowsFormsApp1.
namespace UniMarc
{
partial class Bring_Back
{

View File

@@ -7,13 +7,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Delivery;
namespace WindowsFormsApp1.
namespace UniMarc
{
public partial class Bring_Back : Form
{
public string compidx;
public int grididx;
Main main;
Helper_DB db = new Helper_DB();
@@ -21,14 +19,13 @@ namespace WindowsFormsApp1.납품관리
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
}
private void Bring_Back_Load(object sender, EventArgs e)
{
db.DBcon();
string Area = "`list_name`";
string[] sear_col = { "comp_num", "state" };
string[] sear_data = { compidx, "진행" };
string[] sear_data = { PUB.user.CompanyIdx, "진행" };
string cmd = db.More_DB_Search("Obj_List", sear_col, sear_data, Area);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] arr_data = db_res.Split('|');
@@ -44,7 +41,7 @@ namespace WindowsFormsApp1.납품관리
string Area = "`idx`, `num`, `book_name`, `author`, `book_comp`, " +
"`isbn`, `price`, `count`, `total`, `list_name`, `etc`";
string[] sear_col = { "compidx", "list_name" };
string[] sear_data = { compidx, cb_list_name.Text };
string[] sear_data = { PUB.user.CompanyIdx, cb_list_name.Text };
string cmd = db.More_DB_Search("Obj_List_Book", sear_col, sear_data, Area);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] arr_data = db_res.Split('|');
@@ -92,11 +89,11 @@ namespace WindowsFormsApp1.납품관리
private void Return(int a)
{
string[] sear_col = { "idx", "compidx" };
string[] sear_data = { dataGridView1.Rows[a].Cells["idx"].Value.ToString(), compidx };
string[] sear_data = { dataGridView1.Rows[a].Cells["idx"].Value.ToString(), PUB.user.CompanyIdx };
string[] edit_col = { "import", "etc" };
string[] edit_data = { "미입고", "반품처리 " + dataGridView1.Rows[a].Cells["etc"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, sear_col, sear_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
#endregion
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Commodity_Edit
{

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Commodity_Edit : Form
{
@@ -60,7 +60,7 @@ namespace WindowsFormsApp1.Delivery
string[] book_data = { date, New_Name.Text };
string U_cmd = DB.More_Update("Obj_List_Book", book_col, book_data, book_search_col, book_search_data);
DB.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
////////////////////////////////////////
@@ -71,7 +71,7 @@ namespace WindowsFormsApp1.Delivery
string[] list_data = { date, New_Clit.Text, New_Dlv.Text, New_User.Text, New_Name.Text };
U_cmd = DB.More_Update("Obj_List", list_col, list_data, list_search_col, list_search_data);
DB.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
Close();
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Commodity_Morge
{

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Commodity_Morge : Form
{
@@ -99,7 +99,7 @@ namespace WindowsFormsApp1.Delivery
string cmd = "";
cmd = DB.More_Update("Obj_List_Book", up_col, up_data1, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
int cout1 = Convert.ToInt32(list1[7]);
int cout2 = Convert.ToInt32(list2[7]);
int cout = cout1 + cout2;
@@ -111,17 +111,17 @@ namespace WindowsFormsApp1.Delivery
string[] edit_col = { "total", "compidx" };
string[] edit_data = { tol.ToString(), com.comp_idx };
cmd = DB.More_Update("Obj_List_Marc", edit_col, edit_data, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List_Marc", "compidx", com.comp_idx, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
edit_col[1] = "vol";
edit_data[1] = cout.ToString();
up_col[0] = "comp_num";
cmd = DB.More_Update("Obj_List", edit_col, edit_data, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List", "comp_num", com.comp_idx, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
/// <summary>
/// data1가 data2으로 적용됨. 1 => 2로
@@ -133,7 +133,7 @@ namespace WindowsFormsApp1.Delivery
string[] up_data2 = tmp2.ToArray();
string cmd = "";
cmd = DB.More_Update("Obj_List_Book", up_col, up_data2, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
int cout1 = Convert.ToInt32(list1[7]);
int cout2 = Convert.ToInt32(list2[7]);
int cout = cout1 + cout2;
@@ -145,17 +145,17 @@ namespace WindowsFormsApp1.Delivery
string[] edit_col = { "total", "compidx" };
string[] edit_data = { tol.ToString(), com.comp_idx };
cmd = DB.More_Update("Obj_List_Marc", edit_col, edit_data, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List_Marc", "compidx", com.comp_idx, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
edit_col[1] = "vol";
edit_data[1] = cout.ToString();
up_col[0] = "comp_num";
cmd = DB.More_Update("Obj_List", edit_col, edit_data, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List", "comp_num", com.comp_idx, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
}
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Commodity_Search
{
@@ -71,7 +71,7 @@
this.dataGridView1.RowHeadersWidth = 20;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(563, 242);
this.dataGridView1.Size = new System.Drawing.Size(984, 661);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
@@ -126,9 +126,10 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(563, 242);
this.ClientSize = new System.Drawing.Size(984, 661);
this.Controls.Add(this.dataGridView1);
this.Name = "Commodity_Search";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Commodity_Sub";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Commodity_Search_FormClosed);
this.Load += new System.EventHandler(this.Commodity_Sub_Load);

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -7,12 +8,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Account;
using WindowsFormsApp1.DLS;
using WindowsFormsApp1.Home;
using WindowsFormsApp1.;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Commodity_Search : Form
{
@@ -25,8 +22,8 @@ namespace WindowsFormsApp1.Delivery
Sales_Lookup sb;
Sales_In_Pay sip;
List_Lookup ll;
Mac.DLS_Copy dc;
School_Lookup sl;
DLS_Copy dc;
DLS_Lookup sl;
public Commodity_Search(Purchase _pur)
{
@@ -68,12 +65,12 @@ namespace WindowsFormsApp1.Delivery
InitializeComponent();
ll = _ll;
}
public Commodity_Search(Mac.DLS_Copy _dc)
public Commodity_Search(DLS_Copy _dc)
{
InitializeComponent();
dc = _dc;
}
public Commodity_Search(School_Lookup _sl)
public Commodity_Search(DLS_Lookup _sl)
{
InitializeComponent();
sl = _sl;
@@ -111,7 +108,13 @@ namespace WindowsFormsApp1.Delivery
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
string value = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
string value = dataGridView1.Rows[e.RowIndex].Cells[0].Value?.ToString() ?? string.Empty;
if(value.isEmpty())
{
UTIL.MsgE("값이 없습니다.\n잠시 후 다시 시도하세요");
return;
}
Set_data(value, e.RowIndex);
@@ -180,7 +183,7 @@ namespace WindowsFormsApp1.Delivery
if (com != null) { com.tb_clt1.Text = value; }
if (pur != null) { pur.tb_clt.Text = value; }
if (la != null) { la.tb_clt.Text = value; la.btn_lookup_Click(null, null); }
if (si != null) { si.tb_clt.Text = value; si.lbl_tel.Text = dataGridView1.Rows[idx].Cells[2].Value.ToString(); }
if (si != null) { si.tb_clt.Text = value; si.lbl_tel.Text = dataGridView1.Rows[idx].Cells[2].Value?.ToString() ?? string.Empty; }
if (sb != null) { sb.tb_clt.Text = value; sb.btn_Lookup_Click(null, null); }
if (sip != null) { sip.tb_clt.Text = value; }
if (ll != null) { ll.tb_clt.Text = value; }
@@ -188,17 +191,17 @@ namespace WindowsFormsApp1.Delivery
dc.tb_SearchClient.Text = value;
dc.lbl_Client.Text = value;
dc.lbl_ID.Text = dataGridView1.Rows[idx].Cells["DLS_ID"].Value.ToString();
dc.lbl_PW.Text = dataGridView1.Rows[idx].Cells["DLS_PW"].Value.ToString();
dc.lbl_Area.Text = dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString();
dc.lbl_PW.Text = dataGridView1.Rows[idx].Cells["DLS_PW"].Value?.ToString() ?? string.Empty;
dc.lbl_Area.Text = dataGridView1.Rows[idx].Cells["DLS_Area"].Value?.ToString() ?? string.Empty;
dc.btn_Connect.PerformClick();
//dc.SetArea(dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString(), true);
}
if (sl != null) {
sl.tb_SearchClient.Text = value;
sl.lbl_Client.Text = value;
sl.lbl_ID.Text = dataGridView1.Rows[idx].Cells["DLS_ID"].Value.ToString();
sl.lbl_PW.Text = dataGridView1.Rows[idx].Cells["DLS_PW"].Value.ToString();
sl.lbl_Area.Text = dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString();
sl.lbl_ID.Text = dataGridView1.Rows[idx].Cells["DLS_ID"].Value?.ToString() ?? string.Empty;
sl.lbl_PW.Text = dataGridView1.Rows[idx].Cells["DLS_PW"].Value?.ToString() ?? string.Empty;
sl.lbl_Area.Text = dataGridView1.Rows[idx].Cells["DLS_Area"].Value?.ToString() ?? string.Empty;
sl.SetArea(dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString(), true);
}
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Commodity_registration
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -9,9 +10,8 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Mac;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Commodity_registration : Form
{
@@ -53,7 +53,7 @@ namespace WindowsFormsApp1.Delivery
}
User_Data_temp = main.DB_User_Data;
string[] User_Data = User_Data_temp.Split('|');
comp_idx = main.com_idx;
comp_idx = PUB.user.CompanyIdx;
tb_UserName.Text = User_Data[3];
Add_Grid("진행");
@@ -104,7 +104,7 @@ namespace WindowsFormsApp1.Delivery
}
else
{
MessageBox.Show("읽을 파일이 없습니다.", "에러", MessageBoxButtons.OK, MessageBoxIcon.Error);
UTIL.MsgE("읽을 파일이 없습니다.");
}
}
/// <summary>
@@ -127,16 +127,16 @@ namespace WindowsFormsApp1.Delivery
/// <param name="e"></param>
private void btn_Save_Click(object sender, EventArgs e)
{
if(cltchk == false || tb_clt1.Text=="") { MessageBox.Show("거래처를 확인해주세요."); return; }
if (chk_Save_DB() == -1) { MessageBox.Show("작업 대상을 선택해 주세요."); return; }
if(cltchk == false || tb_clt1.Text=="") { UTIL.MsgE("거래처를 확인해주세요."); return; }
if (chk_Save_DB() == -1) { UTIL.MsgE("작업 대상을 선택해 주세요."); return; }
string cmd = db.DB_Select_Search("name", "User_Data", "name", tb_UserName.Text);
if (db.DB_Send_CMD_Search(cmd) == "")
{ MessageBox.Show("담당자를 확인해주세요."); return; }
{ UTIL.MsgE("담당자를 확인해주세요."); return; }
// TODO: 목록명, 목록일자로 구분
cmd = db.DB_Search("Obj_List", "list_name", "[" + tb_dvy1.Text + "]" + tb_clt1.Text, "comp_num", comp_idx);
if (db.DB_Send_CMD_Search(cmd) != "")
{ MessageBox.Show("DB의 납품목록과 중복됩니다."); return; }
{ UTIL.MsgE("DB의 납품목록과 중복됩니다."); return; }
bool MsgOk = false;
int Marc_ton = chk_Save_DB();
@@ -190,7 +190,7 @@ namespace WindowsFormsApp1.Delivery
}
}
if (MsgOk) {
MessageBox.Show(Strmsg + "번째 행의 단가/수량/합계를 확인해 주세요.");
UTIL.MsgE(Strmsg + "번째 행의 단가/수량/합계를 확인해 주세요.");
return;
}
data[0] = start_date.Value.ToString().Substring(0,10);
@@ -218,10 +218,12 @@ namespace WindowsFormsApp1.Delivery
"chk_marc", "comp_num", "unstock" };
string[] setData = { data[0], data[1], data[2], data[3], data[4],
data[5], data[6], data[7], data[8], data[9],
data[12], main.com_idx, data[7] };
data[12], PUB.user.CompanyIdx, data[7] };
string Incmd = db.DB_INSERT("Obj_List", col_name, setData);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
UTIL.MsgI("저장되었습니다.");
Grid1_total();
dataGridView2.Rows.Add(add_grid_data);
@@ -270,7 +272,7 @@ namespace WindowsFormsApp1.Delivery
{
int cout = 0;
int delcout = 0;
if (MessageBox.Show("정말 삭제하시겠습니까?\n삭제는 1개씩입니다.", "Danger!!!", MessageBoxButtons.YesNo) == DialogResult.Yes)
if (UTIL.MsgQ("정말 삭제하시겠습니까?\n삭제는 1개씩입니다.") == DialogResult.Yes)
{
for (int a = 0; a < dataGridView2.Rows.Count; a++)
{
@@ -278,20 +280,20 @@ namespace WindowsFormsApp1.Delivery
if (isChecked)
{
if (cout == 0) { delcout = a; cout++; }
else { MessageBox.Show("체크가 2개이상 되어있습니다!"); cout++; break; }
else { UTIL.MsgE("체크가 2개이상 되어있습니다!"); cout++; break; }
}
}
if (cout == 0) { MessageBox.Show("체크된 사항이 없습니다."); return; }
if (cout == 0) { UTIL.MsgE("체크된 사항이 없습니다."); return; }
else if (cout == 1)
{
string[] del_target = { dataGridView2.Rows[delcout].Cells["list_date"].Value.ToString(),
dataGridView2.Rows[delcout].Cells["list_name"].Value.ToString() };
string[] del_table = { "date", "list_name" };
string cmd = db.DB_Delete_More_term("Obj_List", "comp_num", main.com_idx, del_table, del_target);
db.DB_Send_CMD_reVoid(cmd);
string cmd = db.DB_Delete_More_term("Obj_List", "comp_num", PUB.user.CompanyIdx, del_table, del_target);
Helper_DB.ExcuteNonQuery(cmd);
cmd = db.DB_Delete_No_Limit("Obj_List_Book", "compidx", comp_idx, del_table, del_target);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
dataGridView2.Rows.Remove(dataGridView2.Rows[delcout]);
}
@@ -306,10 +308,10 @@ namespace WindowsFormsApp1.Delivery
if (isChecked)
{
if (cout == 0) { EditNumber = a; cout++; }
else if (cout != 0) { MessageBox.Show("체크가 2개이상 되어있습니다!"); cout++; break; }
else if (cout != 0) { UTIL.MsgE("체크가 2개이상 되어있습니다!"); cout++; break; }
}
}
if (cout == 0) { MessageBox.Show("체크된 사항이 없습니다."); return; }
if (cout == 0) { UTIL.MsgE("체크된 사항이 없습니다."); return; }
if (cout == 1)
{
Commodity_Edit edit = new Commodity_Edit(this);
@@ -326,7 +328,7 @@ namespace WindowsFormsApp1.Delivery
string getdata = "`date`, `clt`, `dly`, `charge`, `list_name`, " +
"`vol`, `total`, `state`, `chk_marc`";
string[] othertable = { "comp_num", "state" };
string[] othercol = { main.com_idx, code };
string[] othercol = { PUB.user.CompanyIdx, code };
string cmd = db.More_DB_Search("Obj_List", othertable, othercol, getdata);
string db_res = db.DB_Send_CMD_Search(cmd);
@@ -393,7 +395,7 @@ namespace WindowsFormsApp1.Delivery
}
}
string Incmd = db.DB_INSERT("Obj_List_Book", DB_col_name, setData);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
}
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
@@ -418,10 +420,10 @@ namespace WindowsFormsApp1.Delivery
else if (cout != 0) { MorgeNum[1] = a; cout++; break; }
}
}
if (cout == 0) { MessageBox.Show("체크된 사항이 없습니다."); return; }
if (cout == 0) { UTIL.MsgE("체크된 사항이 없습니다."); return; }
else if (cout == 1)
{
MessageBox.Show("체크가 1개밖에 되어있지않습니다.");
UTIL.MsgE("체크가 1개밖에 되어있지않습니다.");
}
else if (cout == 2) {
Commodity_Morge morge = new Commodity_Morge(this);
@@ -429,12 +431,12 @@ namespace WindowsFormsApp1.Delivery
}
else if (cout > 2)
{
MessageBox.Show("체크된 사항이 너무 많습니다!");
UTIL.MsgE("체크된 사항이 너무 많습니다!");
}
}
private void btn_ing_Click(object sender, EventArgs e)
{
if(MessageBox.Show("진행처리 하시겠습니까?", "진행", MessageBoxButtons.YesNo) == DialogResult.Yes)
if(UTIL.MsgQ("진행처리 하시겠습니까?") == DialogResult.Yes)
{
for(int a = 0; a < dataGridView2.Rows.Count; a++)
{
@@ -447,7 +449,7 @@ namespace WindowsFormsApp1.Delivery
string[] sear_name = { dataGridView2.Rows[a].Cells["list_date"].Value.ToString(),
dataGridView2.Rows[a].Cells["list_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List", edit_col, edit_name, seer_col, sear_name);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[a].Cells["stat2"].Value = "진행";
}
}
@@ -456,7 +458,7 @@ namespace WindowsFormsApp1.Delivery
}
private void btn_Complet_Click(object sender, EventArgs e)
{
if (MessageBox.Show("완료처리 하시겠습니까?", "완료", MessageBoxButtons.YesNo) == DialogResult.Yes)
if (UTIL.MsgQ("완료처리 하시겠습니까?") == DialogResult.Yes)
{
for (int a = 0; a < dataGridView2.Rows.Count; a++)
{
@@ -469,7 +471,7 @@ namespace WindowsFormsApp1.Delivery
string[] sear_name = { dataGridView2.Rows[a].Cells["list_date"].Value.ToString(),
dataGridView2.Rows[a].Cells["list_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List", edit_col, edit_name, seer_col, sear_name);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[a].Cells["stat2"].Value = "완료";
}
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Input_Lookup_Stock
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -8,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Input_Lookup_Stock : Form
{
@@ -16,12 +17,12 @@ namespace WindowsFormsApp1.Delivery
Helper_DB db = new Helper_DB();
public string compidx;
string table_name = "Inven";
int rowidx=0;
int rowidx = 0;
public Input_Lookup_Stock(Main _main)
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
compidx = PUB.user.CompanyIdx;
}
private void Input_Lookup_Stock_Load(object sender, EventArgs e)
{
@@ -34,7 +35,7 @@ namespace WindowsFormsApp1.Delivery
string cmd = db.DB_Select_Search(Area, table_name, "compidx", compidx);
string db_res = db.DB_Send_CMD_Search(cmd);
mk_grid(db_res);
for(int a= 0; a < dataGridView1.Rows.Count; a++)
for (int a = 0; a < dataGridView1.Rows.Count; a++)
{
if (chk_stock(dataGridView1.Rows[a].Cells["ISBN"].Value.ToString()) == true)
{
@@ -48,7 +49,8 @@ namespace WindowsFormsApp1.Delivery
string[] data = db_data.Split('|');
string[] input_grid = { "", "", "", "", "",
"", "", "" };
for(int a = 0; a < data.Length; a++) {
for (int a = 0; a < data.Length; a++)
{
if (a % 8 == 0) { input_grid[0] = data[a]; }
if (a % 8 == 1) { input_grid[1] = data[a]; }
if (a % 8 == 2) { input_grid[2] = data[a]; }
@@ -56,10 +58,12 @@ namespace WindowsFormsApp1.Delivery
if (a % 8 == 4) { input_grid[4] = data[a]; }
if (a % 8 == 5) { input_grid[5] = data[a]; }
if (a % 8 == 6) { input_grid[6] = data[a]; }
if (a % 8 == 7) {
if (a % 8 == 7)
{
if (data[a].Length < 3) { input_grid[7] = data[a]; }
else { input_grid[7] = data[a].Substring(0, 10); }
dataGridView1.Rows.Add(input_grid); }
dataGridView1.Rows.Add(input_grid);
}
}
}
private void btn_Add_Click(object sender, EventArgs e)
@@ -70,13 +74,13 @@ namespace WindowsFormsApp1.Delivery
}
private void btn_Save_Click(object sender, EventArgs e)
{
if (tb_book_name.Text == "") { MessageBox.Show("도서명을 작성해주세요."); return; }
if (tb_isbn.Text == "") { MessageBox.Show("ISBN을 작성해주세요."); return; }
if (tb_book_comp.Text == "") { MessageBox.Show("출판사를 작성해주세요."); return; }
if (tb_author.Text == "") { MessageBox.Show("저자를 작성해주세요."); return; }
if (tb_pay.Text == "") { MessageBox.Show("정가를 작성해주세요."); return; }
if (tb_order.Text == "") { MessageBox.Show("매입처를 작성해주세요."); return; }
if (tb_count.Text == "") { MessageBox.Show("수량을 작성해주세요."); return; }
if (tb_book_name.Text == "") { UTIL.MsgE("도서명을 작성해주세요."); return; }
if (tb_isbn.Text == "") { UTIL.MsgE("ISBN을 작성해주세요."); return; }
if (tb_book_comp.Text == "") { UTIL.MsgE("출판사를 작성해주세요."); return; }
if (tb_author.Text == "") { UTIL.MsgE("저자를 작성해주세요."); return; }
if (tb_pay.Text == "") { UTIL.MsgE("정가를 작성해주세요."); return; }
if (tb_order.Text == "") { UTIL.MsgE("매입처를 작성해주세요."); return; }
if (tb_count.Text == "") { UTIL.MsgE("수량을 작성해주세요."); return; }
if (!ask_SaveChk(grid_text_savechk())) { return; }
@@ -85,8 +89,8 @@ namespace WindowsFormsApp1.Delivery
string[] where = { "book_name", "isbn", "book_comp", "author", "pay",
"order", "count", "import_date", "compidx" };
string Incmd = db.DB_INSERT(table_name, where, input);
db.DB_Send_CMD_reVoid(Incmd);
MessageBox.Show("저장되었습니다!");
Helper_DB.ExcuteNonQuery(Incmd);
UTIL.MsgI("저장되었습니다!");
}
private bool grid_text_savechk()
{
@@ -106,10 +110,10 @@ namespace WindowsFormsApp1.Delivery
}
private bool ask_SaveChk(bool ask)
{
if (!ask) {
if (MessageBox.Show("저장하실 내용이 입고에 저장되어있습니다. 저장하시겠습니까?", "경고!",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) {
if (!ask)
{
if (UTIL.MsgQ("저장하실 내용이 입고에 저장되어있습니다. 저장하시겠습니까?") != DialogResult.Yes)
{
return false;
}
}
@@ -135,7 +139,7 @@ namespace WindowsFormsApp1.Delivery
private void stock_check(string[] stock)
{
string[] gird = { "", "", "", "", "", "", "", "" };
for(int a = 0; a < stock.Length - 1; a++)
for (int a = 0; a < stock.Length - 1; a++)
{
if (a % 8 == 0) { gird[0] = stock[a]; }
if (a % 8 == 1) { gird[1] = stock[a]; }
@@ -144,10 +148,12 @@ namespace WindowsFormsApp1.Delivery
if (a % 8 == 4) { gird[4] = stock[a]; }
if (a % 8 == 5) { gird[5] = stock[a]; }
if (a % 8 == 6) { gird[6] = stock[a]; }
if (a % 8 == 7) {
if (a % 8 == 7)
{
if (stock[a].Length < 3) { gird[7] = stock[a]; }
else { gird[7] = stock[a].Substring(0, 10); }
if (chk_stock(gird[0]) == true) {
if (chk_stock(gird[0]) == true)
{
dataGridView1.Rows.Add(gird);
}
}
@@ -181,7 +187,7 @@ namespace WindowsFormsApp1.Delivery
string[] edit_where = { "book_name", "isbn", "book_comp", "author", "pay",
"order", "count" };
string U_cmd = db.More_Update(table_name, edit_where, edit_data, ser_where, ser_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView1.Rows[rowidx].Cells["book_name"].Value = tb_book_name.Text;
dataGridView1.Rows[rowidx].Cells["isbn"].Value = tb_isbn.Text;
@@ -206,12 +212,12 @@ namespace WindowsFormsApp1.Delivery
private void input_TextBox(string[] Text)
{
tb_book_name.Text = Text[0];
tb_isbn.Text = Text[1];
tb_isbn.Text = Text[1];
tb_book_comp.Text = Text[2];
tb_author.Text = Text[3];
tb_pay.Text = Text[4];
tb_order.Text = Text[5];
tb_count.Text = Text[6];
tb_author.Text = Text[3];
tb_pay.Text = Text[4];
tb_order.Text = Text[5];
tb_count.Text = Text[6];
}
private void btn_Close_Click(object sender, EventArgs e)
{

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class List_Chk_Work
{

View File

@@ -11,7 +11,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class List_Chk_Work : Form
{
@@ -105,7 +105,7 @@ namespace WindowsFormsApp1.Delivery
dataGridView1.Rows[a].Cells["book_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, search_col, search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
/// <summary>

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class List_Lookup
{

View File

@@ -9,8 +9,9 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Printing;
using System.IO;
using AR;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class List_Lookup : Form
{
@@ -35,7 +36,7 @@ namespace WindowsFormsApp1.Delivery
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
compidx = PUB.user.CompanyIdx;
}
private void List_Lookup_Load(object sender, EventArgs e)
{
@@ -91,7 +92,7 @@ namespace WindowsFormsApp1.Delivery
private void btn_print_Click(object sender, EventArgs e) // 인쇄 기능
{
if (dataGridView1.Rows.Count < 1) {
MessageBox.Show("인쇄할 목록이 없습니다!");
UTIL.MsgE("인쇄할 목록이 없습니다!");
return;
}
// 여백 설정

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class List_aggregation
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -9,9 +10,8 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Mac;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class List_aggregation : Form
{
@@ -24,7 +24,7 @@ namespace WindowsFormsApp1.Delivery
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
compidx = PUB.user.CompanyIdx;
}
/////// TODO:
// 새로운 폼 작업 필요.
@@ -62,7 +62,7 @@ namespace WindowsFormsApp1.Delivery
#endregion
combo_user.Items.Add("전체");
string cmd = db.self_Made_Cmd("SELECT `name` FROM `User_Data` WHERE `affil` = '" + main.toolStripLabel2.Text + "';");
string cmd = db.self_Made_Cmd("SELECT `name` FROM `User_Data` WHERE `affil` = '" + main.lbCompanyName.Text + "';");
string[] user_name = cmd.Split('|');
for(int a = 0; a < user_name.Length; a++)
{
@@ -245,9 +245,9 @@ namespace WindowsFormsApp1.Delivery
dataGridView1.Rows[a].Cells["idx"].Value.ToString()
};
string U_cmd = db.More_Update(table, Edit_col, Edit_Data, Search_col, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
MessageBox.Show("저장되었습니다.");
UTIL.MsgI("저장되었습니다.");
}
private void btn_process_Click(object sender, EventArgs e) // 완료처리
{
@@ -273,12 +273,12 @@ namespace WindowsFormsApp1.Delivery
Sales(db_res, value);
string U_cmd = db.More_Update("Obj_List_Marc", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
Search_col[0] = "comp_num";
U_cmd = db.More_Update("Obj_List", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show("정상적으로 완료처리 되었습니다.");
UTIL.MsgI("정상적으로 완료처리 되었습니다.");
}
/// <summary>
/// 목록도서DB 내용을 들고와서 SalesDB에 출고율을 추가하여 집어넣는다.
@@ -324,7 +324,7 @@ namespace WindowsFormsApp1.Delivery
book[5], out_per, total[0], total[1], total[2], book[6], etc };
string Incmd = db.DB_INSERT("Sales", col_name, insert_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
private string[] Cal_out_price(string price_st, string count_st, string out_per_st, string in_per_st)
{

View File

@@ -1,5 +1,5 @@
namespace WindowsFormsApp1.
namespace UniMarc
{
partial class Order_Send_Chk
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -10,9 +11,8 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Delivery;
namespace WindowsFormsApp1.
namespace UniMarc
{
public partial class Order_Send_Chk : Form
{
@@ -64,7 +64,7 @@ namespace WindowsFormsApp1.납품관리
Area, "날짜", start, end, gu, compidx );
//string cmd = db.Search_Date("Send_Order", Area, "날짜", set_date[0], set_date[1], compidx);
string Fax_Key_ary = db.DB_Send_CMD_Search(cmd);
MessageBox.Show(Fax_Key_ary);
UTIL.MsgI(Fax_Key_ary);
string[] Fax_Key = Fax_Key_ary.Split('|');
input_Grid(Fax_Key);
#endregion
@@ -213,10 +213,10 @@ namespace WindowsFormsApp1.납품관리
private static void DownloadFileCallBack(object sender, AsyncCompletedEventArgs e)
{
if (e.Cancelled)
MessageBox.Show("File Download Cancelled");
UTIL.MsgE("File Download Cancelled");
if (e.Error != null)
MessageBox.Show(e.Error.ToString());
UTIL.MsgE(e.Error.ToString());
}
#endregion
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Order_input
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -10,9 +11,8 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Order_input : Form
{
@@ -31,7 +31,7 @@ namespace WindowsFormsApp1.Delivery
private void Order_input_Load(object sender, EventArgs e)
{
db.DBcon();
compidx = main.com_idx;
compidx = PUB.user.CompanyIdx;
dataGridView1.Columns["book_name"].DefaultCellStyle.Font = new Font("굴림", 8, FontStyle.Regular);
dataGridView1.Columns["author"].DefaultCellStyle.Font = new Font("굴림", 8, FontStyle.Regular);
@@ -47,7 +47,7 @@ namespace WindowsFormsApp1.Delivery
// 사용자 구분
cb_user.Items.Add("전체");
string compName = main.toolStripLabel2.Text;
string compName = main.lbCompanyName.Text;
string cmd = db.self_Made_Cmd("SELECT `name` FROM `User_Data` WHERE `affil` = '" + compName + "';");
string[] user_name = cmd.Split('|');
for (int a = 0; a < user_name.Length; a++)
@@ -280,9 +280,9 @@ namespace WindowsFormsApp1.Delivery
if (edit_data[1] == "") { edit_data[1] = "0"; }
else if (edit_data[1] == "V") { edit_data[1] = "1"; }
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, sear_col, sear_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
MessageBox.Show("저장되었습니다!");
UTIL.MsgI("저장되었습니다!");
}
private void btn_close_Click(object sender, EventArgs e)
{
@@ -407,7 +407,7 @@ namespace WindowsFormsApp1.Delivery
total[1] += Convert.ToInt32(dataGridView1.Rows[a].Cells["pay"].Value.ToString());
}
}
if (chkIdx.Count < 1) { MessageBox.Show("선택된 도서가 없습니다!"); return "false"; }
if (chkIdx.Count < 1) { UTIL.MsgE("선택된 도서가 없습니다!"); return "false"; }
string[,] inputExcel = new string[chkIdx.Count, 7];
string pur = dataGridView1.Rows[chkIdx[0]].Cells["order"].Value.ToString();
@@ -434,7 +434,7 @@ namespace WindowsFormsApp1.Delivery
}
Excel_text ex = new Excel_text();
string filename = ex.mk_Excel_Order(inputExcel, total, compidx, pur, tb_PS.Text);
MessageBox.Show("엑셀 반출 완료");
UTIL.MsgI("엑셀 반출 완료");
return filename;
}
@@ -454,7 +454,7 @@ namespace WindowsFormsApp1.Delivery
{
if (dataGridView1.Rows[a].Cells["order"].Value.ToString() != over_lab)
{
MessageBox.Show("주문처가 동일하지 않습니다!", "Error");
UTIL.MsgE("주문처가 동일하지 않습니다!");
return "false";
}
}
@@ -593,7 +593,7 @@ namespace WindowsFormsApp1.Delivery
if (pur_data[1] == "")
{
MessageBox.Show("주문처의 팩스 번호가 비어있습니다!", "Error");
UTIL.MsgE("주문처의 팩스 번호가 비어있습니다!");
return false;
}
@@ -639,12 +639,12 @@ namespace WindowsFormsApp1.Delivery
string Fax_Key = fax.Send_BaroFax(filename, fax_param);
string U_cmd = db.DB_Update("Comp", "fax_Key", Fax_Key, "idx", compidx);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
string[] col_Name = { "compidx", "구분", "팩스전송키", "날짜", "시간", "전송파일명" };
string[] set_Data = { compidx, "팩스", Fax_Key, Date, Time, filename };
string Incmd = db.DB_INSERT("Send_Order", col_Name, set_Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
return true;
}
@@ -676,7 +676,7 @@ namespace WindowsFormsApp1.Delivery
if (st.isContainHangul(m_send))
{
MessageBox.Show("DB내 저장된 이메일이 사양과 다릅니다. 직접 입력해주세요.");
UTIL.MsgE("DB내 저장된 이메일이 사양과 다릅니다. 직접 입력해주세요.");
Skill_Search_Text sst = new Skill_Search_Text();
string value = "";
@@ -702,7 +702,7 @@ namespace WindowsFormsApp1.Delivery
string[] col_Name = { "compidx", "구분", "거래처명", "날짜", "시간", "보낸이", "받는이", "전송파일명", "전송결과" };
string[] set_Data = { compidx, "메일", pur, Date, Time, arr_db[0], m_send, filename, "성공" };
string Incmd = db.DB_INSERT("Send_Order", col_Name, set_Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
lbl_OrderStat.Text = "메일 전송 성공!";
return true;
}

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Order_input_Search
{

View File

@@ -7,10 +7,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Account;
using WindowsFormsApp1.Mac;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Order_input_Search : Form
{

View File

@@ -0,0 +1,123 @@
namespace UniMarc
{
partial class Order_input_Search2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.idx = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.list_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.charge = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.date = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.date_res = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idx,
this.list_name,
this.charge,
this.date,
this.date_res});
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidth = 21;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(641, 215);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
//
// idx
//
this.idx.HeaderText = "idx";
this.idx.Name = "idx";
this.idx.Visible = false;
//
// list_name
//
this.list_name.HeaderText = "목록";
this.list_name.Name = "list_name";
this.list_name.Width = 300;
//
// charge
//
this.charge.HeaderText = "담당자";
this.charge.Name = "charge";
//
// date
//
this.date.HeaderText = "목록일자";
this.date.Name = "date";
//
// date_res
//
this.date_res.HeaderText = "완료일자";
this.date_res.Name = "date_res";
//
// Order_input_Search
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(641, 215);
this.Controls.Add(this.dataGridView1);
this.Name = "Order_input_Search";
this.Text = "Order_input_Search";
this.Load += new System.EventHandler(this.Order_input_Search_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn idx;
private System.Windows.Forms.DataGridViewTextBoxColumn list_name;
private System.Windows.Forms.DataGridViewTextBoxColumn charge;
private System.Windows.Forms.DataGridViewTextBoxColumn date;
private System.Windows.Forms.DataGridViewTextBoxColumn date_res;
}
}

View File

@@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc
{
public partial class Order_input_Search2 : Form
{
Order_input oin;
Purchase_Book pb;
Remit_reg2 rem2;
Check_ISBN2 isbn;
Helper_DB db = new Helper_DB();
public int[] oin_grid_idx = { 0, 0 };
public string Where_Open;
public string searchText;
public bool OnlyMarc = false;
string compidx;
public Order_input_Search2(Order_input o_in)
{
InitializeComponent();
oin = o_in;
compidx = oin.compidx;
}
public Order_input_Search2(Remit_reg2 _rem2)
{
InitializeComponent();
rem2 = _rem2;
compidx = rem2.compidx;
searchText = rem2.tb_purchase.Text;
}
public Order_input_Search2(Purchase_Book _pb)
{
InitializeComponent();
pb = _pb;
compidx = pb.compidx;
searchText = pb.tb_purchase.Text;
}
public Order_input_Search2(Check_ISBN2 _isbn)
{
InitializeComponent();
isbn = _isbn;
compidx = isbn.compidx;
searchText = isbn.tb_list_name.Text;
}
public Order_input_Search2()
{
InitializeComponent();
}
private void Order_input_Search_Load(object sender, EventArgs e)
{
string cmd, db_res;
db.DBcon();
if (Where_Open == "book_list")
{
string table = "Obj_List";
string Area = "`idx`, `list_name`, `charge`, `date`, `date_res`";
cmd = string.Format("SELECT {0} FROM {1} WHERE `comp_num` = {2} AND `state` = \"진행\"", Area, table, compidx);
if (searchText != "")
{
cmd += " AND `list_name` like \"%" + searchText + "%\"";
// cmd = db.DB_Contains("Obj_List", compidx,
// "", "", "`list_name`, `charge`, `date`, `date_res`");
}
if (OnlyMarc)
{
cmd += " AND `chk_marc` > 0";
// cmd = db.DB_Contains("Obj_List", compidx,
// "list_name", searchText, "`list_name`, `charge`, `date`, `date_res`");
}
cmd += ";";
db_res = db.DB_Send_CMD_Search(cmd);
made_grid(db_res);
this.Text = "목록 검색";
}
else if (Where_Open.Contains("Order"))
{
list_name.HeaderText = "주문처";
charge.HeaderText = "대표자";
date.HeaderText = "종목";
date_res.HeaderText = "업태";
cmd = db.DB_Contains("Purchase", compidx,
"sangho", searchText, "`idx`, `sangho`, `boss`, `jongmok`, `uptae`");
db_res = db.DB_Send_CMD_Search(cmd);
made_grid(db_res);
this.Text = "주문처 검색";
}
}
private void made_grid(string strValue)
{
string[] data = strValue.Split('|');
dataGridView1.Rows.Clear();
string[] res = { "", "", "", "", "" };
for (int a = 0; a < data.Length; a++)
{
if (a % 5 == 0) { res[0] = data[a]; }
if (a % 5 == 1) { res[1] = data[a]; }
if (a % 5 == 2) { res[2] = data[a]; }
if (a % 5 == 3) { res[3] = data[a]; }
if (a % 5 == 4) { res[4] = data[a];
if (res[1].Contains(searchText))
dataGridView1.Rows.Add(res);
}
}
}
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter) {
if (dataGridView1.Rows.Count == 0)
return;
dataGridView1_CellDoubleClick(null, null);
}
if (e.KeyCode == Keys.Escape) { Close(); }
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
int row = 0;
if (Where_Open == "") { row = 0; }
else row = dataGridView1.CurrentCell.RowIndex;
if (e != null) { row = e.RowIndex; }
else row = dataGridView1.CurrentCell.RowIndex;
if (oin != null) {
oin_result(row);
}
else if (pb != null) {
pb_result(row);
}
else if (rem2 != null) {
rem2.tb_purchase.Text = dataGridView1.Rows[row].Cells["list_name"].Value.ToString();
rem2.mk_base(rem2.tb_purchase.Text);
}
else if (isbn != null) {
string listName = dataGridView1.Rows[row].Cells["list_name"].Value.ToString();
string l_idx = dataGridView1.Rows[row].Cells["idx"].Value.ToString();
isbn.tb_list_name.Text = listName;
isbn.DataLoad(listName, l_idx);
}
Close();
}
private void oin_result(int grididx)
{
if (Where_Open == "book_list")
{
string ListName = dataGridView1.Rows[grididx].Cells["list_name"].Value.ToString();
string DBdate = dataGridView1.Rows[grididx].Cells["date"].Value.ToString();
string[] tmp_col = { "compidx", "list_name", "date" };
string[] tmp_data = { compidx, ListName, DBdate };
string takedata = "`order`, `order_stat`, `isbn`, `book_name`, `author`, " +
"`book_comp`, `order_count`, `count`, `pay`, `total`, " +
"`etc`, `list_name`, `order_date`, `send_date`, `header`, " +
"`num`, `idx`";
string cmd = db.More_DB_Search("Obj_List_Book", tmp_col, tmp_data, takedata);
string db_res = db.DB_Send_CMD_Search(cmd);
oin.made_grid(db_res, false);
oin.tb_search_book_list.Text = ListName;
DateTime setDate = DateTime.ParseExact(DBdate, "yyyy-MM-dd", null);
oin.dtp_listBegin.Checked = true;
oin.dtp_listEnd.Checked = true;
oin.dtp_listBegin.Value = setDate;
oin.dtp_listEnd.Value = setDate;
}
else if (Where_Open.Contains("Order"))
{
if (Where_Open == "Order_Grid") {
oin.dataGridView1.Rows[oin_grid_idx[0]].Cells[oin_grid_idx[1]].Value =
dataGridView1.Rows[grididx].Cells["list_name"].Value.ToString();
}
else
{
try
{
oin.tb_orderText.Text = dataGridView1.Rows[grididx].Cells["list_name"].Value.ToString();
}
catch { }
}
}
}
private void pb_result(int grididx)
{
pb.tb_purchase.Text = dataGridView1.Rows[grididx].Cells["list_name"].Value.ToString();
pb.btn_Lookup_Click(null, null);
}
}
}

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="idx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="list_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="charge.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="date_res.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
partial class Purchase
{

View File

@@ -9,9 +9,9 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Windows.Forms.VisualStyles;
using WindowsFormsApp1.Home;
using AR;
namespace WindowsFormsApp1.Delivery
namespace UniMarc
{
public partial class Purchase : Form
{
@@ -25,7 +25,7 @@ namespace WindowsFormsApp1.Delivery
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
compidx = PUB.user.CompanyIdx;
}
private void Purchase_Load(object sender, EventArgs e)
{
@@ -220,7 +220,7 @@ namespace WindowsFormsApp1.Delivery
}
if (name == "dataGridView1" && col == 11) {
if(tb_persent.Text == "") {
MessageBox.Show("매입율을 작성해주세요.");
UTIL.MsgE("매입율을 작성해주세요.");
tb_persent.Focus();
}
else {
@@ -317,7 +317,7 @@ namespace WindowsFormsApp1.Delivery
}
}
}
else { MessageBox.Show("임시 저장된 데이터가 없습니다.", "에러", MessageBoxButtons.OK, MessageBoxIcon.Error); }
else { UTIL.MsgE("임시 저장된 데이터가 없습니다."); }
}
private void btn_lookup_Click(object sender, EventArgs e)
{
@@ -430,7 +430,7 @@ namespace WindowsFormsApp1.Delivery
if (chk_stock.Checked == true) {
if (stock_chk(isbn_chk) == true) {
int inven_count = stock_count_chk(isbn_chk);
MessageBox.Show(inven_count.ToString());
UTIL.MsgI(inven_count.ToString());
if (lbl_inven_count.Text == "0") {
lbl_inven_count.Text = "0";
inven_count = 0;
@@ -652,7 +652,7 @@ namespace WindowsFormsApp1.Delivery
string[] edit_Data = { "입고", dataGridView2.Rows[a].Cells["Date"].Value.ToString(),
dataGridView2.Rows[a].Cells["isbn2"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_Col, edit_Data, search_Col, search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
/* 입고작업을 하려는 책이 재고에 있을 경우, 재고 -1이 되어야함.
* 만약 재고수보다 입고수가 더 많을경우는?
@@ -695,7 +695,7 @@ namespace WindowsFormsApp1.Delivery
string[] Edit_col = { "input_count" };
string[] Edit_data = { Inven_count(db_data[0], dataGridView2.Rows[a].Cells["count2"].Value.ToString(), a) };
string U_cmd = db.More_Update("Obj_List_Book", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
/// <summary>
@@ -737,7 +737,7 @@ namespace WindowsFormsApp1.Delivery
dataGridView2.Rows[row].Cells["list_name2"].Value.ToString()
};
string U_cmd = db.More_Update("Obj_List_Book", Edit_Col, Edit_Data, Search_Name, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[row].Cells["edasd"].Value = res.ToString();
}
@@ -792,8 +792,8 @@ namespace WindowsFormsApp1.Delivery
if (db_res.Length < 3)
{
string Incmd = db.DB_INSERT("Inven", input_col, input_data);
db.DB_Send_CMD_reVoid(Incmd);
MessageBox.Show("DB 새로 추가");
Helper_DB.ExcuteNonQuery(Incmd);
UTIL.MsgI("DB 새로 추가");
return;
}
else
@@ -803,9 +803,9 @@ namespace WindowsFormsApp1.Delivery
string[] cout = db_res.Split('|');
int count = Convert.ToInt32(cout[0]);
count += data;
MessageBox.Show("DB 수정");
UTIL.MsgI("DB 수정");
string U_cmd = db.DB_Update("Inven", "count", count.ToString(), "idx", cout[0]);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
@@ -834,7 +834,7 @@ namespace WindowsFormsApp1.Delivery
tata[9] = "재고가감";
}
string Incmd = db.DB_INSERT("Buy_ledger", Area, tata);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
}
/// <summary>
@@ -924,9 +924,9 @@ namespace WindowsFormsApp1.Delivery
{
string[] param = { "title", "publisher", "author", "priceStandard" };
API api = new API();
string aladin = api.Aladin(isbn, "ISBN13", param);
string[] insert = aladin.Split('|');
var aladinResult = api.Aladin(isbn, "ISBN13", param);
string[] insert = aladinResult.ToArray();// aladin.Split('|');
if (insert.Length < 2) { return; };
datagrid.Rows[row].Cells["book_name3"].Value = insert[0];
@@ -943,7 +943,7 @@ namespace WindowsFormsApp1.Delivery
}
private void Purchase_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("이대로 닫으시겠습니까?", "경고", MessageBoxButtons.YesNo) == DialogResult.No)
if (UTIL.MsgQ("이대로 닫으시겠습니까?") != DialogResult.Yes)
{
// 로컬파일 생성. (C:\)
create_TempTxt();

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Home
namespace UniMarc
{
partial class Batch_processing
{

View File

@@ -9,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1.Home
namespace UniMarc
{
public partial class Batch_processing : Form
{

View File

@@ -1,5 +1,4 @@
using AR;
using ExcelTest;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -10,7 +9,6 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1;
namespace UniMarc
{
@@ -31,7 +29,7 @@ namespace UniMarc
{
if (tCheckText == "")
{
MessageBox.Show("전화번호, 상호, 이메일, IP, 고유번호는 필수 입력 사항입니다.");
UTIL.MsgE("전화번호, 상호, 이메일, IP, 고유번호는 필수 입력 사항입니다.");
return;
}
}
@@ -45,7 +43,7 @@ namespace UniMarc
string tResult = mDb.DB_Send_CMD_Search(tCmd);
if (tResult != "")
{
MessageBox.Show("상호명이 중복되었습니다.\n다시 확인해주세요.");
UTIL.MsgE("상호명이 중복되었습니다.\n다시 확인해주세요.");
return;
}
@@ -54,7 +52,7 @@ namespace UniMarc
if (tResult != "")
{
MessageBox.Show("고유번호가 중복되었습니다.\n다시 확인해주세요.");
UTIL.MsgE("고유번호가 중복되었습니다.\n다시 확인해주세요.");
return;
}
@@ -72,13 +70,13 @@ namespace UniMarc
,nudCompIDX.Value.ToString(),tbIP.Text
}; // 15
tCmd = mDb.DB_INSERT("Comp", tInsertCol, tInsertData);
mDb.DB_Send_CMD_reVoid(tCmd);
Helper_DB.ExcuteNonQuery(tCmd);
//// IP 적용
//string[] IP_Col = { "compidx", "comp", "IP" };
//string[] IP_Data = { mDb.chk_comp(tb_sangho.Text), tb_sangho.Text, tbIP.Text };//cb_IPList.Text
//tCmd = mDb.DB_INSERT("Comp_IP", IP_Col, IP_Data);
//mDb.DB_Send_CMD_reVoid(tCmd);
//Helper_DB.ExcuteNonQuery(tCmd);
RefreshList();
@@ -88,7 +86,7 @@ namespace UniMarc
{
if (dgvList.CurrentCell == null || dgvList.CurrentCell.RowIndex < 0 || dgvList.SelectedRows.Count == 0)
{
MessageBox.Show("수정할 행을 선택해 주세요.");
UTIL.MsgE("수정할 행을 선택해 주세요.");
return;
}
string tText = string.Format("{0} 를 수정 하시겠습니까?", dgvList.SelectedRows[0].Cells["comp_name"].Value.ToString());
@@ -108,7 +106,7 @@ namespace UniMarc
string[] tSearch_col = { dgvList.SelectedRows[0].Cells["dbIDX"].Value.ToString() };
string U_cmd = mDb.More_Update("Comp", tEdit_tbl, tEdit_col, tSearch_tbl, tSearch_col);
mDb.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
RefreshList();
}
@@ -118,14 +116,14 @@ namespace UniMarc
if (dgvList.CurrentCell == null || dgvList.CurrentCell.RowIndex < 0 || dgvList.SelectedRows.Count == 0)
{
MessageBox.Show("삭제할 행을 선택해 주세요.");
UTIL.MsgE("삭제할 행을 선택해 주세요.");
return;
}
string tText = string.Format("{0} 를 삭제 하시겠습니까?", dgvList.SelectedRows[0].Cells["comp_name"].Value.ToString());
if (UTIL.MsgQ(tText) == DialogResult.Yes)
{
string tD_cmd = mDb.DB_Delete("Comp", "idx", dgvList.SelectedRows[0].Cells["dbIDX"].Value.ToString(), "comp_name", dgvList.SelectedRows[0].Cells["comp_name"].Value.ToString());
mDb.DB_Send_CMD_reVoid(tD_cmd);
Helper_DB.ExcuteNonQuery(tD_cmd);
TextClear();
}
RefreshList();

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class Mac_Setting
{

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class Mac_Setting : Form
{

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class Notice_Send
{

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class Notice_Send : Form
{

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class Sales_Details
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -8,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class Sales_Details : Form
{
@@ -32,10 +33,10 @@ namespace WindowsFormsApp1
{
data = Doc.GetElementsByTagName("b")[a].InnerText;
richTextBox1.Text += data + "\n";
MessageBox.Show(data);
UTIL.MsgI(data);
}
}
MessageBox.Show(Doc.GetElementsByTagName("a").Count.ToString());
UTIL.MsgI(Doc.GetElementsByTagName("a").Count.ToString());
// < a href = "https://www.aladin.co.kr/shop/wproduct.aspx?
// ItemId=248012843" class="bo3">
// <b>무한도전 낱말퍼즐 : 과학</b>

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class User_account_inquiry
{

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class User_account_inquiry : Form
{

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1
namespace UniMarc
{
partial class User_manage
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -8,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
namespace UniMarc
{
public partial class User_manage : Form
{
@@ -28,7 +29,7 @@ namespace WindowsFormsApp1
button1.ForeColor = Color.Red;
IP ip = new IP();
string[] IPList = { "ALL", ip.GetIP };
string[] IPList = { "ALL", ip.GetIP() };
cb_IPList.Items.AddRange(IPList);
cb_IPList.SelectedIndex = 0;
}
@@ -39,12 +40,12 @@ namespace WindowsFormsApp1
if (ID == "")
{
MessageBox.Show("ID칸이 비어있습니다!");
UTIL.MsgE("ID칸이 비어있습니다!");
return;
}
if (!System.Text.RegularExpressions.Regex.IsMatch(ID, @"^[a-zA-Z0-9]"))
{
MessageBox.Show("영어와 숫자 조합으로 작성해주세요!");
UTIL.MsgE("영어와 숫자 조합으로 작성해주세요!");
isIDcheck = false;
return;
}
@@ -52,12 +53,12 @@ namespace WindowsFormsApp1
string cmd = string.Format("SELECT * FROM `User_Data` WHERE `ID` = \"{0}\";", ID);
string res = db.DB_Send_CMD_Search(cmd);
if (res == "") {
MessageBox.Show("사용가능한 이이디입니다. [" + ID + "]");
UTIL.MsgI("사용가능한 이이디입니다. [" + ID + "]");
isIDcheck = true;
button1.ForeColor = Color.Blue;
}
else {
MessageBox.Show("중복된 아이디입니다. [" + ID + "]");
UTIL.MsgE("중복된 아이디입니다. [" + ID + "]");
isIDcheck = false;
}
}
@@ -77,7 +78,7 @@ namespace WindowsFormsApp1
foreach (string CheckText in NeedText)
{
if (CheckText == "") {
MessageBox.Show("노란 박스는 꼭 채워주세요!");
UTIL.MsgE("노란 박스는 꼭 채워주세요!");
return;
}
}
@@ -85,12 +86,12 @@ namespace WindowsFormsApp1
string cmd_sanghoCheck = string.Format("SELECT * FROM `Comp` WHERE `comp_name` = \"{0}\"", tb_sangho.Text);
string res = db.DB_Send_CMD_Search(cmd_sanghoCheck);
if (res != "") {
MessageBox.Show("상호명이 중복되었습니다.\n다시 확인해주세요.");
UTIL.MsgE("상호명이 중복되었습니다.\n다시 확인해주세요.");
return;
}
if (!isIDcheck)
{
MessageBox.Show("아이디 중복확인 먼저 진행해주세요.");
UTIL.MsgE("아이디 중복확인 먼저 진행해주세요.");
return;
}
@@ -106,13 +107,13 @@ namespace WindowsFormsApp1
tb_bank_comp.Text, tb_bank_no.Text, tb_email.Text, tb_barea.Text, "외부업체"
}; // 15
db.DB_Send_CMD_reVoid(db.DB_INSERT("Comp", InsertCol, InsertData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("Comp", InsertCol, InsertData));
// IP 적용
string[] IP_Col = { "compidx","comp", "IP" };
string[] IP_Data = { db.chk_comp(tb_sangho.Text), tb_sangho.Text,tbIP.Text };//cb_IPList.Text
db.DB_Send_CMD_reVoid(db.DB_INSERT("Comp_IP", IP_Col, IP_Data));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("Comp_IP", IP_Col, IP_Data));
InsertAccount(tb_sangho.Text);
}
@@ -129,11 +130,11 @@ namespace WindowsFormsApp1
string[] InsertUserSubData = { ID };
string[] InsertUserSubCol = { "id" };
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_Data", InsertCol, InsertData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_Data", InsertCol, InsertData));
// User_ShortCut, User_Access 추가.
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_ShortCut", InsertUserSubCol, InsertUserSubData));
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_Access", InsertUserSubCol, InsertUserSubData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_ShortCut", InsertUserSubCol, InsertUserSubData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_Access", InsertUserSubCol, InsertUserSubData));
}
private void btn_close_Click(object sender, EventArgs e)

View File

@@ -1,5 +1,5 @@
namespace UniMarc.
namespace UniMarc
{
partial class AddMarc
{

View File

@@ -1,4 +1,4 @@
using ExcelTest;
using AR;
using SHDocVw;
using System;
using System.Collections.Generic;
@@ -10,31 +10,31 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1;
namespace UniMarc.
namespace UniMarc
{
public partial class AddMarc : Form
{
Helper_DB db = new Helper_DB();
String_Text st = new String_Text();
Help008Tag tag008 = new Help008Tag();
public string mUserName;
public string mCompidx;
private string mOldMarc = string.Empty;
Main m;
public AddMarc(Main _m)
{
InitializeComponent();
m = _m;
mUserName = m.User;
mCompidx = m.com_idx;
}
public AddMarc()
{
InitializeComponent();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Alt || keyData == (Keys.Alt | Keys.Menu))
{
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void AddMarc_Load(object sender, EventArgs e)
{
cb_SearchCol.SelectedIndex = 0;
@@ -102,10 +102,13 @@ namespace UniMarc.마크
private void Btn_Memo_Click(object sender, EventArgs e)
{
Marc_memo memo = new Marc_memo(this);
Marc_memo memo = new Marc_memo();
memo.StartPosition = FormStartPosition.Manual;
memo.TopMost = true;
memo.Location = new Point(1018, 8);
memo.OnSave += (s1, e1) => {
this.richTextBox1.Text = e1.Data;
};
memo.Show();
}
@@ -218,12 +221,12 @@ namespace UniMarc.마크
if (TagIndex == 1)
{
MessageBox.Show("[칸채우기]가 아닌 [마크 작성] 탭에서 저장해주세요!");
UTIL.MsgE("[칸채우기]가 아닌 [마크 작성] 탭에서 저장해주세요!");
return;
}
if (grade == 3 || grade == -1)
{
MessageBox.Show("등급을 설정해주세요. (C 이상)");
UTIL.MsgE("등급을 설정해주세요. (C 이상)");
return;
}
@@ -236,7 +239,7 @@ namespace UniMarc.마크
if (!isPass(MarcText))
{
MessageBox.Show("입력된 마크의 상태를 확인해주세요.", "isPass");
UTIL.MsgE("입력된 마크의 상태를 확인해주세요.");
return;
}
@@ -275,7 +278,7 @@ namespace UniMarc.마크
else
InsertMarc(Table, BookData, orimarc, grade, tag056, date);
MessageBox.Show("저장되었습니다.", "저장");
UTIL.MsgI("저장되었습니다.");
}
#region SaveSub
@@ -300,12 +303,12 @@ namespace UniMarc.마크
};
string[] EditColumn =
{
mCompidx, oriMarc, "1",mOldMarc, "0", etc1.Text,
etc2.Text, tag056, text008.Text, date, mUserName,
PUB.user.CompanyIdx, oriMarc, "1",mOldMarc, "0", etc1.Text,
etc2.Text, tag056, text008.Text, date, PUB.user.UserName,
grade.ToString()
};
string[] SearchTable = { "idx","compidx" };
string[] SearchColumn = { MarcIndex, mCompidx };
string[] SearchColumn = { MarcIndex, PUB.user.CompanyIdx };
//int marcChk = subMarcChk(Table, MarcIndex);
//if (IsCovertDate)
@@ -335,31 +338,10 @@ namespace UniMarc.마크
// break;
//}
string UpCMD = db.More_Update(Table, EditTable, EditColumn, SearchTable, SearchColumn);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(UpCMD);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
Helper_DB.ExcuteNonQuery(UpCMD);
}
#region UpdateSub
/// <summary>
/// 어느곳이 최근 저장인지 확인
/// </summary>
/// <param name="table">테이블명</param>
/// <param name="midx">idx</param>
/// <returns>marcChk 번호</returns>
private int subMarcChk(string table, string midx)
{
string Area = "`marc_chk`, `marc_chk1`, `marc_chk2`";
string cmd = db.DB_Select_Search(Area, table, "idx", midx);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] chk_ary = db_res.Split('|');
for (int a = 0; a < chk_ary.Length; a++)
{
if (chk_ary[a] == "1")
return a;
}
return 0;
}
#endregion
/// <summary>
/// 마크DB에 INSERT해주는 함수
@@ -382,12 +364,12 @@ namespace UniMarc.마크
{
BookData[0], BookData[1], BookData[2], BookData[3], BookData[4],
oriMarc, etc1.Text, etc2.Text, grade.ToString(), "1",
mUserName, tag056, text008.Text, date, mCompidx
PUB.user.UserName, tag056, text008.Text, date, PUB.user.CompanyIdx
};
string InCMD = db.DB_INSERT(Table, InsertTable, InsertColumn);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", mUserName, mCompidx, InCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(InCMD);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, InCMD.Replace("\r", " ").Replace("\n", " ")));
Helper_DB.ExcuteNonQuery(InCMD);
}
/// <summary>
@@ -400,7 +382,7 @@ namespace UniMarc.마크
{
if (TimeSpanDaysValue < -1)
return false;
if (user != mUserName)
if (user != PUB.user.UserName)
return false;
return true;
}
@@ -450,7 +432,7 @@ namespace UniMarc.마크
}
if (!isTag)
{
MessageBox.Show(msg + "태그가 없습니다.");
UTIL.MsgE(msg + "태그가 없습니다.");
return false;
}
@@ -464,7 +446,7 @@ namespace UniMarc.마크
}
if (!is1XX)
{
MessageBox.Show("기본표목이 존재하지않습니다.");
UTIL.MsgE("기본표목이 존재하지않습니다.");
return false;
}
@@ -482,7 +464,7 @@ namespace UniMarc.마크
if (!is7XX)
{
MessageBox.Show("부출표목이 존재하지않습니다.");
UTIL.MsgE("부출표목이 존재하지않습니다.");
return false;
}
@@ -591,13 +573,13 @@ namespace UniMarc.마크
}
else
{
MessageBox.Show(string.Format("SplitError : {0}", string.Join("\t", DataSplit)));
UTIL.MsgE(string.Format("SplitError : {0}", string.Join("\t", DataSplit)));
return false;
}
}
else
{
MessageBox.Show(string.Format("DataError : {0}", Data));
UTIL.MsgE(string.Format("DataError : {0}", Data));
return false;
}
}
@@ -795,7 +777,7 @@ namespace UniMarc.마크
if (pubDate.Length < 3)
{
MessageBox.Show("260c가 인식되지않습니다.");
UTIL.MsgE("260c가 인식되지않습니다.");
return "false";
}
else if (pubDate.Length < 5)
@@ -824,7 +806,7 @@ namespace UniMarc.마크
if (res == "")
{
MessageBox.Show("260a가 인식되지않습니다.");
UTIL.MsgE("260a가 인식되지않습니다.");
return "false";
}
else if (res.Length < 3)
@@ -2699,7 +2681,7 @@ namespace UniMarc.마크
}
catch(Exception ex)
{
MessageBox.Show("데이터가 올바르지않습니다.\n245d를 확인해주세요.\n" + ex.ToString());
UTIL.MsgE("데이터가 올바르지않습니다.\n245d를 확인해주세요.\n" + ex.ToString());
}
}
#region
@@ -2787,21 +2769,22 @@ namespace UniMarc.마크
{
TextBox tb = sender as TextBox;
if (e.Alt && e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z)
{
var letter = e.KeyCode.ToString().ToLower();
tb.InvokeInsertText("▽" + letter);
e.SuppressKeyPress = true;
return;
}
if (e.KeyCode == Keys.F3)
{
tb.InvokeInsertText("▽");
//tb.Select(tb.Text.Length, 0);
}
else if (e.KeyCode == Keys.F4)
{
tb.InvokeInsertText("△");
//tb.Select(tb.Text.Length, 0);
}
//tb.SelectionStart = tb.Text.Length;
//tb.Select(tb.Text.Length, 0);
}
private void etc_KeyDown(object sender, KeyEventArgs e)
{

View File

@@ -0,0 +1,361 @@
namespace UniMarc
{
partial class AddMarc2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btSaveNew = new System.Windows.Forms.Button();
this.Btn_SearchKolis = new System.Windows.Forms.Button();
this.cb_SearchCol = new System.Windows.Forms.ComboBox();
this.btn_Empty = new System.Windows.Forms.Button();
this.tb_Search = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button2 = new System.Windows.Forms.Button();
this.panel5 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.rtEtc1 = new System.Windows.Forms.RichTextBox();
this.rtEtc2 = new System.Windows.Forms.RichTextBox();
this.panel6 = new System.Windows.Forms.Panel();
this.btSave = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.lbl_Midx = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.lbl_SaveData = new System.Windows.Forms.TextBox();
this.marcEditorControl1 = new UniMarc.MarcEditorControl();
this.uC_SelectGrade1 = new UniMarc.UC_SelectGrade();
this.panel2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel5.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.panel6.SuspendLayout();
this.panel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// btSaveNew
//
this.btSaveNew.Location = new System.Drawing.Point(92, 8);
this.btSaveNew.Name = "btSaveNew";
this.btSaveNew.Size = new System.Drawing.Size(84, 33);
this.btSaveNew.TabIndex = 398;
this.btSaveNew.Text = "새로추가";
this.btSaveNew.UseVisualStyleBackColor = true;
this.btSaveNew.Click += new System.EventHandler(this.btn_Save_Click);
//
// Btn_SearchKolis
//
this.Btn_SearchKolis.Dock = System.Windows.Forms.DockStyle.Fill;
this.Btn_SearchKolis.Location = new System.Drawing.Point(132, 3);
this.Btn_SearchKolis.Name = "Btn_SearchKolis";
this.Btn_SearchKolis.Size = new System.Drawing.Size(123, 39);
this.Btn_SearchKolis.TabIndex = 397;
this.Btn_SearchKolis.Text = "코리스 검색";
this.Btn_SearchKolis.UseVisualStyleBackColor = true;
this.Btn_SearchKolis.Click += new System.EventHandler(this.Btn_SearchKolis_Click);
//
// cb_SearchCol
//
this.cb_SearchCol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_SearchCol.FormattingEnabled = true;
this.cb_SearchCol.Items.AddRange(new object[] {
"ISBN",
"서명",
"저자",
"출판사"});
this.cb_SearchCol.Location = new System.Drawing.Point(11, 20);
this.cb_SearchCol.Name = "cb_SearchCol";
this.cb_SearchCol.Size = new System.Drawing.Size(238, 20);
this.cb_SearchCol.TabIndex = 395;
//
// btn_Empty
//
this.btn_Empty.Dock = System.Windows.Forms.DockStyle.Fill;
this.btn_Empty.Location = new System.Drawing.Point(3, 3);
this.btn_Empty.Name = "btn_Empty";
this.btn_Empty.Size = new System.Drawing.Size(123, 39);
this.btn_Empty.TabIndex = 396;
this.btn_Empty.Text = "비 우 기";
this.btn_Empty.UseVisualStyleBackColor = true;
this.btn_Empty.Click += new System.EventHandler(this.btn_Empty_Click);
//
// tb_Search
//
this.tb_Search.Location = new System.Drawing.Point(11, 47);
this.tb_Search.Name = "tb_Search";
this.tb_Search.Size = new System.Drawing.Size(188, 21);
this.tb_Search.TabIndex = 0;
this.tb_Search.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_ISBN_KeyDown);
//
// panel2
//
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Left;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Padding = new System.Windows.Forms.Padding(8);
this.panel2.Size = new System.Drawing.Size(277, 939);
this.panel2.TabIndex = 394;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.cb_SearchCol);
this.groupBox1.Controls.Add(this.tb_Search);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(261, 79);
this.groupBox1.TabIndex = 408;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "마크 검색";
//
// button2
//
this.button2.Location = new System.Drawing.Point(205, 46);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(45, 22);
this.button2.TabIndex = 405;
this.button2.Text = "검색";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// panel5
//
this.panel5.Controls.Add(this.tableLayoutPanel1);
this.panel5.Controls.Add(this.panel6);
this.panel5.Dock = System.Windows.Forms.DockStyle.Right;
this.panel5.Location = new System.Drawing.Point(1306, 0);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(268, 939);
this.panel5.TabIndex = 395;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.rtEtc1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.rtEtc2, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 455);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(268, 484);
this.tableLayoutPanel1.TabIndex = 0;
//
// rtEtc1
//
this.rtEtc1.BackColor = System.Drawing.SystemColors.ScrollBar;
this.rtEtc1.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtEtc1.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.rtEtc1.Location = new System.Drawing.Point(3, 3);
this.rtEtc1.Name = "rtEtc1";
this.rtEtc1.Size = new System.Drawing.Size(262, 236);
this.rtEtc1.TabIndex = 32;
this.rtEtc1.Text = "Remark1";
this.rtEtc1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rtEtc1_KeyDown);
//
// rtEtc2
//
this.rtEtc2.BackColor = System.Drawing.SystemColors.ScrollBar;
this.rtEtc2.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtEtc2.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.rtEtc2.Location = new System.Drawing.Point(3, 245);
this.rtEtc2.Name = "rtEtc2";
this.rtEtc2.Size = new System.Drawing.Size(262, 236);
this.rtEtc2.TabIndex = 32;
this.rtEtc2.Text = "Remark2";
this.rtEtc2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rtEtc1_KeyDown);
//
// panel6
//
this.panel6.Controls.Add(this.uC_SelectGrade1);
this.panel6.Controls.Add(this.btSave);
this.panel6.Controls.Add(this.panel1);
this.panel6.Controls.Add(this.tableLayoutPanel2);
this.panel6.Controls.Add(this.button1);
this.panel6.Controls.Add(this.btSaveNew);
this.panel6.Controls.Add(this.lbl_SaveData);
this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
this.panel6.Location = new System.Drawing.Point(0, 0);
this.panel6.Name = "panel6";
this.panel6.Padding = new System.Windows.Forms.Padding(5);
this.panel6.Size = new System.Drawing.Size(268, 455);
this.panel6.TabIndex = 1;
//
// btSave
//
this.btSave.Location = new System.Drawing.Point(6, 8);
this.btSave.Name = "btSave";
this.btSave.Size = new System.Drawing.Size(84, 33);
this.btSave.TabIndex = 411;
this.btSave.Text = "수정";
this.btSave.UseVisualStyleBackColor = true;
this.btSave.Click += new System.EventHandler(this.btSave_Click);
//
// panel1
//
this.panel1.Controls.Add(this.lbl_Midx);
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(8, 50);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(250, 65);
this.panel1.TabIndex = 410;
//
// lbl_Midx
//
this.lbl_Midx.BackColor = System.Drawing.Color.Tomato;
this.lbl_Midx.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl_Midx.Font = new System.Drawing.Font("돋움체", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbl_Midx.Location = new System.Drawing.Point(0, 27);
this.lbl_Midx.Name = "lbl_Midx";
this.lbl_Midx.Size = new System.Drawing.Size(250, 38);
this.lbl_Midx.TabIndex = 409;
this.lbl_Midx.Text = "신규 데이터";
this.lbl_Midx.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(250, 27);
this.label1.TabIndex = 408;
this.label1.Text = "MARC INDEX";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Controls.Add(this.btn_Empty, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.Btn_SearchKolis, 1, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel2.Location = new System.Drawing.Point(5, 405);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(258, 45);
this.tableLayoutPanel2.TabIndex = 407;
//
// button1
//
this.button1.Location = new System.Drawing.Point(179, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(79, 33);
this.button1.TabIndex = 404;
this.button1.Text = "닫기";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// lbl_SaveData
//
this.lbl_SaveData.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbl_SaveData.ForeColor = System.Drawing.Color.Black;
this.lbl_SaveData.Location = new System.Drawing.Point(8, 154);
this.lbl_SaveData.Multiline = true;
this.lbl_SaveData.Name = "lbl_SaveData";
this.lbl_SaveData.Size = new System.Drawing.Size(255, 244);
this.lbl_SaveData.TabIndex = 319;
this.lbl_SaveData.Text = "[] []";
//
// marcEditorControl1
//
this.marcEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.marcEditorControl1.Font = new System.Drawing.Font("돋움", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.marcEditorControl1.Location = new System.Drawing.Point(277, 0);
this.marcEditorControl1.Name = "marcEditorControl1";
this.marcEditorControl1.Size = new System.Drawing.Size(1029, 939);
this.marcEditorControl1.TabIndex = 394;
//
// uC_SelectGrade1
//
this.uC_SelectGrade1.Grade = -1;
this.uC_SelectGrade1.GradeName = "";
this.uC_SelectGrade1.Location = new System.Drawing.Point(11, 121);
this.uC_SelectGrade1.Name = "uC_SelectGrade1";
this.uC_SelectGrade1.Size = new System.Drawing.Size(245, 29);
this.uC_SelectGrade1.TabIndex = 412;
//
// AddMarc2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Gray;
this.ClientSize = new System.Drawing.Size(1574, 939);
this.Controls.Add(this.marcEditorControl1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel5);
this.Name = "AddMarc2";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "마크 작성(2-New)";
this.Load += new System.EventHandler(this.AddMarc_Load);
this.panel2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel5.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
this.panel1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TextBox tb_Search;
private System.Windows.Forms.ComboBox cb_SearchCol;
private System.Windows.Forms.Button btn_Empty;
private System.Windows.Forms.Button Btn_SearchKolis;
private MarcEditorControl marcEditorControl1;
private System.Windows.Forms.Button btSaveNew;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
public System.Windows.Forms.RichTextBox rtEtc1;
public System.Windows.Forms.RichTextBox rtEtc2;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.TextBox lbl_SaveData;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lbl_Midx;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btSave;
private UC_SelectGrade uC_SelectGrade1;
}
}

View File

@@ -0,0 +1,426 @@
using AR;
using SHDocVw;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc
{
public partial class AddMarc2 : Form
{
Helper_DB db = new Helper_DB();
String_Text st = new String_Text();
Help008Tag tag008 = new Help008Tag();
private string mOldMarc = string.Empty;
Main m;
public AddMarc2(Main _m)
{
InitializeComponent();
db.DBcon();
marcEditorControl1.db = this.db;
m = _m;
}
private void AddMarc_Load(object sender, EventArgs e)
{
cb_SearchCol.SelectedIndex = 0;
TextReset();
this.KeyPreview = true;
uC_SelectGrade1.GradeName = "D";
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.F9)
{
btn_Save_Click(this, EventArgs.Empty);
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
public void SetKolisValueApply(string marc)
{
this.marcEditorControl1.SetMarcString(marc);
}
private void tb_ISBN_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode != Keys.Enter)
return;
searchMarc();
}
void searchMarc()
{
TextReset();
string SearchText = tb_Search.Text;
string SearchCol = cb_SearchCol.SelectedItem.ToString();
using (var mcs = new MarcCopySelect2(SearchCol, SearchText))
if (mcs.ShowDialog() == DialogResult.OK)
{
/// 0:idx <br></br>
/// 1:compidx <br></br>
/// 2:user <br></br>
/// 3:date <br></br>
/// 4:grade <br></br>
/// 5:tag008 <br></br>
/// 6:LineMarc</param>
var selected = mcs.SelectedItem;
var defMarc = PUB.MakeEmptyMarc(selected.ISBN, "BookName", "Author", "Publisher", "Price");
this.marcEditorControl1.LoadBookData(selected.marc_db, selected.ISBN, defMarc);
mOldMarc = selected.marc_db;
if (selected.compidx != PUB.user.CompanyIdx)
{
UTIL.MsgI($"다른 기관의 데이터 입니다\n신규 등록모드로 실행됩니다.\n\n필요한 경우 입력일자를 업데이트하세요");
this.lbl_Midx.Text = "신규등록";// ".idx;
this.lbl_Midx.Tag = null;
this.lbl_Midx.BackColor = Color.Tomato;
}
else
{
this.lbl_Midx.Text = selected.idx;
this.lbl_Midx.Tag = selected.idx;
this.lbl_Midx.BackColor = Color.Lime;
}
//가져온 등급으로 변경해준다.
//if (selected.Grade == "0") radA.Checked = true;
//else if (selected.Grade == "1") radB.Checked = true;
//else if (selected.Grade == "2") radC.Checked = true;
//else if (selected.Grade == "3") radD.Checked = true;
if (int.TryParse(selected.Grade, out int vgrade))
uC_SelectGrade1.Grade = vgrade;
else
uC_SelectGrade1.Grade = -1;
rtEtc1.Text = selected.remark1;
rtEtc2.Text = selected.remark2;
}
}
private void btn_Empty_Click(object sender, EventArgs e)
{
TextReset();
}
/// <summary>
/// 전체 초기화
/// </summary>
/// <param name="isDelete">탭 컨트롤에서 사용할 경우 false</param>
public void TextReset(bool isDelete = true)
{
if (isDelete)
{
var isbn = $"※{DateTime.Now.ToString("yyMMddhhmmss")}";
var emptryMarc = PUB.MakeEmptyMarc(isbn, "title", "author", "publisher", "price");
var emptymarc = TextResetSub();
marcEditorControl1.LoadBookData(string.Empty, isbn, defaultMarc: emptryMarc);
this.rtEtc1.Text = string.Empty;
this.rtEtc2.Text = string.Empty;
lbl_Midx.Tag = null;
lbl_Midx.Text = "신규작성";
lbl_Midx.BackColor = Color.Tomato;
}
}
string TextResetSub()
{
// 입력일자 (00-05)
// 발행년유형 (6)
// 발행년1 (07-10)
// 발행년2 (11-14)
// 발행국 (15-17)
// 삽화표시 (18-21)
// 이용대상자수준 (22) v
// 개별자료형태 (23) v
// 내용형식1 (24) v
// 내용형식2 (25) v
// 한국대학부호 (26-27)
// 수정레코드 (28)
// 회의간행물 (29) c
// 기념논문집 (30) c
// 색인 (31)
// 목록전거 (32)
// 문학형식 (33) v
// 전기 (34) v
// 언어 (35-37) v
// 한국정부기관부호 (38-39)
string yyMMdd = DateTime.Now.ToString("yyMMdd");
string yyyy = DateTime.Now.ToString("yyyy");
string Empty_008 = yyMMdd + "s" + yyyy + " 000 kor ▲";
string Empty_text = string.Format(
$"008\t {Empty_008.Replace("", "")}" +
"020\t \t▼a▼c▲\n" +
"056\t \t▼a▼2▲\n" +
"100\t \t▼a▲\n" +
"245\t \t▼a▼d▲\n" +
"260\t \t▼b▲\n" +
"300\t \t▼a▼c▲\n" +
"653\t \t▼a▲\n" +
"700\t \t▼a▲\n" +
"950\t \t▼b▲\n");
return Empty_text;
}
/// <summary>
/// 마크DB에 UPDATE해주는 함수
/// </summary>
/// <param name="Table">테이블 이름</param>
/// <param name="MarcIndex">마크 인덱스 번호</param>
/// <param name="FullMarc">한줄짜리 마크</param>
/// <param name="grade">마크 등급</param>
/// <param name="tag056">분류기호</param>
/// <param name="v_date">저장시각 yyyy-MM-dd HH:mm:ss</param>
void UpdateMarc(string MarcIndex, string FullMarc, string grade)
{
//도서정보추출
var v_isbn = "";
var v_price = "";
var v_author = "";
var v_title = "";
var v_publisher = "";
var v_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//파서를 사용해서 변경한다
var parser = new UniMarc.MarcParser();
parser.ParseFullMarc(FullMarc);
//ISBN와 가격 (처음나오는 020태그의 값을 적용)
var tag_020 = parser.GetTag<MarcField>("020").FirstOrDefault();
if (tag_020 != null)
{
v_isbn = tag_020.GetSubfieldValue('a');
v_price = tag_020.GetSubfieldValue('c');
}
//저자(100 -> 110 -> 111 순으로 적용)
var tag_100 = parser.GetTag<MarcField>("100").FirstOrDefault();
var tag_110 = parser.GetTag<MarcField>("110").FirstOrDefault();
var tag_111 = parser.GetTag<MarcField>("111").FirstOrDefault();
if (tag_111 != null)
v_author = tag_111.GetSubfieldValue('a');
else if (tag_110 != null)
v_author = tag_110.GetSubfieldValue('a');
else if (tag_100 != null)
v_author = tag_100.GetSubfieldValue('a');
//서명
var tag_245 = parser.GetTag<MarcSubfield>("245a").FirstOrDefault();
v_title = tag_245?.Value ?? string.Empty;
//출판사
var tag_264b = parser.GetTag<MarcSubfield>("264b").FirstOrDefault();
var tag_260b = parser.GetTag<MarcSubfield>("260b").FirstOrDefault();
if(tag_264b != null)
v_publisher = tag_264b?.Value ?? string.Empty;
else if (tag_260b != null)
v_publisher = tag_260b?.Value ?? string.Empty;
//056a
var v_056 = parser.GetTag("056a").FirstOrDefault() ?? string.Empty;
var v_008 = parser.GetTag("008").FirstOrDefault() ?? string.Empty;
if (v_056.isEmpty() || v_008.isEmpty())
{
UTIL.MsgE("056a | 008 태그의 값을 확인할 수 없습니다\n1.마크데이터를 확인 해주세요\n2.개발자에 해당 내용을 문의하세요");
return;
}
if (v_isbn.isEmpty() || v_title.isEmpty())
{
UTIL.MsgE("ISBN과 서명을 추출하지 못했습니다\n1.마크데이터를 확인 해주세요\n2.개발자에 해당 내용을 문의하세요");
return;
}
var etc1 = rtEtc1.Text.Trim();
var etc2 = rtEtc2.Text.Trim();
if (grade.isEmpty()) grade = "2";
if (MarcIndex.isEmpty())
{
//insert
string[] InsertTable =
{
"ISBN", "서명", "저자", "출판사", "가격",
"marc", "비고1", "비고2", "grade", "marc_chk",
"user", "division", "008tag", "date", "compidx"
};
//데이터중복검사필요
//동일 isbnd있다면 그래도 저장할건지 한번 더 물어봐야 함
if (DB_Utils.ExistISBN(v_isbn))
{
if (UTIL.MsgQ("동일한 ISBN이 이미 존재합니다. 그래도 저장하시겠습니까?") == DialogResult.No)
return;
}
string[] InsertColumn =
{
v_isbn, v_title, v_author, v_publisher, v_price,
FullMarc, etc1, etc2, grade.ToString(), "1",
PUB.user.UserName, v_056, v_008, v_date, PUB.user.CompanyIdx
};
string InCMD = db.DB_INSERT("Marc", InsertTable, InsertColumn);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, InCMD.Replace("\r", " ").Replace("\n", " ")));
var rlt = Helper_DB.ExcuteInsertGetIndex(InCMD);
if (rlt.errorMessage.isEmpty() == false)
UTIL.MsgE(rlt.errorMessage);
else
{
lbl_Midx.Tag = rlt.value.ToString();
lbl_Midx.Text = rlt.value.ToString();
UTIL.MsgI($"저장 완료\n\nIDX:{rlt.value}");
}
}
else
{
//update
string[] EditTable =
{
"compidx", "marc", "marc_chk","marc1", "marc_chk1", "비고1",
"비고2", "division", "008tag", "date", "user",
"grade"
};
string[] EditColumn =
{
PUB.user.CompanyIdx, FullMarc, "1",mOldMarc, "0", etc1,
etc2, v_056, v_008, v_date, PUB.user.UserName,
grade.ToString()
};
string[] SearchTable = { "idx", "compidx" };
string[] SearchColumn = { MarcIndex, PUB.user.CompanyIdx };
string UpCMD = db.More_Update("Marc", EditTable, EditColumn, SearchTable, SearchColumn);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
var rlt = Helper_DB.ExcuteNonQuery(UpCMD);
if (rlt.applyCount != 1)
UTIL.MsgE(rlt.errorMessage);
else
UTIL.MsgI("변경 완료");
}
}
private void Btn_SearchKolis_Click(object sender, EventArgs e)
{
AddMarc_FillBlank af = new AddMarc_FillBlank(this);
af.Show();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
searchMarc();
}
private void btSave_Click(object sender, EventArgs e)
{
var midx = lbl_Midx.Tag?.ToString() ?? string.Empty;
if (midx.isEmpty())
{
UTIL.MsgE("저장할 마크를 불러오세요\n신규마크작성상태에서는 추가 버튼을 사용하세요");
return;
}
SaveData(true);
}
private void btn_Save_Click(object sender, EventArgs e)
{
SaveData(false);
}
void SaveData(bool isUpdate)
{
string tag008 = marcEditorControl1.text008.Text;
//입력일자를 업데이트할지 확인한다.
if (isUpdate == false)
{
var inputdate = tag008.Substring(0, 6);
if (inputdate == "000000")
inputdate = DateTime.Now.ToString("yyMMdd");
else if (inputdate != DateTime.Now.ToString("yyMMdd"))
{
if (UTIL.MsgQ($"입력일자({inputdate})를 오늘로 변경할까요?") == DialogResult.Yes)
{
tag008 = DateTime.Now.ToString("yyMMdd") + tag008.Substring(6);
marcEditorControl1.text008.Text = tag008;
}
}
}
if (marcEditorControl1.CheckValidation() == false) return;
string tag056 = marcEditorControl1.Tag056(out string with008TagOutput);// Tag056(dbMarc, _param);
//tag056을 호출해야 008이추가된다.그런후에 데이터를 처리해야함
string fullMarc = marcEditorControl1.MakeMarcString();
var marcString = marcEditorControl1.richTextBox1.Text;
var parserF = new UniMarc.MarcParser();
parserF.ParseFullMarc(fullMarc);
string midx = this.lbl_Midx.Tag?.ToString() ?? string.Empty;
if (isUpdate == false) midx = string.Empty;
var v_grade = uC_SelectGrade1.Grade == -1 ? string.Empty : uC_SelectGrade1.Grade.ToString();
//if (radA.Checked) v_grade = "0";
//else if (radB.Checked) v_grade = "1";
//else if (radC.Checked) v_grade = "2";
//else if (radD.Checked) v_grade = "3";
//midx 값이 emptry 라면 insert , 아니라면 update
UpdateMarc(midx, fullMarc, v_grade);
}
private void rtEtc1_KeyDown(object sender, KeyEventArgs e)
{
var rt = sender as RichTextBox;
if (rt == null) return;
if (e.KeyCode == Keys.F5)
{
rt.AppendText("["+DateTime.Now.ToString("yy-MM-dd")+"]");
}
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>32</value>
</metadata>
</root>

View File

@@ -1,4 +1,4 @@
namespace UniMarc.
namespace UniMarc
{
partial class AddMarc_FillBlank
{

View File

@@ -8,19 +8,25 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc.
namespace UniMarc
{
public partial class AddMarc_FillBlank : Form
{
AddMarc am;
AddMarc2 am2;
public AddMarc_FillBlank(AddMarc _am)
{
InitializeComponent();
am = _am;
}
public AddMarc_FillBlank(AddMarc2 _am)
{
InitializeComponent();
am2 = _am;
}
private void AddMarc_FillBlank_Load(object sender, EventArgs e)
{
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Navigate("https://nl.go.kr/kolisnet/search/searchResultAllList.do?");
}
@@ -108,7 +114,10 @@ namespace UniMarc.마크
if (ary[1].Length != 2) ary[1].PadRight(2);
tmp += String.Join("\t", ary) + "\n";
}
if(am != null)
am.richTextBox1.Text = tmp;
if(am2 != null)
am2.SetKolisValueApply(tmp);
}
private void Btn_Close_Click(object sender, EventArgs e)

View File

@@ -1,5 +1,5 @@
namespace UniMarc.
namespace UniMarc
{
partial class All_Book_Detail
{

View File

@@ -7,10 +7,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Mac;
using WindowsFormsApp1;
namespace UniMarc.
namespace UniMarc
{
public partial class All_Book_Detail : Form
{
@@ -22,14 +20,12 @@ namespace UniMarc.마크
/// </summary>
public string[] data = { "", "", "", "" };
string compidx;
Helper_DB db = new Helper_DB();
All_Book_manage manage;
public All_Book_Detail(All_Book_manage _manage)
{
InitializeComponent();
manage = _manage;
compidx = manage.compidx;
}
private void All_Book_Detail_Load(object sender, EventArgs e)

View File

@@ -1,4 +1,4 @@
namespace WindowsFormsApp1.Mac
namespace UniMarc
{
partial class All_Book_manage
{

View File

@@ -1,4 +1,5 @@
using System;
using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -7,22 +8,17 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UniMarc.;
namespace WindowsFormsApp1.Mac
namespace UniMarc
{
public partial class All_Book_manage : Form
{
public string compidx;
public string charge;
Helper_DB db = new Helper_DB();
Main main;
public All_Book_manage(Main _main)
{
InitializeComponent();
main = _main;
compidx = main.com_idx;
charge = main.User;
}
private void All_Book_manage_Load(object sender, EventArgs e)
@@ -36,7 +32,7 @@ namespace WindowsFormsApp1.Mac
string text = textBox1.Text;
// 세트명 세트ISBN 세트수량 세트정가 저자 출판사 추가자
string Area_db = "`set_name`, `set_isbn`, `set_count`, `set_price`, `author`, `book_comp`, `charge`";
string cmd = db.DB_Contains("Set_Book", compidx, "set_name", text, Area_db);
string cmd = db.DB_Contains("Set_Book", PUB.user.CompanyIdx, "set_name", text, Area_db);
string db_res = db.DB_Send_CMD_Search(cmd);
string[] db_data = db_res.Split('|');
input_Grid(db_data);
@@ -148,7 +144,7 @@ namespace WindowsFormsApp1.Mac
{
if (V_idx != -1 && dataGridView1.Rows[a].Cells["chk_V"].Value.ToString() == "V")
{
MessageBox.Show("체크사항이 1개인지 확인해주세요.");
UTIL.MsgE("체크사항이 개인지 확인해주세요.");
return -1;
}
if (dataGridView1.Rows[a].Cells["chk_V"].Value.ToString() == "V")
@@ -167,7 +163,7 @@ namespace WindowsFormsApp1.Mac
return;
}
if (MessageBox.Show("삭제하시겠습니까?", "삭제", MessageBoxButtons.YesNo) == DialogResult.Yes)
if (UTIL.MsgQ("삭제하시겠습니까?") == DialogResult.Yes)
{
string[] delete_area = { "set_name", "set_isbn", "set_count", "set_price" };
string[] delete_data = {
@@ -176,8 +172,8 @@ namespace WindowsFormsApp1.Mac
dataGridView1.Rows[V_idx].Cells["set_count"].Value.ToString(),
dataGridView1.Rows[V_idx].Cells["set_price"].Value.ToString() };
string cmd = db.DB_Delete_No_Limit("Set_Book", "compidx", compidx, delete_area, delete_data);
db.DB_Send_CMD_reVoid(cmd);
string cmd = db.DB_Delete_No_Limit("Set_Book", "compidx", PUB.user.CompanyIdx, delete_area, delete_data);
Helper_DB.ExcuteNonQuery(cmd);
}
btn_Search_Click(null, null);

Some files were not shown because too many files have changed in this diff Show More