Exemple #1
0
        private int HanldeGridOption(GridOptions gridOptions)
        {
            SetVerboseLevel(gridOptions.VerboseLevel);

            Reporter.ToLog(eLogLevel.INFO, "Starting Ginger Grid at port: " + gridOptions.Port);
            GingerGrid gingerGrid = new GingerGrid(gridOptions.Port);

            gingerGrid.Start();

            if (gridOptions.Tracker)
            {
                ServiceGridTracker serviceGridTracker = new ServiceGridTracker(gingerGrid);
            }

            Console.WriteLine();
            Console.WriteLine("---------------------------------------------------");
            Console.WriteLine("-               Press 'q' exit                    -");
            Console.WriteLine("---------------------------------------------------");

            if (!Console.IsInputRedirected && !WorkSpace.Instance.RunningFromUnitTest)  // for example unit test redirect input, or we can run without input like from Jenkins
            {
                ConsoleKey consoleKey = ConsoleKey.A;
                while (consoleKey != ConsoleKey.Q)
                {
                    ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                    consoleKey = consoleKeyInfo.Key;
                }
            }

            return(0);
        }
    private static Mesh GenerateMeshData(GridOptions opts, Mesh mesh)
    {
        int cols = opts.gridSize.x;
        int rows = opts.gridSize.y;
        float gridSizeX = opts.gridUnitSize.x;
        float gridSizeY = opts.gridUnitSize.y;
        Vector3[] vertices = new Vector3[(cols + 1) * (rows + 1)];
        Vector2[] uvs = new Vector2[vertices.Length];
        Vector4[] tangents = new Vector4[vertices.Length];
        Vector4 staticTangent = new Vector4(1f, 0f, 0f, -1f);

        for (int i = 0, index = 0; i <= cols; i++)
        {
            for (int j = 0; j <= rows; j++, index++)
            {
                float x = j * gridSizeX;
                float y = i * gridSizeY;
                vertices[index] = new Vector3(x, 0, y);
                uvs[index] = new Vector2((float)j / rows, (float)i / cols);
                tangents[index] = staticTangent;
            }
        }
        mesh.vertices = opts.procLevels.Length > 0 ? ApplyPerlinHeights(opts, vertices) : vertices;
        mesh.uv = uvs;
        mesh.tangents = tangents;
        return mesh;
    }
Exemple #3
0
 public JsonResult Listar(GridOptions gridOptions)
 {
     using (var pessoaBo = new PessoaBo())
     {
         return(Json(pessoaBo
                     .Listar()
                     .ToList()
                     .OrderBy(c => c.Nome)
                     .Select
                     (
                         c => new
         {
             c.CodigoPessoa,
             c.Nome,
             DataCadastro = c.DataCadastro.ToString("dd/MM/yyyy HH:mm:ss"),
             c.Endereco,
             c.Bairro,
             Complemento = c.Complemento ?? "",
             Observacao = c.Observacao ?? "",
             c.CodigoCidade,
             Cidade = c.Cidade.Nome
         }
                     ), JsonRequestBehavior.AllowGet));
     }
 }
Exemple #4
0
        public ActionResult GetData3(GridOptions options)
        {
            int skipValue = ((options.Page - 1) * options.Rows);

            using (Repository.BaseballDataContext ctx = new Repository.BaseballDataContext(_connectionString))
            {
                IEnumerable <Repository.BatterDetail>   results;
                Expression <Func <BatterDetail, bool> > predicate;

                if (options.IsSearch)
                {
                    predicate = SearchHelper.CreateSearchPredicate(options);
                }
                else
                {
                    predicate = b => b.yearID > 2005;
                }

                results = ctx.BatterDetails
                          .Where(predicate);

                string dataString = CreateJSONStringForGridData(options, skipValue, results);

                return(Content(dataString, "application/json", System.Text.Encoding.UTF8));
            }
        }
 public DefaultServerGridProcessor(TagHelperContext context, TagHelperOutput output, GridTagHelper tag, GridOptions options, ContextualizedHelpers helpers)
 {
     this.context = context; this.output = output; this.tag = tag;
     this.options = options; this.helpers = helpers;
     basePrefix   = tag.For.Name;
     AdjustColumns();
 }
        public ActionResult Index([ModelBinder(typeof(GridBinder))] GridOptions options, string searchText)
        {
            if (searchText != null)
            {
                options.SearchText = searchText;
                options.Page       = 1;
            }
            else
            {
                options.SearchText = options.SearchText ?? "";
            }

            options.TotalItems = LibraryService.SearchMoviesCount(options.SearchText);

            if (options.SortColumn == null)
            {
                options.SortColumn = "ID";
            }

            var movies = LibraryService.SearchMovies(options.SearchText ?? "",
                                                     (options.Page - 1) * options.ItemsPerPage,
                                                     options.ItemsPerPage,
                                                     options.SortColumn,
                                                     options.SortDirection).ToList();

            var model = new MovieListViewModel
            {
                GridOptions = options,
                Movies      = movies
            };

            return(View(model));
        }
Exemple #7
0
        public GridEntity <BranchDto> GetLocation(GridOptions options)
        {
            string data = string
                          .Format(@"select BRANCHID,BRANCHCODE,BRANCHNAME from Branch");

            return(new Kendo <BranchDto> .Grid(_connection).DataSource(options, data, "BRANCHID"));
        }
        public GridEntity <TallyPointDto> GetTallySummary(GridOptions options)
        {
            string data = string
                          .Format(@"select  DisburseQuantity,OrderedQuantity,DeliveredQuantity,Remarks from TallyPoint;");

            return(new Kendo <TallyPointDto> .Grid(_connection).DataSource(options, data, "DisburseQuantity"));
        }
Exemple #9
0
        static void Main(string[] args)
        {
            var gridOptions = new GridOptions
            {
                Order = new GridOrder
                {
                    OrderBy = "Date.Day",
                    Order   = OrderChoice.Ascending
                },
                Filters = new List <GridFilter>
                {
                    new GridFilter
                    {
                        Field        = "name",
                        FilterMethod = FilterMethods.Equal,
                        Value        = "Name1"
                    }
                }
            };
            var list       = TestModel.CreateElements(10);
            var expression = CSharpScript
                             .EvaluateAsync <Func <TestModel, int> >("x=>x.Value", ScriptOptions.Default.AddReferences(typeof(TestModel).Assembly)).Result;

            //var lista = list.AsQueryable().ApplyDatabaseDataFilters(gridOptions.Filters).ToList();
            var lista = list.AsQueryable().ApplyDatabaseDataOrder(gridOptions.Order).ToList();

            lista.ForEach(x => Console.WriteLine(JsonSerializer.Serialize(x)));
            Console.ReadLine();
        }
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            GridOptions requestOptions = new GridOptions();

            var requestQuery = filterContext.HttpContext.Request.QueryString;

            if (requestQuery.HasKeys())
            {
                GridFilters filterOps    = null;
                string      filterString = requestQuery["filters"];
                if (!String.IsNullOrWhiteSpace(filterString))
                {
                    filterOps = Newtonsoft.Json.JsonConvert.DeserializeObject <GridFilters>(filterString);
                }
                requestOptions.Filters   = filterOps;
                requestOptions.IsSearch  = Boolean.Parse(requestQuery["_search"]);
                requestOptions.ND        = requestQuery["nd"];
                requestOptions.Page      = Int32.Parse(requestQuery["page"]);
                requestOptions.Rows      = Int32.Parse(requestQuery["rows"]);
                requestOptions.SortIndex = requestQuery["sidx"];
                requestOptions.SortOrder = requestQuery["sord"];
            }

            if (filterContext.ActionParameters.ContainsKey("options"))
            {
                filterContext.ActionParameters["options"] = requestOptions;
            }
            else
            {
                filterContext.ActionParameters.Add("options", requestOptions);
            }

            base.OnActionExecuting(filterContext);
        }
Exemple #11
0
        public ActionResult Index([ModelBinder(typeof(GridBinder))] GridOptions options, string searchString, string SearchFranchise)
        {
            options.TotalItems = LibraryService.SearchMoviesCount("");
            if (options.SortColumn == null)
            {
                options.SortColumn = "ID";
            }
            var model = new MovieListViewModel();

            if (!String.IsNullOrEmpty(searchString))
            {
                model.GridOptions = options;
                model.Movies      = LibraryService.SearchMovies(searchString, (options.Page - 1) * options.ItemsPerPage, options.ItemsPerPage, options.SortColumn, options.SortDirection).ToList();
            }
            else if (!String.IsNullOrEmpty(SearchFranchise))
            {
                model.GridOptions = options;
                model.Movies      = LibraryService.SearchMoviesByFranchise(SearchFranchise, (options.Page - 1) * options.ItemsPerPage, options.ItemsPerPage, options.SortColumn, options.SortDirection).ToList();
            }
            else
            {
                model.GridOptions = options;
                model.Movies      = LibraryService.SortMovies((options.Page - 1) * options.ItemsPerPage, options.ItemsPerPage, options.SortColumn, options.SortDirection).ToList();
            }

            return(View(model));
        }
Exemple #12
0
        public ActionResult Grid(GridOptions options)
        {
            var model = new GridModel <Customer>("customer");

            model.Columns.For(c => c.Name, "Name")
            .Title("Name")
            .SortColumn(c => c.Name, System.Web.Helpers.SortDirection.Ascending)
            .HeaderAttributes(new { style = "width:200px" });

            model.Columns.For(c => c.Country, "Country")
            .Title("Country")
            .SortColumn(c => c.Country)
            .GroupColumn(c => c.Country)
            .HeaderAttributes(new { style = "width:100px" });

            model.Columns.For(c => c.City, "City")
            .Title("City")
            .SortColumn(c => c.City)
            .GroupColumn(c => c.City)
            .HeaderAttributes(new { style = "width:91px" });

            model.Columns.For(c => c.Region, "Region")
            .Title("Region")
            .SortColumn(c => c.Region)
            .GroupColumn(c => c.Region, 1)
            .HeaderAttributes(new { style = "width:101px" });

            model.Columns.For(c => c.Code, "Code")
            .Title("Code")
            .SortColumn(c => c.Code)
            .GroupColumn(c => c.Code)
            .HeaderAttributes(new { style = "width:101px" });

            model.Columns.For(c => c.ContactName, "ContactName")
            .Title("ContactName")
            .SortColumn(c => c.ContactName)
            .GroupColumn(c => c.ContactName)
            .HeaderAttributes(new { style = "width:202px" });

            model.Columns.For(c => c.ContactTitle, "ContactTitle")
            .Title("ContactTitle")
            .SortColumn(c => c.ContactTitle)
            .GroupColumn(c => c.ContactTitle)
            .HeaderAttributes(new { style = "width:155px" });

            model.PageSize = 10;

            model.ShowEmptyRows = true;

            model.ShowEmptyRowsInGroup = true;

            model.PageSizeInGroup = 5;

            // model.HierarchyUrl = (customer, url) => url.Action("OrderGrid", "Home", new { customerId = customer.ID });

            var query = customerService.GetAll();

            return(View(new ActionGridView <Customer>(model.Localize(), query).Init(options)));
        }
        public GridEntity <Common_DesignationGroup> GetDesignationGroupSummary(GridOptions options)
        {
            var DesignationGroup = new GridEntity <Common_DesignationGroup>();

            DesignationGroup = KendoGrid <Common_DesignationGroup> .GetGridData_5(options, "sp_Select_DesignationGroup_Grid", "get_DesignationGroup_summary", "DesGroupName");

            return(DesignationGroup);
        }
Exemple #14
0
        public GridEntity <Common_Unit> GetUnitSummary(GridOptions options)
        {
            var Unit = new GridEntity <Common_Unit>();

            Unit = KendoGrid <Common_Unit> .GetGridData_5(options, "sp_Select_Unit_Grid", "get_Unit_summary", "UnitName");

            return(Unit);
        }
Exemple #15
0
        public GridEntity <Color> GetColorInfoSummary(GridOptions options)
        {
            var color = new GridEntity <Color>();

            color = KendoGrid <Color> .GetGridData_5(options, "sp_select_color_grid", "get_color_summary", "ColorId");

            return(color);
        }
        public GridEntity <Common_Designation> GetDesignationSummary(GridOptions options)
        {
            var Designation = new GridEntity <Common_Designation>();

            Designation = KendoGrid <Common_Designation> .GetGridData_5(options, "sp_Select_Designation_Grid", "get_Designation_summary", "DesignationName");

            return(Designation);
        }
        public GridEntity <ProductInformationVm> GetProductInfoSummary(GridOptions options)
        {
            string data = string
                          .Format(@"select ProductId,ProductInformation.ProductName,ProductInformation.ProductCode,Unit.UnitName,Unit.UnitId from ProductInformation
inner join Unit on ProductInformation.UnitId = Unit.UnitId;");

            return(new Kendo <ProductInformationVm> .Grid(_connection).DataSource(options, data, "ProductId"));
        }
Exemple #18
0
        public GridEntity <UsersDto> GetUserSummary(GridOptions options)
        {
            string quary =
                string.Format(@"Select Users.*,di.DealerName,di.DealerId from Users
left join DealerInformation di on di.DealerId=Users.EmployeeId", "");

            return(new Kendo <UsersDto> .Grid(_connection).DataSource(options, quary, " UserName "));
        }
Exemple #19
0
        public GridEntity <R_DeptSection> GetDeptSectionSummary(GridOptions options)
        {
            var Wing = new GridEntity <R_DeptSection>();

            Wing = KendoGrid <R_DeptSection> .GetGridData_5(options, "sp_Select_Unit_Department_Section_Grid", "get_Unit_Department_Section_Summary", "SectionName");

            return(Wing);
        }
Exemple #20
0
        public GridEntity <Common_Wing> GetWingSummary(GridOptions options)
        {
            var Wing = new GridEntity <Common_Wing>();

            Wing = KendoGrid <Common_Wing> .GetGridData_5(options, "sp_Select_Wing_Grid", "get_Wing_summary", "WingName");

            return(Wing);
        }
        public GridEntity <Supplier> GetSupplierInfoSummary(GridOptions options)
        {
            var Supplier = new GridEntity <Supplier>();

            Supplier = KendoGrid <Supplier> .GetGridData_5(options, "sp_select_Supplier_grid", "get_Supplier_summary", "SupplierName");

            return(Supplier);
        }
Exemple #22
0
        public GridEntity <OrderPaymentHistoryDto> GetOrderPaymentHistory(GridOptions options)
        {
            var query = string.Format(@"select ProductOrder.OrderId, ProductOrder.Orderdate,ProductOrder.UnitPrice,ProductOrder.Quantity,ProductOrder.TotalPrice,ProductOrder.PickupDate,
                        ProductOrder.OrderNo,ProductOrder.SOC,PaymentOrder.Amount,PaymentOrder.ChequeDate,PaymentOrder.ChequeNo,PaymentOrder.PaymentDate,PaymentOrder.DepositDate,PaymentOrder.PaymentMethod from ProductOrder 
                        inner join PaymentOrder on ProductOrder.OrderId = PaymentOrder.OrderId");

            return(new Kendo <OrderPaymentHistoryDto> .Grid(_connection).DataSource(options, query, "PaymentDate desc"));
        }
Exemple #23
0
        /// <summary>
        /// Sets a Secure URL to Grid Options
        /// </summary>
        /// <param name="options"></param>
        /// <param name="url"></param>
        /// <param name="method"></param>
        /// <returns></returns>
        public static GridOptions WithSecureUrl(this GridOptions options, string url, string method = "POST")
        {
            options.RequireAuthentication = true;
            options.DataUrl       = url;
            options.RequestMethod = method;

            return(options);
        }
        public GridEntity <Yarn> GetYarnInfoSummary(GridOptions options)
        {
            var yarn = new GridEntity <Yarn>();

            yarn = KendoGrid <Yarn> .GetGridData_5(options, "sp_select_yarn_grid", "get_yarn_summary", "YarnName");

            return(yarn);
        }
Exemple #25
0
        public JsonResult GetMenuPermissionSummary(GridOptions options, string usrId)
        {
            //  User user = ((User)(Session["CurrentUser"]));

            var menuList = _menuRepository.GetMenuPermissionSummary(options, usrId);

            return(Json(menuList, JsonRequestBehavior.AllowGet));
        }
        public GridEntity <DealerInformationVm> GetDealerInfo(GridOptions options)
        {
            string data = string
                          .Format(@"select DealerId,DealerInformation.DealerName,DealerInformation.MobileNo,DealerInformation.EmailAddress,DealerType.DealerTypeName, DealerInformation.Agrementfile,DealerInformation.DealerTypeId,DealerInformation.DealerCode
from DealerInformation inner join DealerType on DealerInformation.DealerTypeId = DealerType.DealerTypeId");

            return(new Kendo <DealerInformationVm> .Grid(_connection).DataSource(options, data, "DealerId"));
        }
Exemple #27
0
        public GridEntity <R_SecWing> GetSectionWingSummary(GridOptions options)
        {
            var Team = new GridEntity <R_SecWing>();

            Team = KendoGrid <R_SecWing> .GetGridData_5(options, "sp_Select_Unit_Department_Section_Team_Grid", "get_Unit_Department_Section_Wing_Summary", "SectionName");

            return(Team);
        }
Exemple #28
0
        public GridEntity <Common_Company> GetCompanySummary(GridOptions options)
        {
            var Company = new GridEntity <Common_Company>();

            Company = KendoGrid <Common_Company> .GetGridData_5(options, "sp_Select_Company_Grid", "get_Company_summary", "CompanyName");

            return(Company);
        }
Exemple #29
0
        public GridEntity <Common_Team> GetTeamSummary(GridOptions options)
        {
            var Team = new GridEntity <Common_Team>();

            Team = KendoGrid <Common_Team> .GetGridData_5(options, "sp_Select_Team_Grid", "get_Team_summary", "TeamName");

            return(Team);
        }
        public GridEntity <Common_Shift> GetShiftSummary(GridOptions options)
        {
            var Shift = new GridEntity <Common_Shift>();

            Shift = KendoGrid <Common_Shift> .GetGridData_5(options, "sp_Select_Shift_Grid", "get_Shift_summary", "ShiftName");

            return(Shift);
        }
 public override void DisplayObjectInGrid(object objectToDisplay, GridOptions options)
 {
     Type lType = objectToDisplay.GetType();
     // If it objectToDisplay is enumerable, get its type argument.
     if (lType.IsGenericType)
     {
         Type lEnumerable = lType.GetInterface("System.Collections.Generic.IEnumerable`1");
         if (lEnumerable != null)
         {
             lType = lEnumerable.GetGenericArguments()[0];
         }
     }
     string[] lIgnore = { "IOptimizedPersistable", "OptimizedPersistable" };
     // Customize only if it is a persistable object.
     // Note: Unluckly IOptimizedPersistable members that have
     // a name overridden by derived class can't be filtered.
     if (lType.GetInterface("IOptimizedPersistable") != null)
     {
         // Keep properties public instance fields and properties
         // that are not defined by IOptimizedPersistable.
         string[] lKeep = SchemaExtractor
             .GetDataMembers(lType)
             .Select(lMember => lMember.Name).ToArray();
         // Select to exclude all members that should not be kept...
         options.MembersToExclude = lType.GetMembers()
             .Select(lMember => lMember.Name)
             .Where(lName => !lKeep.Contains(lName))
             .ToArray();
         // If a OptimizedPersistable (i.e. the type being used is the 
         // same as the object's instead of a element type) 
         // is send to render on grid,
         // an exception is raised because LINQPad assumes to be an
         // enumerable of only one kind, which is not true for
         // OptimizedPersistable. In this case, wrap on a list.
         if(lType.Equals(objectToDisplay.GetType()))
         {
             objectToDisplay = new List<object>() { objectToDisplay };
         }
     }
     // TODO: Some problem with duplicated members.
     // On BI.Model, Customer -> Items -> Items -> PartyRole ->??
     base.DisplayObjectInGrid(objectToDisplay, options);
 }
 public virtual void DisplayObjectInGrid(object objectToDisplay, GridOptions options)
 {
     ExplorerGrid.Display(objectToDisplay, options);
 }