コード例 #1
0
        public string DeclineLot(LotView lot)
        {
            var    mapper = new MapperConfiguration(cfg => cfg.CreateMap <LotView, LotDTO>()).CreateMapper();
            LotDTO lotDTO = mapper.Map <LotView, LotDTO>(lot);

            return(service.DeclineLot(lotDTO));
        }
コード例 #2
0
ファイル: UIFloorPainter.cs プロジェクト: RHY3756547/FreeSO
        public UIFloorPainter(VM vm, LotView.World world, UILotControl parent, List<int> parameters)
        {
            Pattern = (ushort)parameters[0];

            this.vm = vm;
            World = parent.World;
            Parent = parent;

            Commands = new List<VMArchitectureCommand>();
        }
コード例 #3
0
        public IHttpActionResult EditLot(LotView lotView)
        {
            if (!ModelState.IsValid)
            {
                throw new ValidationException("Model non valid");
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap <LotView, LotDTO>()).CreateMapper();
            var lot    = mapper.Map <LotView, LotDTO>(lotView);

            service.EditLot(lot);
            return(Ok());
        }
コード例 #4
0
 public LotView Get(int id)
 {
     try
     {
         var     mapper  = new MapperConfiguration(cfg => cfg.CreateMap <LotDTO, LotView>()).CreateMapper();
         LotView lotView = mapper.Map <LotDTO, LotView>(service.Get(id));
         return(lotView);
     }
     catch (Exception)
     {
         return(null);
     }
 }
コード例 #5
0
ファイル: UIWallPainter.cs プロジェクト: Daribon/FreeSO
        public UIWallPainter(VM vm, LotView.World world, UILotControl parent, List<int> parameters)
        {
            Pattern = (ushort)parameters[0];

            this.vm = vm;
            World = parent.World;
            Parent = parent;
            WallCursor = vm.Context.CreateObjectInstance(0x00000439, LotTilePos.OUT_OF_WORLD, FSO.LotView.Model.Direction.NORTH, true);

            ((ObjectComponent)WallCursor.Objects[0].WorldUI).ForceDynamic = true;
            Commands = new List<VMArchitectureCommand>();

            SetCursorGraphic(2);
        }
コード例 #6
0
        public ActionResult ExportSwbin(string lotID, string code, string defect, string qty, string failRate, string isPassed, string limited, string orderBy, bool desc = false)
        {
            int     recordCount    = 0;
            LotView lotViewByLotID = LotService.GetLotViewByLotID(lotID);

            if (StringHelper.isNullOrEmpty(orderBy))
            {
                orderBy = "Code";
            }
            desc = false;
            string        xlsName     = "LOT_" + lotViewByLotID.LotNO + "_SWBin";
            IList <SWBin> tList       = LotService.GetSWBinsBy(lotID, code, defect, qty, failRate, isPassed, limited, orderBy, desc, 0, 0x1869f, out recordCount);
            string        nextUrl     = Exporthelper.GetExport <SWBin>("SW Bin", tList, "/Export/Excels/Swbins/", "/Content/Exports/ExportSwbins.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
コード例 #7
0
ファイル: UIWallPlacer.cs プロジェクト: RHY3756547/FreeSO
        public UIWallPlacer(VM vm, LotView.World world, UILotControl parent, List<int> parameters)
        {
            Pattern = (ushort)parameters[0];
            Style = (ushort)parameters[1];
            if (Style == 1)
            {
                DrawPattern = 255;
                DrawStyle = 255;
            } else
            {
                DrawPattern = Pattern;
                DrawStyle = Style;
            }

            this.vm = vm;
            World = parent.World;
            Parent = parent;
            WallCursor = vm.Context.CreateObjectInstance(0x00000439, LotTilePos.OUT_OF_WORLD, FSO.LotView.Model.Direction.NORTH, true);

            ((ObjectComponent)WallCursor.Objects[0].WorldUI).ForceDynamic = true;
        }
コード例 #8
0
        public ActionResult mDetailsIndex()
        {
            string lotID = base.Request.QueryString["LotID"];

            if (o__0.p__0 == null)
            {
                CSharpArgumentInfo[] argumentInfo = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                o__0.p__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Title", typeof(DetailsController), argumentInfo));
            }
            o__0.p__0.Target(o__0.p__0, base.ViewBag, "Details");
            LotView lotViewByLotID = LotService.GetLotViewByLotID(lotID);

            NotificationService.ClearCommentNotificationByUserIDAndLotID(BaseController.CurrentUserInfo.UserID, lotID);
            int             recordCount = 0;
            IList <Comment> list        = LotService.GetCommentsByLotID(lotID, "OtherBinDispose", false, 0, 0x270f, out recordCount);

            if ((list != null) && (list.Count > 0))
            {
                if (o__0.p__1 == null)
                {
                    CSharpArgumentInfo[] infoArray2 = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                    o__0.p__1 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OtherBinDisposeCommentExist", typeof(DetailsController), infoArray2));
                }
                o__0.p__1.Target(o__0.p__1, base.ViewBag, true);
            }
            else
            {
                if (o__0.p__2 == null)
                {
                    CSharpArgumentInfo[] infoArray3 = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) };
                    o__0.p__2 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OtherBinDisposeCommentExist", typeof(DetailsController), infoArray3));
                }
                o__0.p__2.Target(o__0.p__2, base.ViewBag, false);
            }
            return(base.View(lotViewByLotID));
        }
コード例 #9
0
ファイル: VMContext.cs プロジェクト: Daribon/FreeSO
        public VMContext(LotView.World world)
        {
            this.World = world;
            this.Clock = new VMClock();
            this.Ambience = new VMAmbientSound();

            RandomSeed = (ulong)((new Random()).NextDouble() * UInt64.MaxValue); //when resuming state, this should be set.
            Clock.TicksPerMinute = 30; //1 minute per irl second

            AddPrimitive(new VMPrimitiveRegistration(new VMSleep())
            {
                Opcode = 0,
                Name = "sleep",
                OperandModel = typeof(VMSleepOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMGenericTSOCall())
            {
                Opcode = 1,
                Name = "generic_sims_online_call",
                OperandModel = typeof(VMGenericTSOCallOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMExpression())
            {
                Opcode = 2,
                Name = "expression",
                OperandModel = typeof(VMExpressionOperand)
            });

            //TODO: Report Metric

            AddPrimitive(new VMPrimitiveRegistration(new VMGrab())
            {
                Opcode = 4,
                Name = "grab",
                OperandModel = typeof(VMGrabOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMDrop())
            {
                Opcode = 5,
                Name = "drop",
                OperandModel = typeof(VMDropOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMChangeSuitOrAccessory())
            {
                Opcode = 6,
                Name = "change_suit_or_accessory",
                OperandModel = typeof(VMChangeSuitOrAccessoryOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRefresh())
            {
                Opcode = 7,
                Name = "refresh",
                OperandModel = typeof(VMRefreshOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRandomNumber())
            {
                Opcode = 8,
                Name = "random_number",
                OperandModel = typeof(VMRandomNumberOperand)
            });

            //TODO: burn

            //Sims 1.0 tutorial

            AddPrimitive(new VMPrimitiveRegistration(new VMGetDistanceTo())
            {
                Opcode = 11,
                Name = "get_distance_to",
                OperandModel = typeof(VMGetDistanceToOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMGetDirectionTo())
            {
                Opcode = 12,
                Name = "get_direction_to",
                OperandModel = typeof(VMGetDirectionToOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMPushInteraction())
            {
                Opcode = 13,
                Name = "push_interaction",
                OperandModel = typeof(VMPushInteractionOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMFindBestObjectForFunction())
            {
                Opcode = 14,
                Name = "find_best_object_for_function",
                OperandModel = typeof(VMFindBestObjectForFunctionOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMBreakPoint())
            {
                Opcode = 15,
                Name = "breakpoint",
                OperandModel = typeof(VMBreakPointOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMFindLocationFor())
            {
                Opcode = 16,
                Name = "find_location_for",
                OperandModel = typeof(VMFindLocationForOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMIdleForInput())
            {
                Opcode = 17,
                Name = "idle_for_input",
                OperandModel = typeof(VMIdleForInputOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRemoveObjectInstance())
            {
                Opcode = 18,
                Name = "remove_object_instance",
                OperandModel = typeof(VMRemoveObjectInstanceOperand)
            });

            //Make new character

            AddPrimitive(new VMPrimitiveRegistration(new VMRunFunctionalTree())
            {
                Opcode = 20,
                Name = "run_functional_tree",
                OperandModel = typeof(VMRunFunctionalTreeOperand)
            });

            //Show string: may be used but no functional result.

            AddPrimitive(new VMPrimitiveRegistration(new VMLookTowards())
            {
                Opcode = 22,
                Name = "look_towards",
                OperandModel = typeof(VMLookTowardsOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMPlaySound())
            {
                Opcode = 23,
                Name = "play_sound",
                OperandModel = typeof(VMPlaySoundOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRelationship())
            {
                Opcode = 24,
                Name = "old_relationship",
                OperandModel = typeof(VMOldRelationshipOperand) //same primitive, different operand
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMTransferFunds())
            {
                Opcode = 25,
                Name = "transfer_funds",
                OperandModel = typeof(VMTransferFundsOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRelationship())
            {
                Opcode = 26,
                Name = "relationship",
                OperandModel = typeof(VMRelationshipOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMGotoRelativePosition())
            {
                Opcode = 27,
                Name = "goto_relative",
                OperandModel = typeof(VMGotoRelativePositionOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMRunTreeByName())
            {
                Opcode = 28,
                Name = "run_tree_by_name",
                OperandModel = typeof(VMRunTreeByNameOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMSetMotiveChange())
            {
                Opcode = 29,
                Name = "set_motive_deltas",
                OperandModel = typeof(VMSetMotiveChangeOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMSysLog())
            {
                Opcode = 30,
                Name = "syslog",
                OperandModel = typeof(VMSysLogOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMSetToNext())
            {
                Opcode = 31,
                Name = "set_to_next",
                OperandModel = typeof(VMSetToNextOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMTestObjectType())
            {
                Opcode = 32,
                Name = "test_object_type",
                OperandModel = typeof(VMTestObjectTypeOperand)
            });

            //TODO: find 5 worst motives

            //TODO: ui effect (used?)

            AddPrimitive(new VMPrimitiveRegistration(new VMSpecialEffect())
            {
                Opcode = 35,
                Name = "special_effect",
                OperandModel = typeof(VMSpecialEffectOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMDialogPrivateStrings())
            {
                Opcode = 36,
                Name = "dialog_private",
                OperandModel = typeof(VMDialogOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMTestSimInteractingWith())
            {
                Opcode = 37,
                Name = "test_sim_interacting_with",
                OperandModel = typeof(VMTestSimInteractingWithOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMDialogGlobalStrings())
            {
                Opcode = 38,
                Name = "dialog_global",
                OperandModel = typeof(VMDialogOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMDialogSemiGlobalStrings())
            {
                Opcode = 39,
                Name = "dialog_semiglobal",
                OperandModel = typeof(VMDialogOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMOnlineJobsCall())
            {
                Opcode = 40,
                Name = "online_jobs_call",
                OperandModel = typeof(VMOnlineJobsCallOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMSetBalloonHeadline())
            {
                Opcode = 41,
                Name = "set_balloon_headline",
                OperandModel = typeof(VMSetBalloonHeadlineOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMCreateObjectInstance())
            {
                Opcode = 42,
                Name = "create_object_instance",
                OperandModel = typeof(VMCreateObjectInstanceOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMDropOnto())
            {
                Opcode = 43,
                Name = "drop_onto",
                OperandModel = typeof(VMDropOntoOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMAnimateSim()) {
                Opcode = 44,
                Name = "animate",
                OperandModel = typeof(VMAnimateSimOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMGotoRoutingSlot())
            {
                Opcode = 45,
                Name = "goto_routing_slot",
                OperandModel = typeof(VMGotoRoutingSlotOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMSnap()) //not functional right now
            {
                Opcode = 46,
                Name = "snap",
                OperandModel = typeof(VMSnapOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMReach())
            {
                Opcode = 47,
                Name = "reach",
                OperandModel = typeof(VMReachOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMStopAllSounds())
            {
                Opcode = 48,
                Name = "stop_all_sounds",
                OperandModel = typeof(VMStopAllSoundsOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMNotifyOutOfIdle())
            {
                Opcode = 49,
                Name = "stackobj_notify_out_of_idle",
                OperandModel = typeof(VMAnimateSimOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMChangeActionString())
            {
                Opcode = 50,
                Name = "change_action_string",
                OperandModel = typeof(VMChangeActionStringOperand)
            });

            //lots of unused primitives. see http://simantics.wikidot.com/wiki:primitives

            //TODO: Send Maxis Letter

            AddPrimitive(new VMPrimitiveRegistration(new VMInvokePlugin())
            {
                Opcode = 62,
                Name = "invoke_plugin",
                OperandModel = typeof(VMInvokePluginOperand)
            });

            AddPrimitive(new VMPrimitiveRegistration(new VMGetTerrainInfo())
            {
                Opcode = 63,
                Name = "get_terrain_info",
                OperandModel = typeof(VMGetTerrainInfoOperand)
            });

            //UNUSED: Leave Lot and Goto

            AddPrimitive(new VMPrimitiveRegistration(new VMFindBestAction())
            {
                Opcode = 65,
                Name = "find_best_action",
                OperandModel = typeof(VMFindBestActionOperand)
            });

            //TODO: Set Dynamic Object Name

            //TODO: Inventory Operations
        }
コード例 #10
0
ファイル: VMWorldActivator.cs プロジェクト: RHY3756547/FreeSO
 public VMWorldActivator(VM vm, LotView.World world)
 {
     this.VM = vm;
     this.World = world;
 }
コード例 #11
0
ファイル: VMContext.cs プロジェクト: RHY3756547/FreeSO
 public VMContext(LotView.World world)
     : this(world, null)
 {
 }
コード例 #12
0
ファイル: UILotControl.cs プロジェクト: RHY3756547/FreeSO
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 0;
            QueryPanel.Y = -114;
            //this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            RMBCursor = GetTexture(0x24B00000001); //exploreanchor.bmp

            vm.OnChatEvent += Vm_OnChatEvent;
            vm.OnDialog += vm_OnDialog;
            vm.OnBreakpoint += Vm_OnBreakpoint;

            Cheats = new UICheatHandler(this);
            EODs = new UIEODController(this);
        }
コード例 #13
0
 public Dictionary <string, object> GetLots(LotView lot)
 {
     return(DBMgr.GetLots(lot));
 }
コード例 #14
0
ファイル: UIQueryPanel.cs プロジェクト: Daribon/FreeSO
        public UIQueryPanel(LotView.World world)
        {
            World = world;
            Active = false;
            Opacity = 0;
            Visible = false;

            AdStrings = new string[14];
            for (int i = 0; i < 14; i++)
            {
                string str = GameFacade.Strings.GetString("206", (i + 4).ToString());
                AdStrings[i] = ((i<7)?str.Substring(0,str.Length-2)+"{0}":str) + "\r\n";
            }

            var script = this.RenderScript("querypanel"+((GlobalSettings.Default.GraphicsWidth < 1024)?"":"1024")+".uis");

            //NOTE: the background and position of this element changes with the context it is used in.
            //other elements that are only used for certain modes will be flagged as such with comments.

            QuerybackPanel = new UIImage(BackgroundImagePanel);
            QuerybackPanel.Y = 0;
            QuerybackPanel.BlockInput();
            this.AddAt(0, QuerybackPanel);

            QuerybackCatalog = new UIImage(BackgroundImageCatalog);
            QuerybackCatalog.Position = new Vector2(-22, 0);
            QuerybackCatalog.BlockInput();
            this.AddAt(1, QuerybackCatalog);

            QuerybackTrade = new UIImage(BackgroundImageTrade);
            QuerybackTrade.Y = 0;
            QuerybackTrade.BlockInput();
            this.AddAt(2, QuerybackTrade);

            //init general tab specific backgrounds

            DescriptionBackgroundImage = new UIImage(ImageDescriptionBackground);
            DescriptionBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2(119, 7);
            this.AddAt(3, DescriptionBackgroundImage);

            MotivesBackgroundImage = new UIImage(ImageMotivesBackground);
            MotivesBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2((GlobalSettings.Default.GraphicsWidth < 1024)?395:619, 7);
            this.AddAt(3, MotivesBackgroundImage);

            GeneralTabImage = new UIImage(ImageGeneralTab);
            GeneralTabImage.Position = new Microsoft.Xna.Framework.Vector2((GlobalSettings.Default.GraphicsWidth < 1024) ? 563 : 787, 0);
            this.AddAt(3, GeneralTabImage);

            SpecificTabImage = new UIImage(ImageSpecificTab);
            SpecificTabImage.Position = new Microsoft.Xna.Framework.Vector2((GlobalSettings.Default.GraphicsWidth < 1024) ? 563 : 787, 0);
            this.AddAt(3, SpecificTabImage);

            OwnerPriceBack = new UIImage(GeneralOwnerPriceBack);
            OwnerPriceBack.Position = new Microsoft.Xna.Framework.Vector2((GlobalSettings.Default.GraphicsWidth < 1024) ? 501 : 725, 80);
            this.AddAt(3, OwnerPriceBack);

            Thumbnail = new UIImage();
            Thumbnail.Position = new Vector2(24, 11);
            Thumbnail.SetSize(90, 90);
            this.Add(Thumbnail);

            DescriptionText.CurrentText = "No Object Selected"; //user should not see this.
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionText.AttachSlider(DescriptionSlider);

            MotivesText.CurrentText = "";
            MotivesSlider.AttachButtons(MotivesScrollUpButton, MotivesScrollDownButton, 1);
            MotivesText.AttachSlider(MotivesSlider);

            GeneralTabButton.OnButtonClick += new ButtonClickDelegate(GeneralTabButton_OnButtonClick);
            SpecificTabButton.OnButtonClick += new ButtonClickDelegate(SpecificTabButton_OnButtonClick);
            SellBackButton.OnButtonClick += new ButtonClickDelegate(SellBackButton_OnButtonClick);

            Mode = 1;
            Tab = 0;
        }
コード例 #15
0
        public Dictionary <string, object> GetLots(LotView _lot)
        {
            List <Lot> lots    = new List <Lot>();
            string     message = "";
            bool       success = false;

            MySqlConnection conn = new MySqlConnection(connStr);

            try
            {
                conn.Open();

                MySqlCommand cmd = new MySqlCommand();

                cmd.Connection  = conn;
                cmd.CommandText = "select * from lots where 1 ";

                if (_lot.lot_id != 0)
                {
                    cmd.CommandText += string.Format("and lot_id = '{0}' ", _lot.lot_id);
                }
                if (!string.IsNullOrEmpty(_lot.location))
                {
                    cmd.CommandText += string.Format("and location = '{0}' ", _lot.location);
                }
                if (!string.IsNullOrEmpty(_lot.status))
                {
                    cmd.CommandText += string.Format("and status = '{0}' ", _lot.status);
                }
                if (!string.IsNullOrEmpty(_lot.facultyOnly))
                {
                    cmd.CommandText += string.Format("and facultyOnly = '{0}' ", _lot.facultyOnly);
                }

                MySqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        Lot lot = new Lot();

                        lot.lot_id      = dr.GetInt16(0);
                        lot.location    = dr.GetString(1);
                        lot.status      = dr.GetString(2);
                        lot.facultyOnly = dr.GetString(3);

                        lots.Add(lot);
                    }
                }

                dr.Close();
                dr.Dispose();

                conn.Close();
                conn.Dispose();

                success = true;
            }
            catch (MySqlException e)
            {
                message = e.ToString();
            }

            return(new Dictionary <string, object>()
            {
                { "Success", success },
                { "Message", message },
                { "Data", new  { lots = lots.ToArray() } }
            });
        }
コード例 #16
0
ファイル: UIObjectHolder.cs プロジェクト: RHY3756547/FreeSO
 public UIObjectHolder(VM vm, LotView.World World, UILotControl parent)
 {
     this.vm = vm;
     this.World = World;
     ParentControl = parent;
 }
コード例 #17
0
ファイル: UILotControl.cs プロジェクト: Daribon/FreeSO
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);
            testimg = new UIImage();
            testimg.X = 20;
            testimg.Y = 20;
            this.Add(testimg);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 177;
            QueryPanel.Y = GlobalSettings.Default.GraphicsHeight - 228;
            this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            vm.OnDialog += vm_OnDialog;
        }