public static void PrintDocument(object toPrint) { var data = toPrint as DataGrid; if (data.Items.Count != 0) { DialogDisplayHelper.DisplayMessageBox("no printer found", "information", boxIcon: MessageBoxImage.Error); return; } DialogDisplayHelper.DisplayMessageBox("Nothing have selected to print", "Information", boxIcon: MessageBoxImage.Warning); }
private void AddUpdate(object data) { var havePassword = data as IHavePassword; if (havePassword.SecureString.ComparePassword(havePassword.SecureString1, out string password)) { var response = WebConnect.PostData("User/Create", new User { Name = Name, Uname = UserName, Password = password, UserId = flag ? 0 : LogInFor.User.UserId }); DialogDisplayHelper.DisplayMessageBox(flag?"Add Complete":"Update Complete", "Informative"); } else { DialogDisplayHelper.DisplayMessageBox("Confirm Password And Password Not Matched", "Informative", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void ActivateTrain(object obj) { if (obj == null || Action.Equals("SelectAction") || Direction.Equals("SelectDirection")) { return; } var data = obj as InactiveTrains; var response = WebConnect.UpdateDate("Train/AddTranToWatch", new { TrainId = data.TID, Status = Action, Direction = Direction.Equals("UpWay") }); if (response.StatusCode == HttpStatusCode.OK) { GetData(); DialogDisplayHelper.DisplayMessageBox("Activation Completed", "Informative"); } else if (response.StatusCode == HttpStatusCode.BadRequest) { DialogDisplayHelper.DisplayMessageBox("Configuration Error Occur Check System Configurations", "System Error Detection", boxIcon: MessageBoxImage.Warning); } Action = "SelectAction"; Direction = "SelectDirection"; }