Beispiel #1
0
        public IActionResult Eb_EmailBuilder()
        {
            ViewBag.Header = "New Email Template";

            ViewBag.VersionNumber  = 1;
            ViewBag.Obj_id         = null;
            ViewBag.Refid          = null;
            ViewBag.IsNew          = "true";
            ViewBag.EditorHint     = "CodeMirror.hint.sql";
            ViewBag.EditorMode     = "text/x-sql";
            ViewBag.Icon           = "fa fa-database";
            ViewBag.ObjType        = (int)EbObjectType.EmailBuilder;
            ViewBag.ObjectName     = "*Untitled";
            ViewBag.FilterDialogId = "null";

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

            Context2Js _jsResult = new Context2Js(typeArray, BuilderType.EmailBuilder, typeof(EbEmailTemplateBase));

            ViewBag.Meta          = _jsResult.AllMetas;
            ViewBag.JsObjects     = _jsResult.JsObjects;
            ViewBag.EbObjectTypes = _jsResult.EbObjectTypes;

            return(View());
        }
        public IActionResult dv(string refid, string rowData, string filterValues, int tabNum)
        {
            //string objid, EbObjectType objtype
            ViewBag.ServiceUrl = this.ServiceClient.BaseUri;

            User _user = this.Redis.Get <User>(string.Format("{0}-{1}-{2}", ViewBag.cid, ViewBag.email, ViewBag.wc));

            ViewBag.user = _user;

            var        typeArray = typeof(EbDataVisualizationObject).GetTypeInfo().Assembly.GetTypes();
            Context2Js _jsResult = new Context2Js(typeArray, BuilderType.DVBuilder, typeof(EbDataVisualizationObject));

            ViewBag.Meta         = _jsResult.AllMetas;
            ViewBag.JsObjects    = _jsResult.JsObjects;
            ViewBag.EbObjectType = _jsResult.EbObjectTypes;

            var resultlist = this.ServiceClient.Get <EbObjectWithRelatedDVResponse>(new EbObjectWithRelatedDVRequest {
                Refid = refid
            });
            var dsobj = resultlist.Dsobj;

            dsobj.AfterRedisGet(this.Redis);
            ViewBag.dvObject     = dsobj;
            ViewBag.dvRefId      = refid;
            ViewBag.rowData      = rowData;
            ViewBag.filterValues = filterValues;
            ViewBag.tabNum       = tabNum;
            ViewBag.DvList       = JsonConvert.SerializeObject(resultlist.DvList);

            return(View());
        }
Beispiel #3
0
        public IActionResult Eb_EmailBuilder(string Htmlcode)
        {
            ViewBag.Header = "Edit Email";
            var req    = this.HttpContext.Request.Form;
            int obj_id = Convert.ToInt32(req["objid"]);

            ViewBag.Obj_id = Convert.ToInt32(req["objid"]);
            var resultlist = this.ServiceClient.Get <EbObjectExploreObjectResponse>(new EbObjectExploreObjectRequest {
                Id = obj_id
            });
            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)EbObjectType.EmailBuilder;
                ViewBag.Refid         = element.RefId;
                ViewBag.Majorv        = element.Dashboard_Tiles.MajorVersionNumber;
                ViewBag.Minorv        = element.Dashboard_Tiles.MinorVersionNumber;
                ViewBag.Patchv        = element.Dashboard_Tiles.PatchVersionNumber;
                if (String.IsNullOrEmpty(element.Json_wc) && !String.IsNullOrEmpty(element.Json_lc))
                {
                    ViewBag.ReadOnly = true;
                    var dsobj = EbSerializers.Json_Deserialize <EbEmailTemplate>(element.Json_lc);
                    ViewBag.dsobj = dsobj;
                    ViewBag.html  = dsobj.Body;
                }
                else
                {
                    ViewBag.ReadOnly = false;
                    var dsobj = EbSerializers.Json_Deserialize <EbEmailTemplate>(element.Json_wc);
                    ViewBag.dsobj = dsobj;
                    ViewBag.html  = dsobj.Body;
                }
                var typeArray = typeof(EbEmailTemplateBase).GetTypeInfo().Assembly.GetTypes();

                Context2Js _jsResult = new Context2Js(typeArray, BuilderType.EmailBuilder, typeof(EbEmailTemplateBase));

                ViewBag.Meta          = _jsResult.AllMetas;
                ViewBag.JsObjects     = _jsResult.JsObjects;
                ViewBag.EbObjectTypes = _jsResult.EbObjectTypes;
            }
            return(View());
        }
Beispiel #4
0
        public EbToolbox(BuilderType _builderType)
        {
            var typeArray = this.GetType().GetTypeInfo().Assembly.GetTypes();

            //var _jsResult = CSharpToJs.GenerateJs<EbControl>(_builderType, typeArray);
            var _c2js = new Context2Js(typeArray, _builderType, typeof(EbControl));

            System.Console.WriteLine("-------------> Time take for Context2Js: " + _c2js.MilliSeconds.ToString());

            this.AllMetas            = _c2js.AllMetas;
            this.AllControlls        = _c2js.JsObjects;
            this.html                = _c2js.ToolBoxHtml;
            this.TypeRegister        = _c2js.TypeRegister;
            this.JsonToJsObjectFuncs = _c2js.JsonToJsObjectFuncs;
            this.EbObjectTypes       = _c2js.EbObjectTypes;
        }
        public EbToolbox(BuilderType _builderType)
        {
            Type[] _typeArray = (this.GetType().GetTypeInfo().Assembly.GetTypes());
            Type[] typeArray  = new Type[_typeArray.Length + 1];
            _typeArray.CopyTo(typeArray, 0);
            typeArray[_typeArray.Length] = typeof(EbValidator);

            //var _jsResult = CSharpToJs.GenerateJs<EbControl>(_builderType, typeArray);
            Context2Js _c2js = new Context2Js(typeArray, _builderType, typeof(EbObject));

            System.Console.WriteLine("-------------> Time take for Context2Js: " + _c2js.MilliSeconds.ToString());

            this.AllMetas            = _c2js.AllMetas;
            this.AllControlls        = _c2js.JsObjects;
            this.ToolsHtml           = _c2js.ToolsHtml;
            this.TypeRegister        = _c2js.TypeRegister;
            this.JsonToJsObjectFuncs = _c2js.JsonToJsObjectFuncs;
            this.EbObjectTypes       = _c2js.EbObjectTypes;
            this.EbOnChangeUIfns     = _c2js.EbOnChangeUIfns;
        }
Beispiel #6
0
        public IActionResult Index(string objid, int objtype)
        {
            dynamic    dsobj = null;
            Context2Js _c2js = new Context2Js();

            ViewBag.ServiceUrl = this.ServiceClient.BaseUri;
            var type = (EbObjectType)(objtype);

            if (objid != "null")
            {
                ViewBag.Obj_id = objid;
                var resultlist = this.ServiceClient.Get <EbObjectExploreObjectResponse>(new EbObjectExploreObjectRequest {
                    Id = Convert.ToInt32(objid)
                });
                var rlist = resultlist.Data;
                foreach (var element in rlist)
                {
                    ViewBag.IsNew          = "false";
                    ViewBag.ObjectName     = element.Name;
                    ViewBag.ObjectDesc     = element.Description;
                    ViewBag.Status         = element.Status;
                    ViewBag.VersionNumber  = element.VersionNumber;
                    ViewBag.ObjType        = objtype;
                    ViewBag.Refid          = element.RefId;
                    ViewBag.Majorv         = element.Dashboard_Tiles.MajorVersionNumber;
                    ViewBag.Tags           = element.Tags;
                    ViewBag.AppId          = element.AppId;
                    ViewBag.DashboardTiles = element.Dashboard_Tiles;

                    if (String.IsNullOrEmpty(element.Json_wc) && !String.IsNullOrEmpty(element.Json_lc))
                    {
                        ViewBag.ReadOnly    = true;
                        dsobj               = EbSerializers.Json_Deserialize(element.Json_lc);
                        ViewBag.dsObj       = dsobj;
                        dsobj.Status        = element.Status;
                        dsobj.VersionNumber = element.VersionNumber;
                        ViewBag.Workingcopy = element.Wc_All;
                    }
                    else if (String.IsNullOrEmpty(element.Json_lc) && !String.IsNullOrEmpty(element.Json_wc))
                    {
                        ViewBag.ReadOnly    = false;
                        dsobj               = EbSerializers.Json_Deserialize(element.Json_wc);
                        ViewBag.dsObj       = dsobj;
                        dsobj.Status        = element.Status;
                        dsobj.VersionNumber = element.VersionNumber;
                        ViewBag.Workingcopy = element.Wc_All;
                    }
                }
            }
            else
            {
                ViewBag.IsNew          = "true";
                ViewBag.Refid          = string.Empty;
                ViewBag.ObjectName     = "*Untitled";
                ViewBag.Status         = string.Empty;
                ViewBag.ObjectDesc     = string.Empty;
                ViewBag.ReadOnly       = false;
                ViewBag.ObjType        = objtype;
                ViewBag.Majorv         = 0;
                ViewBag.Workingcopy    = new string[0];
                ViewBag.Tags           = string.Empty;
                ViewBag.AppId          = 0;
                ViewBag.DashboardTiles = null;
                ViewBag.VersionNumber  = "1.0.0.w";
            }
            if (type == EbObjectType.DataSource)
            {
                var typeArray = typeof(EbDatasourceMain).GetTypeInfo().Assembly.GetTypes();
                _c2js = new Context2Js(typeArray, BuilderType.DataSource, typeof(EbDatasourceMain));
                //_jsResult = CSharpToJs.GenerateJs<EbDatasourceMain>(BuilderType.DataSource, typeArray);
                if (dsobj != null)
                {
                    dsobj.AfterRedisGet(this.Redis);
                    ViewBag.dsObj = dsobj;
                }
            }
            else if (type == EbObjectType.TableVisualization || type == EbObjectType.ChartVisualization)
            {
                var typeArray = typeof(EbDataVisualizationObject).GetTypeInfo().Assembly.GetTypes();
                _c2js = new Context2Js(typeArray, BuilderType.DVBuilder, typeof(EbDataVisualizationObject));
                if (dsobj != null)
                {
                    dsobj.AfterRedisGet(this.Redis);
                    ViewBag.dsObj = dsobj;
                }
            }
            else if (type == EbObjectType.Report)
            {
                var typeArray = typeof(EbReportObject).GetTypeInfo().Assembly.GetTypes();
                _c2js = new Context2Js(typeArray, BuilderType.Report, typeof(EbReportObject));
            }
            else if (type == EbObjectType.EmailBuilder)
            {
                var typeArray = typeof(EbEmailTemplateBase).GetTypeInfo().Assembly.GetTypes();
                _c2js = new Context2Js(typeArray, BuilderType.EmailBuilder, typeof(EbEmailTemplateBase));
                if (dsobj != null)
                {
                    dsobj.AfterRedisGet(this.Redis);
                    ViewBag.dsObj = dsobj;
                }
            }

            ViewBag.Meta          = _c2js.AllMetas;
            ViewBag.JsObjects     = _c2js.JsObjects;
            ViewBag.EbObjectTypes = _c2js.EbObjectTypes;

            return(View());
        }
Beispiel #7
0
        public IActionResult dv(string refid)
        {
            //string objid, EbObjectType objtype
            ViewBag.ServiceUrl = this.ServiceClient.BaseUri;

            User _user = this.Redis.Get <User>(string.Format("{0}-{1}-{2}", ViewBag.cid, ViewBag.email, ViewBag.wc));

            ViewBag.user = _user;

            var        typeArray = typeof(EbDataVisualizationObject).GetTypeInfo().Assembly.GetTypes();
            Context2Js _jsResult = new Context2Js(typeArray, BuilderType.DVBuilder, typeof(EbDataVisualizationObject));

            ViewBag.Meta         = _jsResult.AllMetas;
            ViewBag.JsObjects    = _jsResult.JsObjects;
            ViewBag.EbObjectType = _jsResult.EbObjectTypes;

            var resultlist = this.ServiceClient.Get <EbObjectParticularVersionResponse>(new EbObjectParticularVersionRequest {
                RefId = refid
            });
            var dsobj = EbSerializers.Json_Deserialize(resultlist.Data[0].Json);

            dsobj.Status        = resultlist.Data[0].Status;
            dsobj.VersionNumber = resultlist.Data[0].VersionNumber;
            dsobj.AfterRedisGet(this.Redis);
            ViewBag.dvObject = dsobj;

            {
                //Edit mode
                //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;
                //            dsobj = EbSerializers.Json_Deserialize(element.Json_lc);
                //        }
                //        else
                //        {
                //            ViewBag.ReadOnly = false;
                //            dsobj = EbSerializers.Json_Deserialize(element.Json_wc);
                //        }

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

                //}
            }

            return(View());
        }