Пример #1
0
        public List <GripModels> GetgripsforStage(IConnectToDB _Connect, List <GripModels> Grips, StageModels Stage, int identity_id)
        {
            GripsHelper griphelper = new GripsHelper();

            DataTable StageGrips = griphelper.FindbyColumnID(_Connect, "Stages_ID", Stage.Stage.stages_id.ToString());

            foreach (DataRow GripRows in StageGrips.Rows)
            {
                GripModels grip = new GripModels();
                grip.gripinfo = new GripModel();

                grip.gripinfo.grips_id      = GripRows.Field <long?>("grips_id");
                grip.gripinfo.grip_name     = GripRows.Field <string>("grip_name");
                grip.gripinfo.grip_type     = GripRows.Field <string>("grip_type");
                grip.gripinfo.stages_id     = GripRows.Field <long?>("stages_id");
                grip.gripinfo.stage_name    = GripRows.Field <string>("stage_name");
                grip.gripinfo.stage_type    = GripRows.Field <string>("stage_type");
                grip.gripinfo.identities_id = GripRows.Field <long?>("identities_id");
                grip.gripinfo.enabled       = GripRows.Field <string>("enabled");
                grip.gripinfo.dt_created    = GripRows.Field <DateTime>("dt_created");
                grip.gripinfo.dt_available  = GripRows.Field <DateTime?>("dt_available");

                grip.ObjectSets = GetSetsbyGripNID(_Connect, new List <ObjectSetModels>(), grip, identity_id);

                Grips.Add(grip);
            }

            return(Grips);
        }
Пример #2
0
        public GripModels SingleGripView(ViewGripModel Stage, DataRow _DR)
        {
            DataTable thisAppDT = new DataRow[] { _DR }.CopyToDataTable();
            string    thisAppRow = new JObject(thisAppDT.Columns.Cast <DataColumn>()
                                               .Select(c => new JProperty(c.ColumnName, JToken.FromObject(thisAppDT.Rows[0][c])))
                                               ).ToString(Formatting.None);

            ViewGripModel GripModel = JsonConvert.DeserializeObject <ViewGripModel>(thisAppRow);

            GripModels GM = new GripModels {
                GripView = GripModel
            };

            return(GM);
        }
Пример #3
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);
        }
Пример #4
0
        public List <GripModels> GetGrips(IConnectToDB _Connect, StageModels Stage, Boolean _GetObjectSets, Boolean _GetPropertySets, Boolean _GetOptionProperties)
        {
            List <GripModels> GripModels = new List <GripModels>();

            DataTable _DT = FindbyColumnID(_Connect, "stages_id", Stage.StageView.stages_id.ToString());

            foreach (DataRow AppStageRow in _DT.Rows)
            {
                GripModels GripModel1 = new GripModels();
                GripModel1 = SingleGripView(new ViewGripModel(), AppStageRow);

                if (_GetObjectSets)
                {
                    ObjectSetsHelper OSH = new ObjectSetsHelper();
                    GripModel1.ObjectSets = OSH.GetSets(_Connect, GripModel1, _GetPropertySets, _GetOptionProperties);
                }


                GripModels.Add(GripModel1);
            }

            return(GripModels);
        }
Пример #5
0
        public List <ObjectSetModels> GetSetsbyGripNID(IConnectToDB _Connect, List <ObjectSetModels> Sets, GripModels Grip, int identity_id)
        {
            ObjectSetsHelper SetsHelper = new ObjectSetsHelper();

            DataTable ObjectSetsDT = SetsHelper.FindbyColumnID(_Connect, "Grips_ID", Grip.gripinfo.grips_id.ToString());

            foreach (DataRow SetRows in ObjectSetsDT.Rows)
            {
                ObjectSetModels Set = new ObjectSetModels();
                Set.SetView = new ViewObjectSetModel();

                Set.SetView.object_sets_id = SetRows.Field <long?>("object_sets_id");
                Set.SetView.dt_created     = SetRows.Field <DateTime>("dt_created");
                Set.SetView.dt_available   = SetRows.Field <DateTime?>("dt_available");
                Set.SetView.dt_end         = SetRows.Field <DateTime?>("dt_end");

                Set.ObjectPropSets = GetPropSetsbySetNID(_Connect, new List <ObjectPropSetModels>(), Set, identity_id);

                Sets.Add(Set);
            }

            return(Sets);
        }