using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace NewPosInstaller { public static class DirInfo { /// /// 작업 디렉토리 /// "C:\SPC_NewPosInstall\" /// public const string WorkDir = @"C:\SPC_NewPosInstall\"; /// /// 신규포스 설치 디렉토리 /// Default = "C:\\SPC\POS\" /// public static string InstallDir = @"C:\SPC\POS\"; /// /// 로그 디렉토리 /// public const string LogDir = WorkDir + @"log\"; /// /// 다운로드 디렉토리 /// public const string DownDir = WorkDir + @"down\"; /// /// 임시 디렉토리 /// public const string TempDir = WorkDir + @"temp\"; /// /// 백업 디렉토리 /// public const string BackDir = WorkDir + @"back\"; /// /// 진 데이터 백업 (일자별) /// public const string JinDirBck = BackDir + @"LocalTBL_{0}\"; /// /// 진에서 내려준 데이터 폴더 /// public const string JinDir = @"C:\LocalTBL\"; } public static class ServerInfo { public static string FtpName = string.Empty; public static string FtpIP = string.Empty; public static string FtpUser = string.Empty; public static string FtpPass = string.Empty; public static string FtpPath = string.Empty; /// /// 다운로드받을 배포파일 (SPC.zip) /// public static string DownFile = string.Empty; public static string SvrName = string.Empty; public static string SvrIP = string.Empty; public static int SvrPort = 0; public new static string ToString() { return string.Format("FtpIP={0} FtpUser={1} FtpPass={2} FtpPath={3} SvrIP={4} SvrPort={5} " , FtpIP, FtpUser, FtpPass, FtpPath, SvrIP, SvrPort.ToString()); } } public static class DatabaseInfo { public static string InstanceName = string.Empty; public static string DataSource = string.Empty; public static string UserId = string.Empty; public static string Password = string.Empty; } /// /// 기본정보 /// public static class BasicInfo { private const string filePath = DirInfo.WorkDir + @"Status.ini"; private const string SECTION_BASIC = "BASIC"; private const string SECTION_SCHEDULE = "SCHEDULE"; private const string SECTION_STATUS = "STATUS"; /// /// 설치프로그램 파일 버전 정보 /// public static string InstallPgmVer { set; get; } /// /// 회사코드 /// public static string CompCd { get { return _compCd; } set { _compCd = value; IniFile.SetValue(filePath, SECTION_BASIC, "CompCd", _compCd); } } private static string _compCd = string.Empty; /// /// 브랜드코드 /// public static string BrandCd { get { return _brandCd; } set { _brandCd = value; IniFile.SetValue(filePath, SECTION_BASIC, "BrandCd", _brandCd); } } private static string _brandCd = string.Empty; /// /// 브랜드구분 /// public static string BrandGb { get { return _brandGb; } set { _brandGb = value; IniFile.SetValue(filePath, SECTION_BASIC, "BrandGb", _brandGb); } } private static string _brandGb = string.Empty; /// /// 점포코드 /// public static string StoreNo { get { return _storeNo; } set { _storeNo = value; IniFile.SetValue(filePath, SECTION_BASIC, "StoreNo", _storeNo); } } private static string _storeNo = string.Empty; /// /// AS-IS 점포코드 (삼립 점포코드 변경 대응) /// public static string OldStoreNo { get { return _oldStoreNo; } set { _oldStoreNo = value; IniFile.SetValue(filePath, SECTION_BASIC, "OldStoreNo", _oldStoreNo); } } private static string _oldStoreNo = string.Empty; /// /// 점포명 /// public static string StoreNm { get { return _storeNm; } set { _storeNm = value; IniFile.SetValue(filePath, SECTION_BASIC, "StoreNm", _storeNm); } } private static string _storeNm = string.Empty; /// /// 점포주소 /// public static string StoreAddr { get { return _storeAddr; } set { _storeAddr = value; IniFile.SetValue(filePath, SECTION_BASIC, "StoreAddr", _storeAddr); } } private static string _storeAddr = string.Empty; /// /// 점포전화번호 /// public static string StoreTel { get { return _storeTel; } set { _storeTel = value; IniFile.SetValue(filePath, SECTION_BASIC, "StoreTel", _storeTel); } } private static string _storeTel = string.Empty; /// /// POS NO /// public static string PosNo { get { return _posNo; } set { _posNo = value; IniFile.SetValue(filePath, SECTION_BASIC, "PosNo", _posNo); } } private static string _posNo = string.Empty; /// /// 선후불 구분 /// OLD[0:선불, 1:후불] => NEW[1:선불, 2:후불] /// public static string StoreType { get { return _storeType; } set { _storeType = value; IniFile.SetValue(filePath, SECTION_BASIC, "StoreType", _storeType); } } private static string _storeType = string.Empty; /// /// 주문구분 (후불일때만 구분함) /// OLD[0:정산,1:주문] => NEW[0:SUB, 1:MAIN] /// public static string OrderType { get { return _orderType; } set { _orderType = value; IniFile.SetValue(filePath, SECTION_BASIC, "OrderType", _orderType); } } private static string _orderType = string.Empty; /// /// 국가 (3자리코드) /// public static string Nation { get { return _nation; } set { _nation = value; IniFile.SetValue(filePath, SECTION_BASIC, "Nation", _nation); } } private static string _nation = string.Empty; /// /// 언어 (2자리코드) /// public static string Language { get { return _language; } set { _language = value; IniFile.SetValue(filePath, SECTION_BASIC, "Language", _language); } } private static string _language = string.Empty; public static string _font = string.Empty; public static string _fontFix = string.Empty; public static string _country = string.Empty; public static string _cultureid = string.Empty; /// /// 이전회사코드 /// public static string OldCompCd { get { return _oldCompCd; } set { _oldCompCd = value; IniFile.SetValue(filePath, SECTION_BASIC, "OldCompCd", _oldCompCd); } } private static string _oldCompCd = string.Empty; /// /// AS-IS POS ini 파일 디렉토리 /// public static string OldPosIniDir { get { return _oldPosIniDir; } set { _oldPosIniDir = value; IniFile.SetValue(filePath, SECTION_BASIC, "OldPosIniDir", _oldPosIniDir); } } private static string _oldPosIniDir = string.Empty; /// /// AS-IS POS Root 디렉토리 /// public static string OldPosRootDir { get { return _oldPosRootDir; } set { _oldPosRootDir = value; IniFile.SetValue(filePath, SECTION_BASIC, "OldPosRootDir", _oldPosIniDir); } } private static string _oldPosRootDir = string.Empty; public static string OldStoreINI { set; get; } public static string OldStoreOptINI { set; get; } public static string OldDeviceINI { set; get; } public static string OldSaleINI { set; get; } public static string OldFtpINI { set; get; } /// /// 설치일정 일자 (서버조회) /// public static string InstallDate { get { return _installDate; } set { _installDate = value; IniFile.SetValue(filePath, SECTION_SCHEDULE, "InstallDate", _installDate); } } private static string _installDate = string.Empty; /// /// 설치일정 시간 (서버조회) /// public static string InstallTime { get { return _installTime; } set { _installTime = value; IniFile.SetValue(filePath, SECTION_SCHEDULE, "InstallTime", _installTime); } } private static string _installTime = string.Empty; /// /// 오픈일자 /// public static string SysOpenDate { get { return IniFile.GetValue(filePath, SECTION_SCHEDULE, "SysOpenDate", ""); } set { IniFile.SetValue(filePath, SECTION_SCHEDULE, "SysOpenDate", value); } } private static string _openDate = string.Empty; /// /// 프로그램 다운로드 일시 /// public static string PGMDownDate { get { return _pgmDownDate; } set { _pgmDownDate = value; IniFile.SetValue(filePath, SECTION_STATUS, "PGMDownDate", _pgmDownDate); } } private static string _pgmDownDate = string.Empty; /// /// 프로그램 설치 일시 /// public static string POSSetupDate { get { return _posSetupDate; } set { _posSetupDate = value; IniFile.SetValue(filePath, SECTION_STATUS, "POSSetupDate", _posSetupDate); } } private static string _posSetupDate = string.Empty; /// /// 데이터베이스 설치 일시 /// public static string DBCreateDate { get { return _dbCreateData; } set { _dbCreateData = value; IniFile.SetValue(filePath, SECTION_STATUS, "DBCreateDate", _dbCreateData); } } private static string _dbCreateData = string.Empty; /// /// 구POS 운영정보 이행 처리 일자 /// public static string OldPosTransDate { get { return _oldPosTransDate; } set { _oldPosTransDate = value; IniFile.SetValue(filePath, SECTION_STATUS, "OldPosTransDate", _oldPosTransDate); } } private static string _oldPosTransDate = string.Empty; /// /// 신POS 마스터 다운로드 일시 /// (마스터 다운로드는 하지 않는다. 너무 힘들다) /// public static string MSTDownDate { get { return _mstDownDate; } set { //_mstDownDate = value; //IniFile.SetValue(filePath, SECTION_STATUS, "MSTDownDate", _mstDownDate); } } private static string _mstDownDate = string.Empty; /// /// 신POS 최초 운영이미지 다운로드 일시 /// public static string IMGDownDate { get { return _imgDownDate; } set { _imgDownDate = value; IniFile.SetValue(filePath, SECTION_STATUS, "IMGDownDate", _imgDownDate); } } public static string _imgDownDate = string.Empty; /// /// CompCode={0} BrandCode={1} StoreNo={2} StoreName={3} PosNo={4} Nation={5} Language={6} /// /// public new static string ToString() { return string.Format("CompCode={0} BrandCode={1} StoreNo={2} StoreName={3} PosNo={4} Nation={5} Language={6} OldIniDir={7} InstallDate={8} InstallTime={9}" , _compCd, _brandCd, _storeNo, _storeNm, _posNo, _nation, _language, _oldPosIniDir, _installDate, _installTime); } public static void ReadStatusInfo() { if (File.Exists(filePath)) { string createDate = IniFile.GetValue(filePath, SECTION_BASIC, "CreateDate", ""); if (string.IsNullOrWhiteSpace(createDate)) IniFile.SetValue(filePath, SECTION_BASIC, "CreateDate", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); _compCd = IniFile.GetValue(filePath, SECTION_BASIC, "CompCd", ""); _brandCd = IniFile.GetValue(filePath, SECTION_BASIC, "BrandCd", ""); _brandGb = IniFile.GetValue(filePath, SECTION_BASIC, "BrandGb", ""); _storeNo = IniFile.GetValue(filePath, SECTION_BASIC, "StoreNo", ""); _storeNm = IniFile.GetValue(filePath, SECTION_BASIC, "StoreNm", ""); _posNo = IniFile.GetValue(filePath, SECTION_BASIC, "PosNo", ""); _storeType = IniFile.GetValue(filePath, SECTION_BASIC, "StoreType"); _orderType = IniFile.GetValue(filePath, SECTION_BASIC, "OrderType"); _nation = IniFile.GetValue(filePath, SECTION_BASIC, "Nation", ""); _language = IniFile.GetValue(filePath, SECTION_BASIC, "Language", ""); _oldCompCd = IniFile.GetValue(filePath, SECTION_BASIC, "OldCompCd", ""); _oldPosIniDir = IniFile.GetValue(filePath, SECTION_BASIC, "OldPosIniDir", ""); _oldStoreNo = IniFile.GetValue(filePath, SECTION_BASIC, "OldStoreNo", ""); _installDate = IniFile.GetValue(filePath, SECTION_SCHEDULE, "InstallDate", ""); _installTime = IniFile.GetValue(filePath, SECTION_SCHEDULE, "InstallTime", ""); _openDate = IniFile.GetValue(filePath, SECTION_SCHEDULE, "OpenDate", ""); _pgmDownDate = IniFile.GetValue(filePath, SECTION_STATUS, "PGMDownDate", ""); _posSetupDate = IniFile.GetValue(filePath, SECTION_STATUS, "POSSetupDate", ""); _dbCreateData = IniFile.GetValue(filePath, SECTION_STATUS, "DBCreateDate", ""); _oldPosTransDate = IniFile.GetValue(filePath, SECTION_STATUS, "OldPosTransDate", ""); _mstDownDate = IniFile.GetValue(filePath, SECTION_STATUS, "MSTDownDate", ""); _imgDownDate = IniFile.GetValue(filePath, SECTION_STATUS, "IMGDownDate", ""); } else { // 신규생성 IniFile.SetValue(filePath, SECTION_BASIC, "CreateDate", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); CompCd = string.Empty; BrandCd = string.Empty; BrandGb = string.Empty; StoreNo = string.Empty; StoreNm = string.Empty; PosNo = string.Empty; StoreType = string.Empty; OrderType = string.Empty; Nation = string.Empty; Language = string.Empty; OldCompCd = string.Empty; OldPosIniDir = string.Empty; OldStoreNo = string.Empty; InstallDate = string.Empty; InstallTime = string.Empty; SysOpenDate = string.Empty; PGMDownDate = string.Empty; POSSetupDate = string.Empty; DBCreateDate = string.Empty; OldPosTransDate = string.Empty; MSTDownDate = string.Empty; IMGDownDate = string.Empty; // 주방프린터 for (var i = 1; i <= 15; i++) { string key = string.Format("KPS{0:00}", i); string value= string.Empty; SetKPSInfo(key, value); } } } /// /// 주방장치정보 읽기 /// /// public static string GetKPSInfo(string key) { return IniFile.GetValue(filePath, "KPSDEVICE", key, ""); } /// /// 주방장치정보 저장 /// /// /// public static bool SetKPSInfo(string key, string value) { return IniFile.SetValue(filePath, "KPSDEVICE", key, value); } /// /// 포스옵션 읽기 /// /// /// public static string GetPosOptionInfo(string key) { return IniFile.GetValue(filePath, "OPTION", key, ""); } /// /// 포스옵션 저장 /// /// /// /// public static bool SetPosOptionInfo(string key, string value) { return IniFile.SetValue(filePath, "OPTION", key, value); } } /// /// /// public static class CheckInfo { private const string filePath = DirInfo.WorkDir + @"Status.ini"; private const string SECTION_CHECK = "CHECK"; /// /// 현재화면 해상도 /// 800x600, 1024x768 /// public static string ScreenSize { get { return _screenSize; } set { _screenSize = value; IniFile.SetValue(filePath, SECTION_CHECK, "ScreenSize", _screenSize); } } private static string _screenSize = string.Empty; /// /// 카드리더기 사용구분 /// MSR(USB:KeybordWedge), MSR(Serial:Emulator), IC /// public static string CardReader { get { return _cardReader; } set { _cardReader = value; IniFile.SetValue(filePath, SECTION_CHECK, "CardReader", _cardReader); } } private static string _cardReader = string.Empty; /// /// CAT단말기 사용구분 /// NONE:미사용, OLD:구형, NEW:구형 /// public static string CatTerminal { get { return _catTerminal; } set { _catTerminal = value; IniFile.SetValue(filePath, SECTION_CHECK, "CatTerminal", _catTerminal); } } private static string _catTerminal = string.Empty; public static string OldStoreNo { get { return _oldStoreNo; } set { _oldStoreNo = value; IniFile.SetValue(filePath, SECTION_CHECK, "OldStoreNo", _oldStoreNo); } } private static string _oldStoreNo = string.Empty; public static string TPayUsed { get { return _tpayUsed; } set { _tpayUsed = value; IniFile.SetValue(filePath, SECTION_CHECK, "TPayUsed", _tpayUsed); } } private static string _tpayUsed = string.Empty; public static string TPayBleUsed { get { return _tpayBleUsed; } set { _tpayBleUsed = value; IniFile.SetValue(filePath, SECTION_CHECK, "TPayBleUsed", _tpayBleUsed); } } private static string _tpayBleUsed = string.Empty; /// /// 포스정보 /// Format => POSIP|POS구분|메인여부|화면크기|카드리더기종류|CAT단말기종류 /// public static string PosInfo { get { return _posInfo; } set { _posInfo = value; IniFile.SetValue(filePath, SECTION_CHECK, "PosInfo", _tpayBleUsed); } } private static string _posInfo = string.Empty; public static string OSVerInfo { get { return _osVerInfo.Trim(); } set { _osVerInfo = value; IniFile.SetValue(filePath, SECTION_CHECK, "OSVerInfo", _osVerInfo); } } private static string _osVerInfo = string.Empty; public static string Permission { get { return _permission.Trim(); } set { _permission = value; IniFile.SetValue(filePath, SECTION_CHECK, "Permission", _permission); } } private static string _permission = string.Empty; public static void ReadCheckInfo() { _oldStoreNo = IniFile.GetValue(filePath, SECTION_CHECK, "OldStoreNo"); _screenSize = IniFile.GetValue(filePath, SECTION_CHECK, "ScreenSize"); _cardReader = IniFile.GetValue(filePath, SECTION_CHECK, "CardReader"); _catTerminal = IniFile.GetValue(filePath, SECTION_CHECK, "CatTerminal"); _tpayUsed = IniFile.GetValue(filePath, SECTION_CHECK, "TPayUsed"); _tpayBleUsed = IniFile.GetValue(filePath, SECTION_CHECK, "TPayBleUsed"); _posInfo = IniFile.GetValue(filePath, SECTION_CHECK, "PosInfo"); _osVerInfo = IniFile.GetValue(filePath, SECTION_CHECK, "OSVerInfo"); _permission = IniFile.GetValue(filePath, SECTION_CHECK, "Permission"); } } /// /// 이행 전 테이블 정보 /// public class TableInfo { public string BrandCode = string.Empty; public string StroeCode = string.Empty; public string PosNo = string.Empty; public string FloorCode = string.Empty; public string FloorName = string.Empty; public string TableNo = string.Empty; public string TableName = string.Empty; public int X = 0; public int Y = 0; public int W = 0; public int H = 0; } /// /// 층 정보 /// public class MST_FLOOR { public class DATA { /// /// 층코드 /// public string FLOOR_CD = string.Empty; /// /// 층명 /// public string FLOOR_NM = string.Empty; /// /// 수정일시 /// public string UPD_DT = string.Empty; /// /// 등록일시 /// public string REG_DT = string.Empty; /// /// 상태 /// public PosConst.DB_ROW_STATUS STATUS = PosConst.DB_ROW_STATUS.NONE; } } /// /// 테이블 정보 /// public class MST_TABLE { public class DATA { /// /// 층 코드 /// public string FLOOR_CD = string.Empty; /// /// 테이블 번호 /// public string TABLE_NO = string.Empty; /// /// 테이블 명 /// public string TABLE_NM = string.Empty; /// /// 테이블 유형(1:테이블, 2:레이블) /// public string TABLE_TYPE = string.Empty; /// /// 테이블 형태(1:사각, 2:라운드, 3:타원, 4:이미지) /// public string TABLE_TYPE__1640 = string.Empty; /// /// 배경색 /// public string BACK_COLOR = string.Empty; /// /// 배경이미지 /// public string BACK_IMAGE = string.Empty; /// /// 폰트 색상 /// public string FONT_COLOR = string.Empty; /// /// 폰트 명 /// public string FONT_NM = string.Empty; /// /// 폰트 크기 /// public int FONT_SIZE = 0; /// /// X 좌표 /// public int X_COORD = 0; /// /// Y 좌표 /// public int Y_COORD = 0; /// /// 넓이 /// public int WIDTH = 0; /// /// 높이 /// public int HEIGHT = 0; /// /// 테이블 표시 구분 /// public string TABLE_DISP_FLAG = string.Empty; /// /// 좌석 수 /// public int SEAT_CNT = 0; /// /// 좌석 수 표시 구분 /// public string SEAT_DISP_FLAG = string.Empty; /// /// 테이블 조작 구분 /// public string OP_FLAG = string.Empty; /// /// 조작 층 구분 /// public string OP_FLOOR_CD = string.Empty; /// /// 조작 테이블 번호 /// public string OP_TABLE_NO = string.Empty; /// /// 테이블 사용 구분 /// public string USE_FLAG = string.Empty; /// /// 고객수 /// public int CUST_CNT = 0; /// /// 최초 주문 시간 /// public string FIRST_ORDER_TIME = string.Empty; /// /// 주문금액 /// public double ORDER_AMT = 0; /// /// 예약 구분 /// public string RESERVATION_FLAG = string.Empty; /// /// 예약 시간 /// public string RESERVATION_TIME = string.Empty; /// /// 주문 칼라 /// public string ORDER_COLOR = string.Empty; /// /// 결제완료 칼라 /// public string PAY_COMPLETE_COLOR = string.Empty; /// /// 결제완료 구분 /// public string PAY_COMPLETE_FLAG = string.Empty; /// /// 수정일시 /// public string UPD_DT = string.Empty; /// /// 등록일시 /// public string REG_DT = string.Empty; /// /// 상태 (추가,수정,삭제) /// public PosConst.DB_ROW_STATUS STATUS = PosConst.DB_ROW_STATUS.NONE; /// /// 테이블 출력용 상품목록 /// public string ITEM_LIST = string.Empty; /// /// 객층정보 (FILLER1 = m_cTrnStatus.Head.PayGndrDiv + "|" + m_cTrnStatus.Head.PayAge) /// public string CUST_AGE = string.Empty; /// /// 고객상세정보 (FILLER2) /// public string CUST_LST = string.Empty; } } /// /// 기타코드 (사유코드) /// public class EtcCodeInfo { public string GroupCode = string.Empty; public string commCode = string.Empty; public string EtcCode = string.Empty; public string EtcName = string.Empty; } /// /// 테이블예약 정보 /// public class TableReserv { public string ReservNo = string.Empty; public string ReservDt = string.Empty; public string ReservTm = string.Empty; public string Cashier = string.Empty; public string TelNo = string.Empty; public string Note = string.Empty; public string AlarmYn = string.Empty; public string AlarmTm = string.Empty; public string Comfirm = string.Empty; public string UpdID = string.Empty; public string UpdDt = string.Empty; public string InsID = string.Empty; public string InsDt = string.Empty; } }