本文整理汇总了C#中Service1Client.GetTtTimesByTime方法的典型用法代码示例。如果您正苦于以下问题:C# Service1Client.GetTtTimesByTime方法的具体用法?C# Service1Client.GetTtTimesByTime怎么用?C# Service1Client.GetTtTimesByTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service1Client
的用法示例。
在下文中一共展示了Service1Client.GetTtTimesByTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTutoringTime
private void CreateTutoringTime()
{
DateTime date = calendar.SelectionRange.Start;
string time = cbScTime.Text;
int teacherId = teacher.Id;
if (date < DateTime.Today)
{
MessageBox.Show("Not possible to set available date and time");
}
else
{
if (string.IsNullOrEmpty(time))
{
MessageBox.Show("Please select the time");
}
else
{
Service1Client winService = new Service1Client();
tt = winService.GetTtTimesByTime(date, time, teacherId);
if (tt != null)
{
if (tt.Date == date)
{
if (String.Equals(tt.Time, time))
{
MessageBox.Show("Selected time is already in use");
}
else
{
winService.CreateTutoringTime(date, teacherId, time);
MessageBox.Show("Tutor time succesfully inserted");
}
}
}
else
{
winService.CreateTutoringTime(date, teacherId, time);
MessageBox.Show("Tutor time succesfully inserted");
}
}
}
}
示例2: TutorTable_RowCommand
//Handels button press action
protected void TutorTable_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Book")
{
int rowindex = Convert.ToInt32(e.CommandArgument);
GridViewRow gvr = TutorTable.Rows[rowindex];
string name = gvr.Cells[0].Text;
string time = gvr.Cells[2].Text;
Service1Client service = new Service1Client();
int result = 0;
foreach (TutoringTime tt in allTutoringTimes)
{
if (tt.Time == time && tt.Teacher.Name == name && tt.Date == BookingCalendar.SelectedDate)
{
if (service.GetTtTimesByTime(tt.Date, time, tt.Teacher.Id).Child == null)
{
result = service.RegisterBooking(LogIn.child.Id, tt.Id);
ResetAllData();
if (allTutoringTeachers.Count < 1 && result == 1)
{
Response.Write("<script>alert('You booked the last appointment! No more appointments available for any teacher. If you would like to make another appointment, try again later!')</script>");
Server.Transfer("Default.aspx", true);
}
//Returns message of transaction if it was successful or not
if (result == 1)
{
Response.Write("<script>alert('Your booking was successful!')</script>");
}
else
{
Response.Write("<script>alert('Sorry, something went wrong! Please contact us if you see this message!')</script>");
}
}
}
}
//Returns message if someone made a booking before current user did
if (result == 0)
{
ResetAllData();
DisplayMessageIfNoTutorsAvailable("Sorry, someone made this booking faster than you and there are no more appointments available for any teacher. Try again later!");
Response.Write("<script>alert('Sorry, someone made this booking faster than you!')</script>");
}
}
}