Exemple #1
0
        //TODO remove this function later
        private void InsertDispatch(Models.DispatchModel dispatchModel, BLL.UserProfile user)
        {
            List <Models.DispatchDetailModel> commodities = GetSelectedCommodities(dispatchModel.JSONInsertedCommodities);

            dispatchModel.DispatchDetails = commodities;
            _transactionService.SaveDispatchTransaction(dispatchModel, user);
        }
Exemple #2
0
        public JsonResult Rectangle(double x1, double y1, double x2, double y2)
        {
            var module = new MapModule(CurrentUser);
            var items  = module.RectangleSelect(x1, y1, x2, y2);
            var data   = new Models.DispatchModel
            {
                groups = items.GroupBy(t => t.ptp).Select(t => new DispatchGroupModel
                {
                    items = t.Select(x => new GroupItemModel
                    {
                        name    = x.officer.Name,
                        orgName = x.org.Name,
                        site    = new Pointer {
                            x = x.station.Lon, y = x.station.Lat
                        }
                    }).ToArray(),
                    name = t.Key.Name
                }).ToArray()
            };

            return(Json(new { code = 0, msg = "Ok", data = data }));
        }