Esempio n. 1
0
        public void ReplaceQueryPlaceHolder(QueryClass paQueryClass)
        {
            UserRow lcUserRow;

            if (paQueryClass != null)
            {
                if (ApplicationFrame.GetInstance().ActiveSessionController.User.IsLoggedIn)
                {
                    paQueryClass.ReplacePlaceHolder("$USERID", ApplicationFrame.GetInstance().ActiveSessionController.User.ActiveRow.UserID.ToString(), true);
                }

                paQueryClass.ReplaceRowPlaceHolder(ApplicationFrame.GetInstance().ActiveSubscription.ActiveRow.Row);
                paQueryClass.ReplaceRowPlaceHolder(ApplicationFrame.GetInstance().ActiveEservice.ActiveRow.Row);

                if ((lcUserRow = ApplicationFrame.GetInstance().ActiveSessionController.User.ActiveRow) == null)
                {
                    lcUserRow = new UserRow(TableManager.GetInstance().GetNewRow(TableManager.TableType.User, true));
                }

                paQueryClass.ReplaceRowPlaceHolder(lcUserRow.Row);

                paQueryClass.ReplacePlaceHolder("$ACTIVELANGUAGE", ApplicationFrame.GetInstance().ActiveSubscription.ActiveSetting.Language, true);

                paQueryClass.ReplaceDictionaryPlaceHolder(clFormParam, false);
            }
        }
Esempio n. 2
0
        private DataTable RetrieveInputInfoList(String paDataGroup)
        {
            QueryClass lcQuery;

            lcQuery = new QueryClass(QueryClass.QueryType.RetrieveInputInfo);
            lcQuery.ReplacePlaceHolder("$ESERVICEID", clEServiceID, true);
            lcQuery.ReplacePlaceHolder("$INPUTGROUP", paDataGroup, true);

            return(lcQuery.RunQuery());
        }
Esempio n. 3
0
        public void UpdateSessionAccessInfo()
        {
            QueryClass lcQuery;

            lcQuery = new QueryClass(QueryClass.QueryType.UpdateSessionAccessInfo);
            lcQuery.ReplacePlaceHolder("$SUBSCRIPTIONID", ActiveRow.SubscriptionID, true);
            lcQuery.ReplacePlaceHolder("$LASTACCESSTIME", General.ConvertUTCToSystemLocalTime(DateTime.UtcNow).ToString("yyyy-MM-dd HH:mm:ss"), true);
            lcQuery.ReplacePlaceHolder("$LOGINID", ActiveRow.LoginID, true);

            lcQuery.ExecuteNonQuery();
        }
Esempio n. 4
0
        private DataTable RetrieveMessageList()
        {
            QueryClass lcQuery;

            lcQuery = new QueryClass(QueryClass.QueryType.RetrieveMessageList);
            lcQuery.ReplacePlaceHolder("$LANGUAGE", ApplicationFrame.GetInstance().ActiveSubscription.ActiveLanguage.ActiveRow.Language.ToLower(), true);
            lcQuery.ReplacePlaceHolder("$FORMNAME", clFormInfoManager.ActiveRow.FormName, true);
            clFormInfoManager.ReplaceQueryPlaceHolder(lcQuery);

            return(lcQuery.RunQuery());
        }
Esempio n. 5
0
        public bool UpdateOrderInfoRemark(String paOrderRemark)
        {
            QueryClass lcQueryClass;

            lcQueryClass = new QueryClass(QueryClass.QueryType.UpdateOrderInfoRemark);
            lcQueryClass.ReplacePlaceHolder("$ORDERNO", clOrderNo.ToString(), false);
            lcQueryClass.ReplacePlaceHolder("$ORDERREMARK", paOrderRemark, true);
            lcQueryClass.ReplacePlaceHolder("$SUBSCRIPTIONID", ApplicationFrame.GetInstance().ActiveSubscription.ActiveRow.SubscriptionID, true);

            lcQueryClass.ExecuteNonQuery();

            return(true);
        }
Esempio n. 6
0
        protected static SessionRow GetSessionRow(String paSubscriptionID, String paLoginID)
        {
            QueryClass lcQuery;
            DataTable  lcDataTable;

            lcQuery = new QueryClass(QueryClass.QueryType.GetSessionRow);
            lcQuery.ReplacePlaceHolder("$SUBSCRIPTIONID", paSubscriptionID, true);
            lcQuery.ReplacePlaceHolder("$LOGINID", paLoginID, true);

            if (((lcDataTable = lcQuery.RunQuery()) != null) && (lcDataTable.Rows.Count > 0))
            {
                return(new SessionRow(lcDataTable.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 7
0
        private bool UpdatDataRecord(Dictionary <String, String> paActiveDataList)
        {
            QueryClass lcQuery;

            try
            {
                lcQuery = new QueryClass(clUpdateQuery, clConnectionMode);
                lcQuery.ReplaceDictionaryPlaceHolder(paActiveDataList);
                lcQuery.ReplacePlaceHolder("$COLUMNLIST", "N\'(" + paActiveDataList.GetData(ctKEYDataColumnList) + ")\'", false);
                lcQuery.ReplacePlaceHolder("$VALUELIST", BuildSQLValueString(paActiveDataList, ctKEYDataColumnList, ctComma), false);
                lcQuery.ReplacePlaceHolder("$UPDATEDATASTRING", BuildSQLColumnValueString(paActiveDataList, ctKEYDataColumnList, ctComma), false);
                lcQuery.ReplacePlaceHolder("$CONDITIONSTRING", BuildSQLColumnValueString(paActiveDataList, ctKEYKeyColumnList, " And "), false);

                return(lcQuery.ExecuteNonQuery() > 0);
            }
            catch (Exception paException)
            {
                General.WriteExceptionLog(paException, "UPDATEDATA : " + ApplicationFrame.GetInstance().ActiveSubscription.ActiveRow.SubscriptionID);
                return(false);
            }
        }
Esempio n. 8
0
        private AppManifestRow GetAppManifestRow(String paSubscriptionID)
        {
            DataTable  lcDataTable;
            QueryClass lcQuery;

            lcQuery = new QueryClass(QueryClass.QueryType.GetAppManifestRow);
            lcQuery.ReplacePlaceHolder("$SUBSCRIPTIONID", paSubscriptionID, true);

            if (((lcDataTable = lcQuery.RunQuery()) != null) && (lcDataTable.Rows.Count > 0))
            {
                return(new AppManifestRow(lcDataTable.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 9
0
        protected static SessionRow GetSessionRow(String paSessionKey)
        {
            QueryClass lcQuery;
            DataTable  lcDataTable;

            lcQuery = new QueryClass(QueryClass.QueryType.GetSessionRowBySessionKey);
            lcQuery.ReplacePlaceHolder("$SESSIONKEY", paSessionKey, true);

            if (((lcDataTable = lcQuery.RunQuery()) != null) && (lcDataTable.Rows.Count > 0))
            {
                return(new SessionRow(lcDataTable.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 10
0
        static private FormInfoRow GetFormInfoRow(String paFormName)
        {
            QueryClass lcQuery;
            DataTable  lcDataTable;

            lcQuery = new QueryClass(QueryClass.QueryType.GetFormInfoRow);
            lcQuery.ReplacePlaceHolder("$FORMNAME", paFormName, true);

            if (((lcDataTable = lcQuery.RunQuery()) != null) && (lcDataTable.Rows.Count > 0))
            {
                return(new FormInfoRow(lcDataTable.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 11
0
        private void ChooseQuery(QueryType paQueryType)
        {
            switch (paQueryType)
            {
            case QueryType.GetPOSReceiptRow: clQueryClass = new QueryClass(ctGetPOSReceiptRow, clConnectionMode); break;

            case QueryType.GetPOSLastReceiptNo: clQueryClass = new QueryClass(ctGetPOSLastReceiptNo, clConnectionMode); break;

            case QueryType.GetPOSStakeHolderRowByStakeHolderID: clQueryClass = new QueryClass(ctGetPOSStakeHolderRowByStakeHolderID, clConnectionMode); break;

            case QueryType.GetPOSStakeHolderRowByCodeNo: clQueryClass = new QueryClass(ctGetPOSStakeHolderRowByCodeNo, clConnectionMode); break;

            case QueryType.POSUpdateReceipt: clQueryClass = new QueryClass(ctPOSUpdateReceipt, clConnectionMode); break;
            }

            clQueryClass.ReplacePlaceHolder("$SUBSCRIPTIONID", ApplicationFrame.GetInstance().ActiveSubscription.ActiveRow.SubscriptionID, true);
        }
Esempio n. 12
0
        public bool UpdateData()
        {
            String     lcPlaceHolder;
            String     lcValue;
            QueryClass lcMasterQuery;
            QueryClass lcQueryClass;

            lcQueryClass  = null;
            lcMasterQuery = null;

            try
            {
                for (int lcCount = 0; lcCount < clDataList.Length; lcCount++)
                {
                    lcQueryClass = new QueryClass(clUpdateQuery, clConnectionMode);
                    ApplicationFrame.GetInstance().ActiveFormInfoManager.ReplaceQueryPlaceHolder(lcQueryClass);

                    foreach (dynamic lcKey in clDataList[lcCount].Keys)
                    {
                        lcPlaceHolder = "$" + lcKey.ToUpper();
                        lcValue       = Convert.ToString(clDataList[lcCount][lcKey]);

                        lcQueryClass.ReplacePlaceHolder(lcPlaceHolder, lcValue, true);
                    }

                    if (lcMasterQuery == null)
                    {
                        lcMasterQuery = lcQueryClass;
                    }
                    else
                    {
                        lcMasterQuery.SetInnerQuery(lcQueryClass);
                    }
                }

                lcMasterQuery.ExecuteNonQueryChain();
                return(true);
            }
            catch (Exception paException)
            {
                General.WriteExceptionLog(paException, "DATALISTUPDATE : " + ApplicationFrame.GetInstance().ActiveSubscription.ActiveRow.SubscriptionID);
                return(false);
            }
        }