static void Main(string[] args) { var client = new RoomServiceClient(); /* try * { * client.AddClassForGroup(new Class * { * ClassName = "QQQQ", * IsLecture = false, * IsLowerWeek = null, * Room = new Room {RoomNumber = 0, BuildingId = 12}, * StartTime = "13:00", * Weekday = Weekday.Tuesday, * Teacher = new Teacher {LastName = "Shashkov"}, * Groups = new[] * { * new Group * { * GroupId = 8401, * Direction = Direction.PMI * } * }, * }); * } * finally * { */GenerateTimesheet(client); // } }
protected void Page_Load(object sender, EventArgs e) { String id = Request.Params["Id"]; if (id != null) { StaffServiceClient staffServiceClient = new StaffServiceClient(); Staff staff = staffServiceClient.QueryStaff(Int32.Parse(id)); RoomServiceClient roomServiceClient = new RoomServiceClient(); Room room = roomServiceClient.QueryRoom(staff.Room); ZipcodeServiceClient zipcodeServiceClient = new ZipcodeServiceClient(); Zipcode zipcode = zipcodeServiceClient.QueryZipcode(room.Zipcode); GeolocationServiceClient geolocationServiceClient = new GeolocationServiceClient(); String location = geolocationServiceClient.GetCountry(staff.IpAddress); td_Id.InnerText = staff.Id.ToString(); td_Name.InnerText = staff.Name; td_LastName.InnerText = staff.LastName; td_Room.InnerText = staff.Room; td_Zipcode.InnerText = room.Zipcode; td_Street.InnerText = zipcode.Street; td_City.InnerText = zipcode.City; td_ipAddress.InnerText = staff.IpAddress; td_location.InnerText = location; geolocationServiceClient.Close(); zipcodeServiceClient.Close(); roomServiceClient.Close(); staffServiceClient.Close(); } }
public Server() { roomServicePort = int.Parse(System.Configuration.ConfigurationManager.AppSettings["RoomServicePort"]); roomClient = new RoomServiceClient(roomCallback, ip, roomServicePort); roomClient.AudioServiceLogin(ip, port); roomClient.AudioServiceLogOff(); }
private async void OnReserveRoom(object sender, EventArgs e) { try { roomReservice = new RoomReservaton(); roomReservice.RoomName = this.txtRoom.Text; roomReservice.StartTime = this.startDate.Value; roomReservice.EndTime = this.endDate.Value; roomReservice.Contact = this.txtContract.Text; roomReservice.Text = this.text.Text; var client = new RoomServiceClient(); //bool reserve = await client.ReserveRoomAsync(roomReservice); //client.Close(); var binding = new BasicHttpBinding(); var address = new EndpointAddress("http://localhost:9000/RoomReservation"); var factory = new ChannelFactory <IRoomService>(binding, address); IRoomService roomService = factory.CreateChannel(); bool reserve = await roomService.ReserveRoomAsync(roomReservice); if (reserve) { MessageBox.Show("注册成功!", "提示"); } else { MessageBox.Show("注册失败!", "提示"); } } catch (Exception ex) { MessageBox.Show("服务器忙!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void Page_Load(object sender, EventArgs e) { RoomServiceClient roomServiceClient = new RoomServiceClient(); string[] roomIdentifiers = roomServiceClient.QueryAllRoomIdentifiers(); td_Room.DataSource = roomIdentifiers; td_Room.DataBind(); String id = Request.Params["id"]; if (id == null) { action.Value = "insert"; } else { StaffServiceClient staffServiceClient = new StaffServiceClient(); Staff staff = staffServiceClient.QueryStaff(Int32.Parse(id)); action.Value = "update"; old_Id.Value = id; td_Id.Text = staff.Id.ToString(); td_Name.Text = staff.Name; td_LastName.Text = staff.LastName; td_Room.SelectedValue = staff.Room; td_ipAddress.Text = staff.IpAddress; staffServiceClient.Close(); } roomServiceClient.Close(); }
private async void OnReserveRoom(object sender, RoutedEventArgs e) { var client = new RoomServiceClient(); bool reserved = await client.ReserveRoomAsync(_reservation); client.Close(); if (reserved) { MessageBox.Show("reservation ok"); } }
public RoomWindowViewModel(RoomViewModel roomVM) { this.RoomVM = roomVM; userVMs.SetValue(new System.Collections.ObjectModel.ObservableCollection<UserViewModel>()); privateMicUserVMs.SetValue(new System.Collections.ObjectModel.ObservableCollection<UserViewModel>()); secretMicUserVMs.SetValue(new System.Collections.ObjectModel.ObservableCollection<UserViewModel>()); fontFamilies.SetValue(new System.Collections.ObjectModel.ObservableCollection<string>()); fontSizes.SetValue(new System.Collections.ObjectModel.ObservableCollection<int>()); RoomCallback = new RoomServiceCallback(); RoomClient = new RoomServiceClient(RoomCallback, roomVM.ServiceIp, ApplicationVM.LocalCache.RoomServicePort); SetVideoSize(); }
private static void GenerateTimesheet(RoomServiceClient client) { Timesheet t = client.GetTimesheet(); var xmlSerializer = new XmlSerializer(typeof(Timesheet)); var w = new StreamWriter("x.xml"); xmlSerializer.Serialize(w, t); w.Flush(); w.Close(); var xslTransform = new XslCompiledTransform(); xslTransform.Load("http://localhost/UnnServiceWebsite/Stylesheets/stylesheet_plain.xsl"); xslTransform.Transform("x.xml", "x.html"); }
private void OnReserveRoom(object sender, RoutedEventArgs e) { RoomReservation reservation = new RoomReservation() { RoomName = textRoom.Text, Event = textEvent.Text, Contact = textContact.Text, StartDate = DateTime.Parse(textStartTime.Text), EndDate = DateTime.Parse(textEndTime.Text) }; RoomServiceClient client = new RoomServiceClient(); client.ReserveRoom(reservation); client.Close(); }
private async void OnReserveRoom() { try { var client = new RoomServiceClient(); bool reserved = await client.ReserveRoomAsync(reservation); client.Close(); if (reserved) { MessageBox.Show("reservation OK"); } } catch (Exception ex) { } }
private async void OnReserveRoom(object sender, RoutedEventArgs e) { try { var client = new RoomServiceClient(); bool reserved = await client.ReserveRoomAsync(_reservation); client.Close(); if (reserved) { MessageBox.Show("reservation ok"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void OnReserveRoom(object sender, RoutedEventArgs e) { var reservation = new RoomReservation() { RoomName = textRoom.Text, Event = textEvent.Text, Contact = textContact.Text, StartDate = DateTime.Parse(textStartTime.Text), EndDate = DateTime.Parse(textEndTime.Text) }; var client = new RoomServiceClient(); bool reserved = client.ReserveRoom(reservation); client.Close(); if (reserved) { MessageBox.Show("reservation ok"); } }