Beispiel #1
0
        public static CTable CreateUserVariables(CTable u)
        {
            ArrayList original = u.GetChildArray("USER_VARIABLE_ITEM");
            Hashtable hs       = CUtil.CTableArrayToHash(original, "VARIABLE_NAME");

            CTable    t   = new CTable("USER");
            ArrayList arr = new ArrayList();

            t.SetFieldValue("USER_ID", OnixWebServiceAPI.UserID().ToString());

            foreach (String key in variables.Keys)
            {
                CTable orig  = null;
                String value = (String)variables[key];

                //if (key.Contains("REPORT_CASH_IN-TO_ACCOUNT_NO"))
                //{
                //    String s = key;
                //}

                if (hs.ContainsKey(key))
                {
                    orig = (CTable)hs[key];

                    String orgValue = orig.GetFieldValue("VARIABLE_VALUE");
                    if (!value.Equals(orgValue))
                    {
                        orig.SetFieldValue("EXT_FLAG", "E");
                    }
                }
                else
                {
                    orig = new CTable("");
                    orig.SetFieldValue("EXT_FLAG", "A");
                }

                orig.SetFieldValue("VARIABLE_NAME", key);
                orig.SetFieldValue("VARIABLE_VALUE", value);
                arr.Add(orig);
            }

            t.AddChildArray("USER_VARIABLE_ITEM", arr);
            return(t);
        }