public List <ViewObjectPropOptSetsModel> GetPropOptSetsViaPropSets(IConnectToDB _Connect, string obj_prop_sets_id)
        {
            ObjectPropOptSets objectpropoptsets = new ObjectPropOptSets();

            DataTable objectpropoptsetsdt;


            if (obj_prop_sets_id.ToLower() == "all")
            {
                objectpropoptsetsdt = objectpropoptsets.FindAll(_Connect);
            }
            else
            {
                objectpropoptsetsdt = objectpropoptsets.FindbyColumnID(_Connect, "obj_prop_sets_id", obj_prop_sets_id);
            }

            List <ViewObjectPropOptSetsModel> ObjectPropOptSetsList = new List <ViewObjectPropOptSetsModel>();

            ViewObjectPropOptSetsModel[] ObjectPropOptSets = new ViewObjectPropOptSetsModel[objectpropoptsetsdt.Rows.Count];

            int i = 0;

            foreach (DataRow datarowdc in objectpropoptsetsdt.Rows)
            {
                ObjectPropOptSets[i] = new ViewObjectPropOptSetsModel
                {
                    dt_available            = datarowdc.Field <DateTime?>("dt_available"),
                    dt_created              = datarowdc.Field <DateTime>("dt_created"),
                    dt_end                  = datarowdc.Field <DateTime?>("dt_end"),
                    enabled                 = datarowdc.Field <string>("enabled"),
                    has_child               = datarowdc.Field <string>("has_child"),
                    has_parent              = datarowdc.Field <string>("has_parent"),
                    obj_prop_opt_sets_id    = datarowdc.Field <long?>("obj_prop_opt_sets_id"),
                    obj_prop_sets_id        = datarowdc.Field <long?>("obj_prop_sets_id"),
                    object_prop_type        = datarowdc.Field <string>("object_prop_type"),
                    object_sets_id          = datarowdc.Field <long?>("object_sets_id"),
                    option_value            = datarowdc.Field <string>("option_value"),
                    option_name             = datarowdc.Field <string>("option_name"),
                    parent_obj_prop_sets_id = datarowdc.Field <long?>("parent_obj_prop_sets_id"),
                    property_name           = datarowdc.Field <string>("property_name"),
                    property_value          = datarowdc.Field <string>("property_value"),
                    value_datatype          = datarowdc.Field <string>("value_datatype")
                };
                //ObjectPropSets[i].stage_name = datarowdc["stage_name"].ToString();
                ObjectPropOptSetsList.Add(ObjectPropOptSets[i]);
                i++;
            }

            return(ObjectPropOptSetsList);
        }
Esempio n. 2
0
        public List <ObjectPropOptSetModels> GetPropOptSetsbyPropSetNID(IConnectToDB _Connect, List <ObjectPropOptSetModels> PropOptSets, ObjectPropSetModels PropSet, int identity_id)
        {
            ObjectPropOptSets PropOptHelper = new ObjectPropOptSets();

            DataTable PropOpt = PropOptHelper.FindbyColumnID(_Connect, "obj_prop_sets_id", PropSet.PropSetView.obj_prop_sets_id.ToString());

            foreach (DataRow PropOptRows in PropOpt.Rows)
            {
                ObjectPropOptSetModels PropOptSet = new ObjectPropOptSetModels();

                PropOptSet.obj_prop_opt_sets_id = PropOptRows.Field <long?>("obj_prop_opt_sets_id");
                PropOptSet.option_value         = PropOptRows.Field <string>("option_value");
                PropOptSet.enabled = PropOptRows.Field <string>("enabled");

                PropOptSets.Add(PropOptSet);
            }

            return(PropOptSets);
        }
Esempio n. 3
0
        public List <ViewObjectPropOptSetsModel> GetPropOptSetsViaPropSets(IConnectToDB _Connect, long?obj_prop_sets_id, string connownername)
        {
            ObjectPropOptSets objectpropoptsets = new ObjectPropOptSets();

            DataTable objectpropoptsetsdt = objectpropoptsets.FindbyColumnID(_Connect, "obj_prop_sets_id", obj_prop_sets_id.ToString());

            List <ViewObjectPropOptSetsModel> ObjectPropOptSetsList = new List <ViewObjectPropOptSetsModel>();

            ViewObjectPropOptSetsModel[] ObjectPropOptSets = new ViewObjectPropOptSetsModel[objectpropoptsetsdt.Rows.Count];

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

                ObjectPropOptSets[i] = JsonConvert.DeserializeObject <ViewObjectPropOptSetsModel>(thisPropOptSet);

                ObjectPropOptSetsList.Add(ObjectPropOptSets[i]);
            }

            return(ObjectPropOptSetsList);
        }