Example #1
0
        public List <ObjectPropSetModels> GetPropSetsbySetNID(IConnectToDB _Connect, List <ObjectPropSetModels> PropSets, ObjectSetModels ObjSet, int identity_id)
        {
            ObjectPropSetsHelper PropSetHelper = new ObjectPropSetsHelper();

            DataTable PropSetDT = PropSetHelper.FindbyColumnID(_Connect, "Object_Sets_ID", ObjSet.SetView.object_sets_id.ToString());

            foreach (DataRow PropRows in PropSetDT.Rows)
            {
                ObjectPropSetModels PropSet = new ObjectPropSetModels();
                PropSet.PropSetView = new PropSetView();

                PropSet.PropSetView.obj_prop_sets_id        = PropRows.Field <long?>("obj_prop_sets_id");
                PropSet.PropSetView.object_prop_type        = PropRows.Field <string>("object_prop_type");
                PropSet.PropSetView.property_name           = PropRows.Field <string>("property_name");
                PropSet.PropSetView.property_value          = PropRows.Field <string>("property_value");
                PropSet.PropSetView.value_datatype          = PropRows.Field <string>("value_datatype");
                PropSet.PropSetView.has_parent              = PropRows.Field <string>("has_parent");
                PropSet.PropSetView.has_child               = PropRows.Field <string>("has_child");
                PropSet.PropSetView.parent_obj_prop_sets_id = PropRows.Field <long?>("parent_obj_prop_sets_id");

                PropSet.ObjectPropOptSets = GetPropOptSetsbyPropSetNID(_Connect, new List <ObjectPropOptSetModels>(), PropSet, identity_id);

                PropSets.Add(PropSet);
            }
            return(PropSets);
        }
Example #2
0
        public List <ViewObjectPropSetsModel> GetObjectPropSetsViaObjectSet(IConnectToDB _Connect, string object_sets_id)
        {
            //ObjectSets objectsets = new ObjectSets();
            ObjectPropSetsHelper objectpropsets = new ObjectPropSetsHelper();

            DataTable objectpropsetsdt;

            if (object_sets_id.ToLower() == "all")
            {
                objectpropsetsdt = objectpropsets.FindAll(_Connect);
            }
            else
            {
                objectpropsetsdt = objectpropsets.FindbyColumnID(_Connect, "object_sets_id", object_sets_id);
            }

            List <ViewObjectPropSetsModel> ObjectPropSetsList = new List <ViewObjectPropSetsModel>();

            ViewObjectPropSetsModel[] ObjectPropSets = new ViewObjectPropSetsModel[objectpropsetsdt.Rows.Count];

            for (int i = 0; i < objectpropsetsdt.Rows.Count; i++)
            {
                string thisPropSet = new JObject(objectpropsetsdt.Columns.Cast <DataColumn>()
                                                 .Select(c => new JProperty(c.ColumnName, JToken.FromObject(objectpropsetsdt.Rows[i][c])))
                                                 ).ToString(Formatting.None);

                ObjectPropSets[i] = JsonConvert.DeserializeObject <ViewObjectPropSetsModel>(thisPropSet);

                ObjectPropSets[i].ObjectPropOptSets = objectpropsets.GetPropOptSetsViaPropSets(_Connect, ObjectPropSets[i].obj_prop_sets_id.ToString());

                ObjectPropSetsList.Add(ObjectPropSets[i]);
            }

            return(ObjectPropSetsList);
        }
Example #3
0
        public ViewObjectPropFile getFileBytesFromPropID(IConnectToDB _Connect, string objectpropsetid)
        {
            byte[]             bytes = new byte[0];
            ViewObjectPropFile _File = new ViewObjectPropFile();
            int  n;
            bool isNumeric = int.TryParse(objectpropsetid, out n);

            if (isNumeric)
            {
                ER_Query             er_query  = new ER_Query();
                ObjectPropSetModels  opsm      = new ObjectPropSetModels();
                ObjectPropSetsHelper opsHelper = new ObjectPropSetsHelper();

                List <ViewObjectPropFile> _FilesList = opsHelper.FindFiles(_Connect, new List <ViewObjectPropFile>(), objectpropsetid, "object_prop_set");

                foreach (ViewObjectPropFile e in _FilesList)
                {
                    if (e != null)
                    {
                        _File.file_name    = e.file_name;
                        _File.value        = e.value;
                        _File.content_type = e.content_type;
                        //bytes = (byte[])e.file_data;
                    }
                }
            }

            return(_File);
        }
Example #4
0
        public string getFilesFromBytes(IConnectToDB _Connect, string object_id, string object_type)
        {
            ER_Query             er_query  = new ER_Query();
            ObjectPropSetModels  opsm      = new ObjectPropSetModels();
            ObjectPropSetsHelper opsHelper = new ObjectPropSetsHelper();

            List <ViewObjectPropFile> _FilesList = opsHelper.FindFiles(_Connect, new List <ViewObjectPropFile>(), object_id, object_type);

            char[] chars = new char[0];
            foreach (ViewObjectPropFile e in _FilesList)
            {
                if (e != null)
                {
                    byte[] bytes = e.value;
                    chars = new char[bytes.Length / sizeof(char)];
                    System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
                }
            }
            return(new string(chars));
        }
Example #5
0
        public string getStringFromBytesViaObjectProSetid(IConnectToDB _Connect, Guid?objectpropsetid)
        {
            ER_Query             er_query  = new ER_Query();
            ObjectPropSetModels  opsm      = new ObjectPropSetModels();
            ObjectPropSetsHelper opsHelper = new ObjectPropSetsHelper();

            opsm = opsHelper.FindExtras(_Connect, opsm, objectpropsetid);

            char[] chars = new char[0];
            foreach (ViewObjectPropSetFile e in opsm.PropSetView.PropFiles)
            {
                if (e != null)
                {
                    byte[] bytes = e.value;
                    chars = new char[bytes.Length / sizeof(char)];
                    System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
                }
            }

            return(new string(chars));
        }
Example #6
0
        public List <ObjectSetModels> GetSets(IConnectToDB _Connect, GripModels Grip, Boolean _GetPropertySets, Boolean _GetOptionProperties)
        {
            List <ObjectSetModels> Sets = new List <ObjectSetModels>();

            DataTable _DT = FindbyColumnID(_Connect, "grips_id", Grip.GripView.grips_id.ToString());

            foreach (DataRow GripSetRow in _DT.Rows)
            {
                ObjectSetModels Set = new ObjectSetModels();
                Set.SetView = new ViewObjectSetModel();
                Set         = SingleSetView(Set.SetView, GripSetRow);

                if (_GetPropertySets)
                {
                    ObjectPropSetsHelper PSH = new ObjectPropSetsHelper();
                    Set.ObjectPropSets = PSH.GetProps(_Connect, Set, _GetOptionProperties);
                }

                Sets.Add(Set);
            }

            return(Sets);
        }
Example #7
0
        public object FindbyColumnIDs(IConnectToDB _Connect, string objectlayer, string _column, List <string> _ids)
        {
            DataTable        dt = new DataTable();
            DictionaryHelper dictionary;

            switch (objectlayer.ToLower())
            {
            case "object":
            case "objects":
                ObjectsHelper objects = new ObjectsHelper();
                dt = objects.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "identity":
            case "identities":
            case "id":
                IdentityHelper identity = new IdentityHelper();
                dt = identity.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "core":
            case "cores":
                CoreHelper core = new CoreHelper();
                dt = core.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "application":
            case "applications":
                AppHelper application = new AppHelper();
                dt = application.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "stage":
            case "stages":
                StagesHelper stages = new StagesHelper();
                dt = stages.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "grip":
            case "grips":
                GripsHelper grips = new GripsHelper();
                dt = grips.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "objectset":
            case "objectsets":
                ObjectSetsHelper objectsets = new ObjectSetsHelper();
                dt = objectsets.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "objectpropset":
            case "objectpropsets":
                ObjectPropSetsHelper objectpropsets = new ObjectPropSetsHelper();
                dt = objectpropsets.FindbyColumnIDs(_Connect, _column, _ids);
                break;

            case "tables":
            case "table":
                dictionary = new DictionaryHelper();
                dt         = dictionary.FindbyColumnIDs(_Connect, "tables", _column, _ids);
                break;

            case "views":
            case "view":
                dictionary = new DictionaryHelper();
                dt         = dictionary.FindbyColumnIDs(_Connect, "views", _column, _ids);
                break;

            case "primary":
            case "primary keys":
            case "primary key":
            case "pk":
            case "pkey":
            case "pkeys":
                dictionary = new DictionaryHelper();
                dt         = dictionary.FindbyColumnIDs(_Connect, "pkeys", _column, _ids);
                break;

            case "foreign":
            case "foreign keys":
            case "foreign key":
            case "fk":
            case "fkey":
            case "fkeys":
                dictionary = new DictionaryHelper();
                dt         = dictionary.FindbyColumnIDs(_Connect, "fkeys", _column, _ids);
                break;

            case "unqiue":
            case "unqiue keys":
            case "unqiue key":
            case "uk":
            case "ukey":
            case "ukeys":
                dictionary = new DictionaryHelper();
                dt         = dictionary.FindbyColumnIDs(_Connect, "ukeys", _column, _ids);
                break;
            }

            ConvertData jsonstring = new ConvertData();

            var json = jsonstring.ConvertDataTabletoString(dt);

            var myojb = new object();

            object myObjs = new object();

            switch (objectlayer)
            {
            case "object":
            case "objects":
                myojb = new ViewObjectModel();
                List <ViewObjectModel> myObjsObjects = new List <ViewObjectModel>();
                myObjsObjects = JsonConvert.DeserializeObject <List <ViewObjectModel> >(json);
                myObjs        = myObjsObjects;
                break;

            case "identity":
            case "identities":
            case "id":
                myojb = new ViewIdentityModel();
                List <ViewIdentityModel> myID = new List <ViewIdentityModel>();
                myID   = JsonConvert.DeserializeObject <List <ViewIdentityModel> >(json);
                myObjs = myID;
                break;

            case "core":
            case "cores":
                myojb = new ViewCoreModel();
                List <ViewCoreModel> myObjsCore = new List <ViewCoreModel>();
                myObjsCore = JsonConvert.DeserializeObject <List <ViewCoreModel> >(json);
                myObjs     = myObjsCore;
                break;

            case "application":
            case "applications":
                myojb = new ViewApplicationModel();
                List <ViewApplicationModel> myObjsApplication = new List <ViewApplicationModel>();
                myObjsApplication = JsonConvert.DeserializeObject <List <ViewApplicationModel> >(json);
                myObjs            = myObjsApplication;
                break;

            case "stage":
            case "stages":
                myojb = new ViewStageModel();
                List <ViewStageModel> myObjsStage = new List <ViewStageModel>();
                myObjsStage = JsonConvert.DeserializeObject <List <ViewStageModel> >(json);
                myObjs      = myObjsStage;
                break;

            case "grip":
            case "grips":
                myojb = new ViewGripModel();
                List <ViewGripModel> myObjsGrip = new List <ViewGripModel>();
                myObjsGrip = JsonConvert.DeserializeObject <List <ViewGripModel> >(json);
                myObjs     = myObjsGrip;
                break;

            case "objectset":
            case "objectsets":
                myojb = new ViewObjectSetModel();
                List <ViewObjectSetModel> myObjsObjectSets = new List <ViewObjectSetModel>();
                myObjsObjectSets = JsonConvert.DeserializeObject <List <ViewObjectSetModel> >(json);
                myObjs           = myObjsObjectSets;
                break;

            case "objectpropset":
            case "objectpropsets":
                myojb = new ViewObjectPropSetsModel();
                List <ViewObjectPropSetsModel> myObjsObjectPropSets = new List <ViewObjectPropSetsModel>();
                myObjsObjectPropSets = JsonConvert.DeserializeObject <List <ViewObjectPropSetsModel> >(json);
                myObjs = myObjsObjectPropSets;
                break;

            case "tables":
            case "table":
                myojb = new ViewTablesDictionary();
                List <ViewTablesDictionary> myTableDictionary = new List <ViewTablesDictionary>();
                myTableDictionary = JsonConvert.DeserializeObject <List <ViewTablesDictionary> >(json);
                myObjs            = myTableDictionary;
                break;

            case "views":
            case "view":
                myojb = new ViewViewsDictionary();
                List <ViewViewsDictionary> myViewDictionary = new List <ViewViewsDictionary>();
                myViewDictionary = JsonConvert.DeserializeObject <List <ViewViewsDictionary> >(json);
                myObjs           = myViewDictionary;
                break;

            case "primary":
            case "primary keys":
            case "primary key":
            case "pk":
            case "pkey":
            case "pkeys":
                myojb = new ViewPrimaryKeysDictionary();
                List <ViewPrimaryKeysDictionary> myPKDictionary = new List <ViewPrimaryKeysDictionary>();
                myPKDictionary = JsonConvert.DeserializeObject <List <ViewPrimaryKeysDictionary> >(json);
                myObjs         = myPKDictionary;
                break;

            case "foreign":
            case "foreign keys":
            case "foreign key":
            case "fk":
            case "fkey":
            case "fkeys":
                myojb = new ViewForeignKeysDictionary();
                List <ViewForeignKeysDictionary> myFKDictionary = new List <ViewForeignKeysDictionary>();
                myFKDictionary = JsonConvert.DeserializeObject <List <ViewForeignKeysDictionary> >(json);
                myObjs         = myFKDictionary;
                break;

            case "unqiue":
            case "unqiue keys":
            case "unqiue key":
            case "uk":
            case "ukey":
            case "ukeys":
                myojb = new ViewUniqueKeysDictionary();
                List <ViewUniqueKeysDictionary> myUKDictionary = new List <ViewUniqueKeysDictionary>();
                myUKDictionary = JsonConvert.DeserializeObject <List <ViewUniqueKeysDictionary> >(json);
                myObjs         = myUKDictionary;
                break;

            default:
                List <object> defaultlist = new List <object>();
                defaultlist = null;
                myObjs      = defaultlist;
                break;
            }

            return(myObjs);
        }
Example #8
0
        public string GetRichtextFromBytes(IConnectToDB _Connect, long?forms_id, long?object_prop_sets_id)
        {
            ObjectPropSetsHelper opsHelper = new ObjectPropSetsHelper();

            return(opsHelper.GetRichtextFromBytes(_Connect, forms_id, object_prop_sets_id));
        }
Example #9
0
        public string GetLabelFromBytes(IConnectToDB _Connect, string objectpropsetid)
        {
            ObjectPropSetsHelper opsHelper = new ObjectPropSetsHelper();

            return(opsHelper.GetLabelFromBytes(_Connect, objectpropsetid));
        }