Exemplo n.º 1
0
        /// <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;
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="responseData"></param>
 void pq03Task_TaskCompleted(WSWD.WmallPos.FX.Shared.NetComm.Response.TaskResponseData responseData)
 {
     if (responseData.Response.ResponseState == WSWD.WmallPos.FX.Shared.NetComm.SocketTrxnResType.Success)
     {
         // get casName;
         var data = responseData.DataRecords.ToDataRecords <PQ03RespData>();
         if (data.Length > 0)
         {
             m_casData      = data[0];
             m_view.CasName = m_casData.UserName;
         }
     }
     else if (responseData.Response.ResponseState == WSWD.WmallPos.FX.Shared.NetComm.SocketTrxnResType.NoInfo)
     {
         m_view.UpdateStatusMessage(LoginMessageTypes.NoUserInfo);
     }
     else
     {
         m_view.UpdateStatusMessage(responseData.Response.ErrorMessage);
     }
 }