private void Login() { if (string.IsNullOrWhiteSpace(UserCredentail.UserName)) { ShowMessage("Please type in a user name"); return; } if (string.IsNullOrWhiteSpace(UserCredentail.Password)) { ShowMessage("Please type in a password"); return; } ServiceStatus status; try { status = StudentServiceProxy.Login(UserCredentail); } catch (Exception ex) { ShowMessage(ex.Message); return; } if (!status.Success) { ShowMessage(status.Message); return; } LoginVisibility = Visibility.Collapsed; }
static void Main(string[] args) { StudentServiceProxy myclient; myclient = new StudentServiceProxy(); int studentId = 1; Console.WriteLine(“Calling StudentService with StudentId = 1…..”); Console.WriteLine(“Student Name = { 0 } ”, myclient.GetStudentInfo(studentId)); Console.ReadLine(); }
private void GetStudentWithCookie() { Students = null; ServiceResult <List <Student> > result; try { result = StudentServiceProxy.GetStudentsWithCookie(); } catch (Exception ex) { ShowMessage(ex.Message); return; } if (!result.Status.Success) { ShowMessage(result.Status.Message); return; } Students = result.Result; }