Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public ActionResult SelectedActionChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.SelectedActionCode = incomingAnmalan.SelectedActionCode;

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }
Ejemplo n.º 3
0
        public ActionResult DescriptionChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.WRDescription = incomingAnmalan.WRDescription;

            TempData["anmalan"] = anmalan;
            return View("Index", anmalan);
        }
Ejemplo n.º 4
0
        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");
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        public ActionResult TelephoneChanged(AnmalanModel incomingAnmalan)
        {
            AnmalanModel anmalan = TempData["anmalan"] as AnmalanModel;

            anmalan.TelephoneNumber = incomingAnmalan.TelephoneNumber;

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