/// <summary> /// add client to system /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bt_GuestRegist_Click(object sender, RoutedEventArgs e) { BO.Person person = new BO.Person { FirstName = tbFirstName.Text, LastName = tbLastName.Text }; if (tbId.Text.Length == 0) { MessageBox.Show("אחד השדות או יותר חסרים:"); return; } if (tbId.Text.Length > 0) { person.Id = int.Parse(tbId.Text); } person.Password = tbPassword1.Password; person.Phone = tbPhone.Text; person.Status = BO.PersonStatus.ACTIVE; try { bl.GetPerson(person.Id); MessageBox.Show("המשתמש קיים במערכת "); ClearTextBox(); GuestLogBorder.Visibility = Visibility.Hidden; } catch (Exception) { bl.AddPerson(person); MessageBox.Show("נרשמת בהצלחה למערכת"); ClearTextBox(); GuestLogBorder.Visibility = Visibility.Hidden; } }
static void Main(string[] args) { BlApi.IBl bl = BlApi.BlFactory.GetBLObj(); Order tmp = bl.GetOrder(5); List <HostingUnit> lst = bl.GetAllHostingUnits().ToList(); Console.WriteLine(tmp); foreach (var i in lst) { Console.WriteLine(i); } Console.WriteLine((bl.GetPerson(212282610))); try { bl.UpdateStatusOrder(OrderStatus.APPROVED, 5); } catch (Exception e) { Console.WriteLine(e.Message); } IEnumerable <IGrouping <Areas, BO.GuestRequest> > g = bl.GetGroupGuestRequestsByArea(); foreach (var item in g) { foreach (var y in item) { Console.WriteLine(y); } } }
private void pb_GuestLog_Click(object sender, RoutedEventArgs e) { try { if (tb_GuestId.Text.Length == 0) { MessageBox.Show("אנא הזן תז"); return; } Person person = bl.GetPerson(int.Parse(tb_GuestId.Text)); if (person.Password != tb_GuestPass.Password) { MessageBox.Show("הסיסמה שגויה אנא הזן שנית:"); return; } GuestPasswordBorder.Visibility = Visibility.Collapsed; lstRequest = bl.GetGuestRequests(int.Parse(tb_GuestId.Text)).ToList(); lstRequest.RemoveAll(x => x.Status == RequestStatus.IRRELEVANT); RequestsViewList.ItemsSource = lstRequest; RequestsViewList.Visibility = Visibility.Visible; } catch (Exception) { MessageBox.Show("הפרטים שמילאת אינם רשומים במערכת:"); } }