コード例 #1
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public virtual ActionResult Index()
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;
            if (anmalan == null)
            {
                anmalan = new AnmalanModel();
                PrismaServiceClient client = new PrismaServiceClient();

                var request = new RequestMessageGetAllZones();
                var response = client.GetAllZones(request);
                anmalan.ZoneList = new List<Zone>(response.Zones);

                anmalan.BuildingList = new List<Building>();

                anmalan.FloorList = new List<Floor>();
                anmalan.RoomList = new List<Room>();

                var actions = client.GetAllWORequestActions();
                anmalan.ActionList = new List<ActionEntity>(actions);
                client.Close();

                anmalan.WRDescription = "";
            }

            TempData["anmalan"] = anmalan;
            return View(anmalan);
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public ActionResult SelectedActionChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.SelectedActionCode = incomingAnmalan.SelectedActionCode;

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public ActionResult DescriptionChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.WRDescription = incomingAnmalan.WRDescription;

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public ActionResult IndexSave(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            PrismaServiceClient client = new PrismaServiceClient();
            WorkRequest workRequest = new WorkRequest
            {
                BuildingCode = anmalan.SelectedBuildingCode,
                CreatedBy = Environment.UserName,
                Description = anmalan.WRDescription,
                FloorCode = anmalan.SelectedFloorCode,
                RoomCode = anmalan.SelectedRoomCode,
                WOActionCode = anmalan.SelectedActionCode,
                Telephone = anmalan.TelephoneNumber
            };

            client.PutWorkRequest(workRequest);
            client.Close();

            return RedirectToAction("WorkRequestView");
        }
コード例 #5
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public ActionResult SelectedBuildingChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            if (incomingAnmalan.SelectedBuildingCode == null)
            {
                anmalan.SelectedBuildingCode = null;

                anmalan.FloorList = new List<Floor>();
                anmalan.SelectedFloorCode = null;

                anmalan.RoomList = new List<Room>();
                anmalan.SelectedRoomCode = null;
            }
            else
            {
                anmalan.SelectedBuildingCode = incomingAnmalan.SelectedBuildingCode;

                PrismaServiceClient client = new PrismaServiceClient();
                RequestMessageGetFloors request = new RequestMessageGetFloors();
                request.BuildingCode = anmalan.SelectedBuildingCode;

                //Floor
                var response = client.GetFloors(request);
                var floors = response.Floors;
                anmalan.FloorList = new List<Floor>(floors);
                anmalan.SelectedFloorCode = null;

                //Room
                anmalan.RoomList = new List<Room>();
                anmalan.SelectedRoomCode = null;

                client.Close();
            }

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: KristerH/TestRepo
        public ActionResult TelephoneChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.TelephoneNumber = incomingAnmalan.TelephoneNumber;

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }