Esempio n. 1
0
        public static CFolder GetSelectedFolder(CRoot root, TreeNode tn)
        {
            ArrayList index = new ArrayList();

            while (tn != null)
            {
                index.Add(tn.Index);
                tn = tn.Parent;
            }

            index.Reverse();

            CFolder ccf = root.Collection[int.Parse(index[1].ToString())][int.Parse(index[2].ToString())];

            index.RemoveAt(0);
            index.RemoveAt(0);
            index.RemoveAt(0);

            for (int j = 0; j < index.Count; j++)
            {
                ccf = ccf.Folders[(int)index[j]];
            }

            return(ccf);
        }
Esempio n. 2
0
        //Constructor:
        public MoviesDAL_Tests()
        {
            string environment     = "test";
            CRoot  CompositionRoot = new CRoot(environment);

            dbReset = new DatabaseReset(environment);

            movies_dal = CompositionRoot.MoviesDAL;
        }
        //Constructor:
        public UsersDAL_Tests()
        {
            string environment     = "test";
            CRoot  CompositionRoot = new CRoot(environment);

            dbReset = new DatabaseReset(environment);

            users_dal = CompositionRoot.UsersDAL;
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            CRoot CompositionRoot = new CRoot("prod");

            //IUsersDAL users_dal = CompositionRoot.UsersDAL;
            //IMoviesDAL movies_dal = CompositionRoot.MoviesDAL;

            IUsersBLL  users_bll  = CompositionRoot.UsersBLL;
            IMoviesBLL movies_bll = CompositionRoot.MoviesBLL;
        }
Esempio n. 5
0
        public static void ConfigWrite()
        {
            CRoot  root        = new CRoot(param, tbobj);
            String xml         = db.CreateXMLString(root);
            String formatedXml = printXML(xml);

            using (StreamWriter writetext = new StreamWriter(cfgName))
            {
                writetext.WriteLine(formatedXml);
            }
        }
Esempio n. 6
0
        protected CTable XmlToCTable()
        {
            Hashtable args    = GetArguments();
            string    infile  = args["infile"].ToString();
            string    basedir = args["basedir"].ToString();

            string[] paths      = { basedir, infile };
            string   importFile = Path.Combine(paths);
            string   xml        = File.ReadAllText(importFile);

            XmlToCTable ds   = new XmlToCTable(xml);
            CRoot       root = ds.Deserialize();
            CTable      t    = root.Data;

            return(t);
        }
Esempio n. 7
0
    public void EventChecker()
    {
        path       = Application.streamingAssetsPath + "/Events/eventHandler.json";
        jsonString = File.ReadAllText(path);
        //Debug.Log(jsonString);
        //Event eventHolder = JsonUtility.FromJson<Event>(jsonString);
        CRoot root = JsonUtility.FromJson <CRoot>(jsonString);
        //Debug.Log(root.events[0].name);
        //string eventstring = eventNames.RandomItem();
        //eventName = root.events[].name;
        //path = Application.streamingAssetsPath + "/Events/gameEvents/event1.json";
        //&& startSecond == true
        //root.events[0].time ="5" &&

        string timetext = time.text;

        int.TryParse(timetext, out timeint);
        foreach (int str in eventIds)
        {
            //Debug.Log(str);
            if (timeint == root.events[str].time)                //To add an event just add the json file and edit the eventHandler
            {
                if (startSecond = true)
                {
                    eventReady = true;
                    path       = Application.streamingAssetsPath + root.events[str].path;
                }
            }
        }

        /*if ( timeint == root.events[0].time ){ //Duplicate this function and change the events[0] to events[3] or whatever number is next, then add event in eventHandler and create event json file
         *      if(startSecond = true){
         *              eventReady = true;
         *              path = Application.streamingAssetsPath + root.events[0].path;
         *      }
         * }
         * if (timeint == root.events[1].time ){
         *      if(startSecond = true){
         *              eventReady = true;
         *              path = Application.streamingAssetsPath + root.events[1].path;
         *      }
         * }*/
    }
Esempio n. 8
0
        public static CTable ConfigRead()
        {
            try
            {
                String xml  = File.ReadAllText(cfgName);
                CRoot  root = db.XMLToRootObject(xml);

                APIResult rs = new APIResult(root, xml, "");

                tbobj = rs.GetResultObject();
                param = rs.GetParamObject();
            }
            catch
            {
                //File not found
                SetUrl("http://wiscon.cloudhost.in.th:88/dbos/dev/mps/mps_pgsql/cgi-bin/dbos_db_api_dispatcher.pl");
                SetKey("1234");
                SetTheme("2");
            }

            return(tbobj);
        }
Esempio n. 9
0
        public static object GetSelectedItem(CRoot root, ListViewItem lvi, bool isfile)
        {
            string[]  temp  = lvi.Name.Split('|');
            ArrayList index = new ArrayList();

            for (int i = 1; i < temp.Length; i++)
            {
                index.Add(int.Parse(temp[i]));
            }

            int index1 = (int)index[1];
            int index2 = (int)index[2];

            CFolder ccf = root.Collection[index1][index2];

            index.RemoveAt(0);
            index.RemoveAt(0);
            index.RemoveAt(0);

            for (int j = 0; j < index.Count; j++)
            {
                if (j == index.Count - 1)
                {
                    if (isfile)
                    {
                        return(ccf.Files[(int)index[j]]);
                    }
                    else
                    {
                        return(ccf.Folders[(int)index[j]]);
                    }
                }
                ccf = ccf.Folders[(int)index[j]];
            }

            return(ccf);
        }
Esempio n. 10
0
        public static bool IsKeyValue(string Key, string UserName)
        {
            if (Key.Length != 37)
            {
                return(false);
            }
            if (Key.ToUpper().IndexOf("DMS") == -1)
            {
                return(false);
            }
            if (Key.Split('-').Length != 3)
            {
                return(false);
            }

            string key1 = Properties.Resources.String1;
            string key2 = Properties.Resources.String2;
            string key3 = Controls.Properties.Resources.String3;
            string key4 = Core.Properties.Resources.String4;

            for (int a = 0; a < 16; a++)
            {
                for (int b = 0; b < 16; b++)
                {
                    for (int c = 0; c < 16; c++)
                    {
                        for (int d = 0; d < 16; d++)
                        {
                            string key = Functions.MD5(key1.Substring(a, 16) + key2.Substring(b, 16) + key3.Substring(c, 16) + key4.Substring(d, 16));

                            string str1 = "";
                            string str2 = "";
                            for (int i = 0; i < key.Length; i++)
                            {
                                if (char.IsNumber(key[i]))
                                {
                                    str1 += key[i].ToString();
                                }
                                else
                                {
                                    str2 += key[i].ToString();
                                }
                            }
                            string str = "dms-" + str1 + "-" + str2;
                            if (str.ToUpper() == Key.ToUpper())
                            {
                                DateTime dt  = DateTime.Now;
                                RegData  reg = new RegData(dt, a, b, c, d, key, UserName);
                                root.RegDate        = dt;
                                root.UserName       = UserName;
                                backuproot.RegDate  = dt;
                                backuproot.UserName = UserName;
                                RegData.Save(reg);
                                CRoot.Save(root);

                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }
Esempio n. 11
0
 public static TreeNode GetNode(CRoot root, TreeNodeCollection tnc)
 {
     return(tnc[tnc.Count]);
 }
        public AdminController()
        {
            CRoot CompositionRoot = new CRoot("prod");

            movies_bll = CompositionRoot.MoviesBLL;
        }
Esempio n. 13
0
        public UsersController()
        {
            CRoot CompositionRoot = new CRoot("prod");

            users_bll = CompositionRoot.UsersBLL;
        }
        //Constructor:
        public AuthenticationController()
        {
            CRoot CompositionRoot = new CRoot("prod");

            users_bll = CompositionRoot.UsersBLL;
        }