Пример #1
0
        public IActionResult EbObjectList(EbObjectType type)
        {
            ViewBag.EbObjectType = (int)type;

            IServiceClient client = this.ServiceClient;

            var resultlist = client.Get <EbObjectListResponse>(new EbObjectListRequest {
                EbObjectType = (int)type
            });
            var rlist = resultlist.Data;

            Dictionary <int, EbObjectWrapper> ObjList = new Dictionary <int, EbObjectWrapper>();

            foreach (var element in rlist)
            {
                if (element.EbObjectType == type)
                {
                    ObjList[element.Id] = element;
                }
            }

            ViewBag.Objlist = ObjList;

            if (ViewBag.isAjaxCall)
            {
                return(PartialView());
            }
            else
            {
                return(View());
            }
        }
Пример #2
0
        public string getdv(string refid, EbObjectType objtype)
        {
            EbDataVisualization dsobj = null;

            if (refid != null)
            {
                var resultlist = this.ServiceClient.Get <EbObjectParticularVersionResponse>(new EbObjectParticularVersionRequest {
                    RefId = refid
                });
                dsobj               = EbSerializers.Json_Deserialize(resultlist.Data[0].Json);
                dsobj.Status        = resultlist.Data[0].Status;
                dsobj.VersionNumber = resultlist.Data[0].VersionNumber;
            }
            return(EbSerializers.Json_Serialize(dsobj));
        }
Пример #3
0
        public string GetObjectList(EbObjectType type)
        {
            IServiceClient client = this.ServiceClient;

            var resultlist = client.Get <EbObjectListResponse>(new EbObjectListRequest {
                EbObjectType = (int)type
            });
            var rlist = resultlist.Data;

            Dictionary <int, EbObjectWrapper> ObjList = new Dictionary <int, EbObjectWrapper>();
            var html = string.Empty;

            foreach (var element in rlist)
            {
                html += @"<a href='../Eb_Object/Index?objid=" + element.Id + @"&objtype=" + (int)type + @"'>
                <div class='col-md-6 objitems' name='objBox'>
                    <div class='col-md-1 obj-icon'>
                        <div class='obj-ic-cir'>
                            <i class='fa fa-file-text' aria-hidden='true'></i>
                        </div>
                    </div>
                    <div class='col-md-10'>
                        <h4 name='head4' style='color:black;'>" + element.Name + @"</h4>
                        <p class='text-justify'>" + element.Description + @"</p>
                        <a id='labels'>
                            <span name='Version' class='label label-default'>v " + element.VersionNumber + @"</span>
                            <span name='Application' class='label objbox-label'>" + type + @"</span>
                        </a>
                    </div>
                    <div class='col-md-1 objbox-footer'>
                        <input type='button' class='btn fa-input fa-lg' value='&#xf054;' style='font-family: FontAwesome;background: transparent;'>
                    </div>
                </div></a>";
            }
            return(html);
        }
Пример #4
0
        public Dictionary <string, List <EbObjectWrapper> > FetchAllDataVisualizations(EbObjectType type)
        {
            var resultlist = this.ServiceClient.Get <EbObjectObjListAllVerResponse>(new EbObjectObjLisAllVerRequest {
                EbObjectType = Convert.ToInt32(type)
            });
            var ObjDVListAll = resultlist.Data;

            return(ObjDVListAll);
        }
Пример #5
0
        public IActionResult dvChart(string objid, EbObjectType objtype)
        {
            ViewBag.ServiceUrl = this.ServiceClient.BaseUri;

            var typeArray = typeof(EbDataVisualizationObject).GetTypeInfo().Assembly.GetTypes();

            var _jsResult = CSharpToJs.GenerateJs <EbDataVisualizationObject>(BuilderType.DVBuilder, typeArray);

            ViewBag.Meta         = _jsResult.Meta;
            ViewBag.JsObjects    = _jsResult.JsObjects;
            ViewBag.EbObjectType = _jsResult.EbObjectTypes;
            if (objid != null)
            {
                var resultlist = this.ServiceClient.Get <EbObjectExploreObjectResponse>(new EbObjectExploreObjectRequest {
                    Id = Convert.ToInt32(objid)
                });
                var rlist = resultlist.Data;
                foreach (var element in rlist)
                {
                    ObjectLifeCycleStatus[]      array     = (ObjectLifeCycleStatus[])Enum.GetValues(typeof(ObjectLifeCycleStatus));
                    List <ObjectLifeCycleStatus> lifeCycle = new List <ObjectLifeCycleStatus>(array);
                    ViewBag.LifeCycle     = lifeCycle;
                    ViewBag.IsNew         = "false";
                    ViewBag.ObjectName    = element.Name;
                    ViewBag.ObjectDesc    = element.Description;
                    ViewBag.Status        = element.Status;
                    ViewBag.VersionNumber = element.VersionNumber;
                    ViewBag.Icon          = "fa fa-database";
                    ViewBag.ObjType       = (int)objtype;
                    ViewBag.Refid         = element.RefId;
                    ViewBag.Majorv        = element.Dashboard_Tiles.MajorVersionNumber;
                    ViewBag.Minorv        = element.Dashboard_Tiles.MinorVersionNumber;
                    ViewBag.Patchv        = element.Dashboard_Tiles.PatchVersionNumber;

                    EbDataVisualization dsobj = null;

                    if (String.IsNullOrEmpty(element.Json_wc) && !String.IsNullOrEmpty(element.Json_lc))
                    {
                        ViewBag.ReadOnly = true;
                        if (objtype == EbObjectType.TableVisualization)
                        {
                            dsobj = EbSerializers.Json_Deserialize <EbTableVisualization>(element.Json_lc);
                        }
                        else if (objtype == EbObjectType.ChartVisualization)
                        {
                            dsobj = EbSerializers.Json_Deserialize <EbChartVisualization>(element.Json_lc);
                        }
                    }
                    else
                    {
                        ViewBag.ReadOnly = false;
                        if (objtype == EbObjectType.TableVisualization)
                        {
                            dsobj = EbSerializers.Json_Deserialize <EbTableVisualization>(element.Json_wc);
                        }
                        else if (objtype == EbObjectType.ChartVisualization)
                        {
                            dsobj = EbSerializers.Json_Deserialize <EbChartVisualization>(element.Json_wc);
                        }
                    }

                    dsobj.AfterRedisGet(this.Redis);
                    ViewBag.dvObject = dsobj;
                }
            }

            return(View());
        }