/// <summary> /// 쿠폰정보 조회 /// </summary> public void GetSaleCoupon() { var db = MasterDbHelper.InitInstance(); DataSet ds = null; try { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_PY", "P012GetCouponBSM200T"), new string[] { "@DD_SALE" }, new object[] { ConfigData.Current.AppConfig.PosInfo.SaleDate }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view != null) { m_view.SetSaleCoupon(ds); } }
/// <summary> /// 타사 상품권명 조회 /// </summary> public void GetTicketTitle() { var masterdb = MasterDbHelper.InitInstance(); DataSet ds = null; try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_IO", "SelectGFM050T"), new string[] { "@DD_SALE" }, new object[] { ConfigData.Current.AppConfig.PosInfo.SaleDate }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } if (m_view != null) { //타사 상품권명 셋팅 m_view.SetTicketTitle(ds); } }
public void GetTable(int floor) { DataSet dsMts = null; var mtsdb = MasterDbHelper.InitInstance(); try { dsMts = mtsdb.ExecuteQuery(Extensions.LoadSqlCommand("CmdTable", "GetTable"), new string[] { "@Floor" }, new object[] { floor }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { mtsdb.EndInstance(); } if (m_view != null) { m_view.SetTableList(dsMts); } }
public void DeleteTable(int id) { var mtsdb = MasterDbHelper.InitInstance(); var trans = mtsdb.BeginTransaction(); try { string insQuery = Extensions.LoadSqlCommand("CmdTable", "DeleteTable"); mtsdb.ExecuteNonQuery(insQuery, new string[] { "@id" }, new object[] { id }, trans); trans.Commit(); } catch (Exception ex) { if (trans != null) { trans.Rollback(); } LogUtils.Instance.LogException(ex); } finally { trans.Dispose(); mtsdb.Dispose(); } }
public void GetCardCompList() { List <string[]> list = new List <string[]>(); var db = MasterDbHelper.InitInstance(); try { string query = Extensions.LoadSqlCommand("POS_PY", "P005GetCardCompList"); var ds = db.ExecuteQuery(query, null, null); foreach (DataRow item in ds.Tables[0].Rows) { list.Add(new string[] { item["CD_CARD"].ToString(), item["NM_CARD"].ToString() }); } } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.Dispose(); } m_view.BindCardCompList(list); list = null; }
/// <summary> /// 새로운공지확인 /// </summary> public void CheckNewNotice() { var db = MasterDbHelper.InitInstance(); try { var fgCnt = db.ExecuteScalar(Extensions.LoadSqlCommand("POS_ST", "M002GetNoticeYNBSM130T"), new string[] { "@ID_USER", "@DD_SALE" }, new object[] { ConfigData.Current.AppConfig.PosInfo.CasNo, DateTime.Today.ToString("yyyyMMdd") }); FrameBaseData.Current.OnDataChanged(FrameBaseDataItem.HasNotice, TypeHelper.ToInt32(fgCnt) > 0); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } }
/// <summary> /// 공지사항 조회 /// </summary> public void GetNotice() { var db = MasterDbHelper.InitInstance(); DataSet ds = null; try { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "P004GetNoticeBSM130T"), new string[] { "@DD_SALE", "@ID_USER" }, new object[] { ConfigData.Current.AppConfig.PosInfo.SaleDate, ConfigData.Current.AppConfig.PosInfo.CasNo }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view != null) { //공지사항 셋팅 m_view.SetNotice(ds); } }
/// <summary> /// 공통코드 조회 /// </summary> public void GetCode() { var db = MasterDbHelper.InitInstance(); DataSet ds = null; try { string strSql = string.Empty; ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "P002GetCD"), null, null); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view != null) { //조회결과 셋팅 m_view.SetCode(ds); } }
public void InsertTable(int index, int x, int y, int floor) { var mtsdb = MasterDbHelper.InitInstance(); var trans = mtsdb.BeginTransaction(); try { string insQuery = Extensions.LoadSqlCommand("CmdTable", "InsertTable"); mtsdb.ExecuteNonQuery(insQuery, new string[] { "@Index", "@X", "@Y", "@Floor" }, new object[] { index, x, y, floor }, trans); trans.Commit(); } catch (Exception ex) { if (trans != null) { trans.Rollback(); } LogUtils.Instance.LogException(ex); } finally { trans.Dispose(); mtsdb.Dispose(); } }
/// <summary> /// ① Local Table bms030t에서 계산원 정보 확인 하고 없으면 서버와 통신(전문:PQ03 )하여 계산원 확인 한다. /// - 미등록 계산원인경우 오류 메시지 (참고5 Guid) 항목에 표시 /// ② 조회된 계산원명을 표시한다. /// </summary> /// <returns></returns> public void ValidateCasNo() { m_casData = null; if (string.IsNullOrEmpty(m_view.CasNo)) { return; } m_view.UpdateStatusMessage(string.Empty); using (var db = MasterDbHelper.InitInstance()) { string sql = Extensions.LoadSqlCommand("POS_SO", "ValidateCasNo"); var ds = db.ExecuteQuery(sql, new string[] { "@ID_USER" }, new object[] { m_view.CasNo }); var list = new List <PQ03RespData>(); foreach (DataRow dr in ds.Tables[0].Rows) { list.Add(new PQ03RespData() { UserNo = dr["ID_USER"].ToString(), UserName = dr["NM_USER"].ToString(), EmpNo = dr["NO_EMP"].ToString(), Password = dr["NO_PASS"].ToString(), UserType = dr["FG_USER"].ToString(), ProcFg = dr["FG_USE"].ToString(), }); } if (list.Count == 0) { //// not found, check in server, usign task, socket //var pq03Task = new PQ03DataTask(m_view.CasNo); //pq03Task.TaskCompleted += new WSWD.WmallPos.FX.NetComm.Tasks.TaskCompletedHandler(pq03Task_TaskCompleted); //pq03Task.ExecuteTask(); m_view.UpdateStatusMessage(LoginMessageTypes.NoUserInfo); } else { m_casData = list[0]; m_view.CasName = m_casData.UserName; } } }
/// <summary> /// Connect to db, /// get data from BSM043T /// Transaction 처리 한다 /// </summary> /// <returns></returns> public void ProcessBSM043T() { // Master db 이용합니다. var db = MasterDbHelper.InitInstance(); var trans = db.BeginTransaction(); DataSet ds = null; try { ds = db.ExecuteQuery(QUERY_TEST, new string[] { "@CD_STORE", "@NO_POS" }, new object[] { ConfigData.Current.AppConfig.PosInfo.StoreNo, ConfigData.Current.AppConfig.PosInfo.PosNo }, trans); trans.Commit(); } catch (Exception ex) { trans.Rollback(); LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view1 != null) { m_view1.UpdateBSM043TData(ds); } if (m_view2 != null) { m_view2.UpdateTotalCount(ds.Tables[0].Rows.Count); } }
/// <summary> /// 프린트 DCC내용 전체조회 /// </summary> /// <returns></returns> public DataTable GetPrintDccMsg() { DataSet ds = new DataSet(); var masterdb = MasterDbHelper.InitInstance(); try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "M001GetDccMsgSYM051T"), null, null); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } return(ds.Tables[0]); }
/// <summary> /// 계산원확인 /// </summary> /// <returns></returns> bool CheckCasData() { if (txtCasNo.Text.Length == 0) { txtCasNo.SetFocus(); return(false); } var db = MasterDbHelper.InitInstance(); try { string query = Extensions.LoadSqlCommand("POS_SO", "ValidateAdminCas"); m_casDataRow = db.ExecuteQueryDataRow(query, new string[] { "@ID_USER" }, new object[] { txtCasNo.Text }); if (m_casDataRow == null) { m_isError = true; txtCasNo.Text = string.Empty; StatusMessage = MSG_ERR_NO_USER; txtCasNo.SetFocus(); } } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.Dispose(); } return(m_casDataRow != null); }
/// <summary> /// 공지사항 확인 저장 /// </summary> /// <param name="strDD_STRAT">공지시작일</param> /// <param name="iNO_SEQ">순번</param> /// <param name="strDD_END">공지종료일</param> public bool SetNoticeSave(string strDD_STRAT, int iNO_SEQ, string strDD_END) { bool bReturn = true; var transdb = MasterDbHelper.InitInstance(); var trans = transdb.BeginTransaction(); try { transdb.ExecuteNonQuery(Extensions.LoadSqlCommand("POS_SL", "P004SetNoticeBSM131T"), new string[] { "@DD_START", "@NO_SEQ", "@ID_USER", "@DD_END", "@DD_CONF" }, new object[] { strDD_STRAT, iNO_SEQ, ConfigData.Current.AppConfig.PosInfo.CasNo, strDD_END, ConfigData.Current.AppConfig.PosInfo.SaleDate + string.Format("{0:HHmmss}", DateTime.Now) }, trans); trans.Commit(); // UPdate 공지사항상태 UpdateNewNotice(); } catch (Exception ex) { bReturn = false; if (trans != null) { trans.Rollback(); } LogUtils.Instance.LogException(ex); } finally { transdb.EndInstance(); } return(bReturn); }
/// <summary> /// 미회수 사유를 디비에서 가져오기 /// </summary> void LoadNonRtnReasons() { m_nonRtnReasons = new Dictionary <string, string>(); #region 미회수 사유 리스트 가져오기 using (var db = MasterDbHelper.InitInstance()) { var dsCodes = db.ExecuteQuery("SELECT CD_BODY, NM_BODY FROM SYM051T WHERE CD_HEAD = 'GC14' ORDER BY CD_BODY", null, null); foreach (DataRow dr in dsCodes.Tables[0].Rows) { m_nonRtnReasons.Add(dr["CD_BODY"].ToString(), dr["NM_BODY"].ToString()); } } #endregion //m_nonRtnReasons.Add("1", "불응"); //m_nonRtnReasons.Add("2", "기타"); StringBuilder sb = new StringBuilder(); foreach (var key in m_nonRtnReasons.Keys) { sb.AppendFormat("{0}:{1}", key, m_nonRtnReasons[key]); sb.Append(" / "); } lblRtnReason.Text = GP11_RTN_REASON; string rsn = sb.ToString(); if (rsn.Length > 0) { rsn = rsn.Substring(0, rsn.Length - 3); lblRtnReason.Text += rsn; } rsn = null; sb = null; }
/// <summary> /// 행사 출력 문구 조회 /// </summary> /// <param name="strCD_STORE"></param> /// <param name="strYY_PRM"></param> /// <param name="strMM_PRM"></param> /// <param name="strWE_PRM"></param> /// <param name="strSQ_PRM"></param> /// <returns></returns> DataTable GetPRM023T(string strCD_STORE, string strYY_PRM, string strMM_PRM, string strWE_PRM, string strSQ_PRM) { DataSet ds = new DataSet(); var masterdb = MasterDbHelper.InitInstance(); try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "M001GetPRM023T"), new string[] { "@CD_STORE", "@YY_PRM", "@MM_PRM", "@WE_PRM", "@SQ_PRM" }, new object[] { strCD_STORE, strYY_PRM, strMM_PRM, strWE_PRM, strSQ_PRM }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } return(ds.Tables[0]); }
/// <summary> /// 행사 출력(경품) 가능 여부 확인 조회 /// </summary> /// <param name="strCD_STORE"></param> /// <param name="strYY_PRM"></param> /// <param name="strMM_PRM"></param> /// <param name="strWE_PRM"></param> /// <param name="strSQ_PRM"></param> /// <param name="strSQ_PRM_DTL"></param> /// <param name="strTRXN_NO"></param> /// <returns></returns> DataTable GetPRM016T(string strCD_STORE, string strYY_PRM, string strMM_PRM, string strWE_PRM, string strSQ_PRM, string strSQ_PRM_DTL, string strTRXN_NO) { DataSet ds = new DataSet(); var masterdb = MasterDbHelper.InitInstance(); try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "M001GetPRM016T"), new string[] { "@CD_STORE", "@YY_PRM", "@MM_PRM", "@WE_PRM", "@SQ_PRM", "@SQ_PRM_DTL", "@AM_TIME_LIMIT", "@TRXN_NO" }, new object[] { strCD_STORE, strYY_PRM, strMM_PRM, strWE_PRM, strSQ_PRM, strSQ_PRM_DTL, DateTimeUtils.GetTimeString(DateTime.Now).Replace(":", ""), strTRXN_NO }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } return(ds.Tables[0]); }
/// <summary> /// 행사 출력 날짜 확인 /// </summary> /// <returns></returns> DataTable GetPRM010T() { DataSet ds = new DataSet(); var masterdb = MasterDbHelper.InitInstance(); try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "M001GetPRM010T"), new string[] { "@CD_STORE", "@DD_SALE" }, new object[] { ConfigData.Current.AppConfig.PosInfo.StoreNo, ConfigData.Current.AppConfig.PosInfo.SaleDate }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } return(ds.Tables[0]); }
public DataTable GetDccMsg(string strCD_HEAD) { DataSet ds = new DataSet(); var masterdb = MasterDbHelper.InitInstance(); try { ds = masterdb.ExecuteQuery(Extensions.LoadSqlCommand("POS_PY", "P012GetDccMsgSYM051T"), new string[] { "@CD_HEAD" }, new object[] { strCD_HEAD }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } return(ds.Tables[0]); }
/// <summary> /// 영수증 메세지 조회 /// </summary> /// <param name="strStoreNo">점포코드</param> /// <param name="strCdClass">품번코드</param> public DataSet GetReceiptMsg(string strStoreNo, string strCdClass) { DataSet dsMaster = null; var masterdb = MasterDbHelper.InitInstance(); try { string strSql = Extensions.LoadSqlCommand("POS_SL", "M001GetPrintTitleMsg"); strSql += Extensions.LoadSqlCommand("POS_SL", "M001GetPrintMsg"); strSql += Environment.NewLine + " "; strSql += Environment.NewLine + (WSWD.WmallPos.FX.Shared.ConfigData.Current.SysMessage.GetMessage("00260")); strSql += Environment.NewLine + ("SELECT NM_DESC"); strSql += Environment.NewLine + (", FG_SIZ"); strSql += Environment.NewLine + ("FROM BSM042T"); strSql += Environment.NewLine + ("WHERE CD_STORE = @CD_STORE"); strSql += Environment.NewLine + (WSWD.WmallPos.FX.Shared.ConfigData.Current.SysMessage.GetMessage("00261")); strSql += Environment.NewLine + ("AND CD_CLASS IN ("+ strCdClass + ")"); strSql += Environment.NewLine + ("ORDER BY CD_CLASS"); strSql += Environment.NewLine + (", SQ_LOC"); strSql += Environment.NewLine + (";"); dsMaster = masterdb.ExecuteQuery(strSql, new string[] { "@CD_STORE" }, new object[] { strStoreNo }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { masterdb.EndInstance(); } //영수증 메세지 조회 내역 셋팅 return(dsMaster); }
/// <summary> /// 단품, 품번, 품목 조회 /// </summary> /// <param name="strPQ">단품(PQ05), 품번(PQ06), 품목(PQ08) 구분</param> /// <param name="strValue">조회 코드</param> public void GetPQ(string strPQ, string strValue) { var db = MasterDbHelper.InitInstance(); DataSet ds = null; try { string strSql = string.Empty; if (strPQ == "PQ05") { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "P002GetCD_ITEMBSM079T"), new string[] { "@CD_ITEM" }, new object[] { strValue }); } else if (strPQ == "PQ06") { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "P002GetCD_CLASSBSM061T"), new string[] { "@CD_CLASS" }, new object[] { strValue }); } else if (strPQ == "PQ08") { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_SL", "P002GetCD_CTGYBSM100T"), new string[] { "@CD_CTGY" }, new object[] { strValue }); } } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view != null) { //조회결과 셋팅 m_view.SetPQ(strPQ, strValue, ds); } }
public int MaxIndexTable(int floor) { DataSet dsMts = null; int max = 0; var mtsdb = MasterDbHelper.InitInstance(); try { dsMts = mtsdb.ExecuteQuery(Extensions.LoadSqlCommand("CmdTable", "MaxIndexTable"), new string[] { "@Floor" }, new object[] { floor }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { mtsdb.EndInstance(); } if (m_view != null) { if (dsMts != null && dsMts.Tables.Count > 0 && dsMts.Tables[0] != null && dsMts.Tables[0].Rows.Count > 0) { DataRow dr = dsMts.Tables[0].Rows[0]; try { max = Convert.ToInt32(dr["MAX([Index])"]); } catch { } } } return(max); }
/// <summary> /// 메인 공지사항 조회 /// </summary> public void GetNotice() { var db = MasterDbHelper.InitInstance(); DataSet ds = null; try { ds = db.ExecuteQuery(Extensions.LoadSqlCommand("POS_ST", "M002GetNoticeBSM130T"), new string[] { "@DD_SALE" }, new object[] { ConfigData.Current.AppConfig.PosInfo.SaleDate }); } catch (Exception ex) { LogUtils.Instance.LogException(ex); } finally { db.EndInstance(); } if (m_view != null) { //메인 공지사항 셋팅 if (m_view.InvokeRequired) { m_view.BeginInvoke((MethodInvoker) delegate() { m_view.SetNotice(ds); }); } else { m_view.SetNotice(ds); } } }