private void TXT_TMLID_CONFIRM_Click(object sender, EventArgs e) { //네트워크 체크 if (!Constants.ONLINE_STATUS) { MetroMessageBox.Show(this, Constants.getMessage("ERROR_NETWORK"), "Config", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } JObject sendObj = new JObject(); sendObj.Add("tml_id", TXT_TML_ID.Text); Transaction tran = new Transaction(); JArray arrRet = tran.sendServer_arr(sendObj.ToString(), tran.url_TmlInfo, 60, false); if (arrRet != null && arrRet.Count > 0) { MetroMessageBox.Show(this, "정상 조회 되었습니다." + Environment.NewLine + "매장명:" + arrRet[0]["shop_name"].ToString(), "Config", MessageBoxButtons.OK, MessageBoxIcon.Information); m_bTMLID_CONFIRM = true; } else { m_bTMLID_CONFIRM = false; MetroMessageBox.Show(this, Constants.getMessage("TMLID_ERROR"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); TXT_TML_ID.Focus(); } }
private void BTN_SAVE_Click(object sender, EventArgs e) { try { setWaitCursor(true); if (TXT_TML_ID.Text == null || string.Empty.Equals(TXT_TML_ID.Text.ToString()) || TXT_TML_ID.Text.ToString().Length < TXT_TML_ID.MaxLength) { MetroMessageBox.Show(this, Constants.getMessage("TXT_TML_ID"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); TXT_TML_ID.Focus(); return; } if (COM_PRINTER.SelectedItem == null || COM_PRINTER.SelectedIndex < 0) { MetroMessageBox.Show(this, Constants.getMessage("COM_PRINTER"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); COM_PRINTER.Focus(); return; } /* * if(COM_PASS_SCAN.SelectedIndex <0) * { * MetroMessageBox.Show(this, "여권스캐너를 선택해 주세요.", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * COM_PASS_SCAN.Focus(); * return; * } * if (COM_PRINTER.SelectedIndex < 0) * { * MetroMessageBox.Show(this, "저장이 완료되었습니다..", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * } * if (COM_OPOS.SelectedIndex < 0) * { * MetroMessageBox.Show(this, "저장이 완료되었습니다..", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * } */ /* * if (COM_SLIP_TYPE.SelectedIndex < 0) * { * MetroMessageBox.Show(this, Constants.CONF_MANAGER.getCustomValue("Message", "COM_SLIP_TYPE"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * COM_SLIP_TYPE.Focus(); * setWaitCursor(false); * return; * } */ //Constants 저장 //Constants.PC_NO = Int32.Parse(COM_PC_NO.Text.ToString()); Constants.TML_ID = TXT_TML_ID.Text.ToString(); Constants.PASSPORT_TYPE = COM_PASS_SCAN.SelectedIndex; Constants.PRINTER_TYPE = COM_PRINTER.SelectedItem.ToString(); Constants.PRINTER_OPOS_TYPE = COM_OPOS.SelectedItem == null? "" :COM_OPOS.SelectedItem.ToString(); Constants.SIGNPAD_USE = COM_SIGNPAD_USE.SelectedItem.ToString(); Constants.PRINT_TYPE = COM_PRINT_TYPE.SelectedItem.ToString(); Constants.TAX_TYPE = COM_TAX_TYPE.SelectedItem.ToString(); //Constants.SLIP_TYPE = COM_SLIP_TYPE.SelectedItem.ToString(); Constants.FEE_8_RATE = TXT_8_RATE.Text.ToString(); Constants.FEE_10_RATE = TXT_10_RATE.Text.ToString(); Constants.PRINT_SETTING = COM_PRINT_SETTING.SelectedIndex.ToString(); //LOCAL DB 저장 Constants.SQLITE_MANAGER.updateConfigData("TML_ID", "" + Constants.TML_ID, "터미널번호"); Constants.SQLITE_MANAGER.updateConfigData("PASSPORT_TYPE", "" + Constants.PASSPORT_TYPE, "여권스캐너"); Constants.SQLITE_MANAGER.updateConfigData("PRINTER_TYPE", Constants.PRINTER_TYPE, "영수증프린터"); Constants.SQLITE_MANAGER.updateConfigData("PRINTER_OPOS_TYPE", Constants.PRINTER_OPOS_TYPE, "영수증프린터"); Constants.SQLITE_MANAGER.updateConfigData("SIGNPAD_USE", Constants.SIGNPAD_USE, "서명패스 사용여부"); Constants.SQLITE_MANAGER.updateConfigData("PRINT_TYPE", Constants.PRINT_TYPE, "영수증 출력용지"); Constants.SQLITE_MANAGER.updateConfigData("TAX_TYPE", Constants.TAX_TYPE, "세금 우선순위"); Constants.SQLITE_MANAGER.updateConfigData("FEE_8_RATE", Constants.FEE_8_RATE, "8% 수수료"); Constants.SQLITE_MANAGER.updateConfigData("FEE_10_RATE", Constants.FEE_10_RATE, "10% 수수료"); Constants.SQLITE_MANAGER.updateConfigData("PRINT_SETTING", Constants.PRINT_SETTING, "전자화관련 프린트설정"); //Constants.LDB_MANAGER.updateConfigData("SLIP_TYPE", "" + Constants.SLIP_TYPE, "전표타입"); //MetroMessageBox.Show(this, "저장 완료되었습니다.", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); MetroMessageBox.Show(this, Constants.getMessage("CONFIG_SAVE_SUCCESS"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { setWaitCursor(false); } }
private void BTN_SAVE_Click(object sender, EventArgs e) { try { //네트워크 체크 if (!Constants.ONLINE_STATUS) { MetroMessageBox.Show(this, Constants.getMessage("ERROR_NETWORK"), "Config", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } setWaitCursor(true); if (TXT_TML_ID.Text == null || string.Empty.Equals(TXT_TML_ID.Text.ToString()) || TXT_TML_ID.Text.ToString().Length < TXT_TML_ID.MaxLength) { MetroMessageBox.Show(this, Constants.getMessage("TXT_TML_ID"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); TXT_TML_ID.Focus(); return; } if (!m_bTMLID_CONFIRM) { MetroMessageBox.Show(this, Constants.getMessage("TMLID_ALERT"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); TXT_TML_ID.Focus(); return; } if (COM_PRINTER_TYPE.SelectedItem == null || COM_PRINTER_TYPE.SelectedIndex < 0) { MetroMessageBox.Show(this, Constants.getMessage("COM_PRINTER_TYPE"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); COM_PRINTER.Focus(); return; } if (COM_PRINTER_TYPE.SelectedIndex == 0) { if (COM_PRINTER.SelectedItem == null || COM_PRINTER.SelectedIndex < 0) { MetroMessageBox.Show(this, Constants.getMessage("COM_PRINTER"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); COM_PRINTER.Focus(); return; } } else if (COM_PRINTER_TYPE.SelectedIndex == 1) { if (COM_OPOS.SelectedItem == null || COM_OPOS.SelectedIndex < 0) { MetroMessageBox.Show(this, Constants.getMessage("COM_OPOS"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); COM_PRINTER.Focus(); return; } } /* * if(COM_PASS_SCAN.SelectedIndex <0) * { * MetroMessageBox.Show(this, "여권스캐너를 선택해 주세요.", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * COM_PASS_SCAN.Focus(); * return; * } * if (COM_PRINTER.SelectedIndex < 0) * { * MetroMessageBox.Show(this, "저장이 완료되었습니다..", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * } * if (COM_OPOS.SelectedIndex < 0) * { * MetroMessageBox.Show(this, "저장이 완료되었습니다..", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * } */ /* * if (COM_SLIP_TYPE.SelectedIndex < 0) * { * MetroMessageBox.Show(this, Constants.CONF_MANAGER.getCustomValue("Message", "COM_SLIP_TYPE"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); * COM_SLIP_TYPE.Focus(); * setWaitCursor(false); * return; * } */ //Constants 저장 //Constants.PC_NO = Int32.Parse(COM_PC_NO.Text.ToString()); Constants.TML_ID = TXT_TML_ID.Text.ToString(); JObject sendObj = new JObject(); sendObj.Add("tml_id", Constants.TML_ID); Transaction tran = new Transaction(); JArray arrRet = tran.sendServer_arr(sendObj.ToString(), tran.url_TmlInfo, 60, false); if (arrRet != null && arrRet.Count > 0) { Parent.Parent.Controls["TIL_SHOP_NAME"].Text = arrRet[0]["shop_name"].ToString(); Constants.SHOP_NAME = arrRet[0]["shop_name"].ToString(); } Constants.PASSPORT_TYPE = COM_PASS_SCAN.SelectedIndex - 1; Constants.PRINTER_SELECT_TYPE = COM_PRINTER_TYPE.SelectedIndex; Constants.PRINTER_TYPE = COM_PRINTER.SelectedItem.ToString(); Constants.PRINTER_OPOS_TYPE = COM_OPOS.SelectedItem == null? "" :COM_OPOS.SelectedItem.ToString(); //Constants.SLIP_TYPE = COM_SLIP_TYPE.SelectedItem.ToString(); System.Diagnostics.Debug.WriteLine("TXT_STANDARD_SELL_PRICE : " + TXT_STANDARD_SELL_PRICE); System.Diagnostics.Debug.WriteLine("TXT_SUITE_SELL_PRICE : " + TXT_SUITE_SELL_PRICE.Text.ToString()); //Constants.STANDARD_SELL_PRICE = Int32.Parse(TXT_STANDARD_SELL_PRICE.Text.ToString()); //2019.10.31 추가 Constants.STANDARD_SELL_PRICE = Int32.Parse(TXT_STANDARD_SELL_PRICE.Text.ToString().Trim() == "" ? "0" : TXT_STANDARD_SELL_PRICE.Text.ToString()); //2019.10.31 추가 //Constants.SUITE_SELL_PRICE = Int32.Parse(TXT_SUITE_SELL_PRICE.Text.ToString()); //2019.10.31 추가 Constants.SUITE_SELL_PRICE = Int32.Parse(TXT_SUITE_SELL_PRICE.Text.ToString().Trim() == "" ? "0" : TXT_SUITE_SELL_PRICE.Text.ToString()); //2019.10.31 추가 Constants.SIGN_PAD_TYPE = COM_SIGNPAD.SelectedIndex; //LOCAL DB 저장 Constants.LDB_MANAGER.updateConfigData("TML_ID", "" + Constants.TML_ID, "터미널번호"); Constants.LDB_MANAGER.updateConfigData("PASSPORT_TYPE", "" + Constants.PASSPORT_TYPE, "여권스캐너"); Constants.LDB_MANAGER.updateConfigData("PRINTER_SELECT_TYPE", "" + Constants.PRINTER_SELECT_TYPE, "출력프린터종류"); Constants.LDB_MANAGER.updateConfigData("PRINTER_TYPE", Constants.PRINTER_TYPE, "일반프린터"); Constants.LDB_MANAGER.updateConfigData("PRINTER_OPOS_TYPE", Constants.PRINTER_OPOS_TYPE, "영수증프린터"); Constants.LDB_MANAGER.updateConfigData("SIGN_PAD_TYPE", Constants.SIGN_PAD_TYPE + "", "사인패드종류"); Constants.LDB_MANAGER.updateConfigData("SHOP_NAME", Constants.SHOP_NAME + "", "매장 명"); Constants.LDB_MANAGER.updateConfigData("STANDARD_SELL_PRICE", Constants.STANDARD_SELL_PRICE + "", "일반룸가격"); //2019.10.31 추가 Constants.LDB_MANAGER.updateConfigData("SUITE_SELL_PRICE", Constants.SUITE_SELL_PRICE + "", "스위트룸가격"); //2019.10.31 추가 //Constants.LDB_MANAGER.updateConfigData("SLIP_TYPE", "" + Constants.SLIP_TYPE, "전표타입"); //MetroMessageBox.Show(this, "저장 완료되었습니다.", "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); MetroMessageBox.Show(this, Constants.getMessage("CONFIG_SAVE_SUCCESS"), "Config Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { setWaitCursor(false); } }