Example #1
0
 public void SaveAsync()
 {
     //  Hostel.hostelName = HostelName;
     if (RoomData.areaId == null || RoomData.areaId.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("", "Please Select Area", "OK");
     }
     else if (RoomData.hostelId == null || RoomData.hostelId.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("", "Please Select Hostel", "OK");
     }
     else if (RoomData.blockId == null || RoomData.blockId.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("", "Please Select Block", "OK");
     }
     else if (RoomData.floorId == null || RoomData.floorId.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("", "Please Select Floor", "OK");
     }
     else if (RoomData.name == null || RoomData.name.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("", "Please Enter Room Name", "OK");
     }
     else if (RoomData.bedno == null || RoomData.bedno.Length == 0)
     {
         App.Current.MainPage.DisplayAlert("HMS", "Please Enter No of beds", "OK");
     }
     else
     {
         RoomDataModel roomDataModel = new RoomDataModel();
         roomDataModel.roomName         = RoomData.name;
         roomDataModel.hostelId         = RoomData.hostelId;
         roomDataModel.hostelRoomTypeId = RoomData.hostelRoomTypeId;
         roomDataModel.hostelBlockId    = RoomData.blockId;
         roomDataModel.floorId          = RoomData.floorId;
         roomDataModel.noOfBeds         = RoomData.bedno;
         roomDataModel.userId           = App.userid;
         web.SaveRoomEntry(roomDataModel);
     }
 }