예제 #1
0
        public static FilterModels GetFilterCookie()
        {
            var filterModels = new FilterModels();

            try
            {
                var tableIds = HttpContext.Current.Request.Cookies["ListTableID"];
                if (tableIds != null)
                {
                    var tableIdsDecode = HttpContext.Current.Server.UrlDecode(tableIds.Value);
                    var tableIdsValue  = JsonConvert.DeserializeObject <List <string> >(tableIdsDecode);

                    filterModels.ListTableID = tableIdsValue;
                }
                var printers = HttpContext.Current.Request.Cookies["ListPrinter"];
                if (printers != null)
                {
                    var printersDecode = HttpContext.Current.Server.UrlDecode(printers.Value);
                    var printersValue  = JsonConvert.DeserializeObject <List <string> >(printersDecode);

                    filterModels.ListPrinter = printersValue;
                }
                var floors = HttpContext.Current.Request.Cookies["ListFloorID"];
                if (floors != null)
                {
                    var floorsDecode = HttpContext.Current.Server.UrlDecode(floors.Value);
                    var floorsValue  = JsonConvert.DeserializeObject <List <string> >(floorsDecode);

                    filterModels.ListFloorID = floorsValue;
                }

                var types = HttpContext.Current.Request.Cookies["Type"];
                if (types != null)
                {
                    var typesDecode = HttpContext.Current.Server.UrlDecode(types.Value);
                    var typesValue  = JsonConvert.DeserializeObject <List <int> >(typesDecode);

                    filterModels.Type = typesValue;
                }
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("GetFilterCookie error", ex);
            }
            return(filterModels);
        }
예제 #2
0
 public FeatureFilterAndWeightModelAnalysis(SpaceModel spaceModel, List <FeatureWeightModel> wm, List <FeatureFilter> fm)
 {
     space = spaceModel.Clone();
     WeightModels.AddRange(wm);
     FilterModels.AddRange(fm);
 }