private void Sumbit_Click(object sender, RoutedEventArgs e) { if ((IDFill.Text == "207590225" || IDFill.Text == "318795093") && PasswordFill.Text == "111111111")//if it is the admin,efrat or talya { Admin_Window ad = new Admin_Window(); ad.Show(); this.Close(); return; } try { if (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem) != null) { switch (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem).Content.ToString()) { case " אורח ": { MyGuest temp = bl.getMyGuest(bl.FindMyGuest(IDFill.Text)); if (temp.Password != PasswordFill.Text) { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "סיסמתך אינה נכונה"); x.ShowDialog(); } Guest_Window(temp); break; } case " מארח ": { MyHost temp = bl.getMyHost(bl.FindMyHost(IDFill.Text)); if (temp.Password_host != PasswordFill.Text) { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "סיסמתך אינה נכונה אנא נסה שוב"); x.ShowDialog(); } else { MyHostWindow hostWindow = new MyHostWindow(temp); hostWindow.Show(); Close(); } break; } } } else { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "לא מילאת את כל הפרטים " + "\n" + "אנא מלא שוב את כל הפרטים"); x.ShowDialog(); Window_Password window = new Window_Password(); window.Show(); } } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } }
private void RegistrationButton_Click(object sender, RoutedEventArgs e) { try { if (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem) != null) //המשמתש מילא את השדה { switch (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem).Content.ToString()) { case " אורח ": { Registration_Guest window = new Registration_Guest(); window.Show(); break; } case " מארח ": { Registration_Host window = new Registration_Host(); window.Show(); break; } } } else { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "הינך צריך למלא האם אתה אורח/מארח "); x.ShowDialog(); } } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { try { bl.update_GuestRequest(this.my_Guest); MessageBox_Project x = new MessageBox_Project("!!מעולה ", "העידכון עבר בהצלחה"); x.ShowDialog(); Close(); } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { try { HostingUnit myhostingUnit = bl.GetName_GiveHostingUnit(TextBox_of_hostingunit_name.Text.ToString()); if (myhostingUnit == null) { throw new Exception("לא קיימת יחידת אירוח כזאת במאגר "); } int number = bl.Number_of_orders_accepted(myhostingUnit); MessageBox_Project x = new MessageBox_Project(":מס' ההזמנות שנסגרו בהצלחה ביחידה זו", "הזמנות: " + number); x.ShowDialog(); } catch (Exception ms) { MessageBox.Show(ms.Message); } }
private void Button_Click(object sender, RoutedEventArgs e) { try { My_HostUnit = bl.GetName_GiveHostingUnit(HostUnitFill.Text.ToString()); if (My_HostUnit == null) { MessageBox_Project t = new MessageBox_Project("!!שגיאה ", "השם יחידת אירוח שביקשת לעדכן אינו נמצא ברשימה"); t.ShowDialog(); } bl.deleteHostingUnit(My_HostUnit); MessageBox_Project x = new MessageBox_Project("!!מעולה ", "היחידה נמחקה בהצלחה"); x.ShowDialog(); Close(); } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { try { if (TextBox_of_hostingunit_name != null) { My_HostUnit.HostingUnitName = TextBox_of_hostingunit_name.Text.ToString(); } if (TextBox_price_Of_Night_To_Adult != null) { My_HostUnit.price_Of_Night_To_Adult = double.Parse(TextBox_price_Of_Night_To_Adult.Text); } if (TextBox_price_Of_Night_To_Child != null) { My_HostUnit.price_Of_Night_To_Child = double.Parse(TextBox_price_Of_Night_To_Child.Text); } if (ComboBox_of_Type.SelectedItem != null) { My_HostUnit.Type = CheckEnums.CheckType(ComboBox_of_Type.SelectionBoxItem.ToString()); } if (TextBox_of_Adults != null) { My_HostUnit.Adults = int.Parse(TextBox_of_Adults.Text); } if (TextBox_of_children != null) { My_HostUnit.Children = int.Parse(TextBox_of_children.Text); } if (ComboBox_of_Area.SelectedItem != null) { My_HostUnit.Area = CheckEnums.CheckArea(ComboBox_of_Area.SelectionBoxItem.ToString()); } if (TextBox_of_number_SubArea != null) { My_HostUnit.SubArea = TextBox_of_number_SubArea.Text.ToString(); } if (ComboBox_of_pool.SelectedItem != null) { My_HostUnit.Pool = CheckEnums.CheckYes_Or_No(ComboBox_of_pool.SelectionBoxItem.ToString()); } if (ComboBox_of_Jacuzzi.SelectedItem != null) { My_HostUnit.Jacuzzi = CheckEnums.CheckYes_Or_No(ComboBox_of_Jacuzzi.SelectionBoxItem.ToString()); } if (ComboBox_of_Garden.SelectedItem != null) { My_HostUnit.Garden = CheckEnums.CheckYes_Or_No(ComboBox_of_Garden.SelectionBoxItem.ToString()); } if (ComboBox_of_ChildrensAttractions.SelectedItem != null) { My_HostUnit.ChildrensAttractions = CheckEnums.CheckYes_Or_No(ComboBox_of_ChildrensAttractions.SelectionBoxItem.ToString()); } My_HostUnit.Owner = host; bl.AddHostingUnit(My_HostUnit); MessageBox_Project x = new MessageBox_Project("!!מעולה ", "יחידת האירוח נוספה בהצלחה "); x.ShowDialog(); MyHostWindow a = new MyHostWindow(host); a.Show(); } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } }
private void send_email_Click(object sender, RoutedEventArgs e) { e.Handled = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$").IsMatch(email.Text); //check if email and id valid: if ((e.Handled == false) || IDFill.Text.Count() < 9) { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "אימייל לא יכול להישלח ללא כתובת מייל או מספר זיהוי חוקי"); x.ShowDialog(); return; } // if everything is ok, send the mail: System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(email.Text); mail.From = new System.Net.Mail.MailAddress("*****@*****.**"); //Subject of the messege mail.Subject = "שיחזור סיסמא"; mail.Body = "סיסמתך היא: "; //mail.Body = ""; if (IDFill.Text == "207590225" || IDFill.Text == "318795093")//if it is the admin,efrat or talya { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב", " סיסמתך היא: 111111111"); x.ShowDialog(); return; } try { if (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem) != null) { switch (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem).Content.ToString()) { case " אורח ": { MyGuest temp = bl.getMyGuest(bl.FindMyGuest(IDFill.Text)); mail.Body = mail.Body + temp.Password; break; } case " מארח ": { MyHost temp = bl.getMyHost(bl.FindMyHost(IDFill.Text)); mail.Body = mail.Body + temp.Password_host; break; } } } } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } //the body of message mail.IsBodyHtml = false; SmtpClient smtp = new SmtpClient("smtp.gmail.com"); NetworkCredential basicCredential = new NetworkCredential("*****@*****.**", "tel1234*"); smtp.EnableSsl = true; smtp.UseDefaultCredentials = true; smtp.Credentials = basicCredential; try { smtp.Send(mail); MessageBox_Project sendMassege = new MessageBox_Project(":שִׂים לֵב", "המייל נשלח בהצלחה"); sendMassege.ShowDialog(); Close(); } catch (Exception eo) { MessageBox.Show(eo.ToString()); //MessageBox_Project sendMassege = new MessageBox_Project(":שִׂים לֵב", "המייל לא נשלח"); // sendMassege.ShowDialog(); } }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { try { if (TextBox_of_privat_name != null) { my_Guest.firstName = TextBox_of_privat_name.Text.ToString(); } if (TextBox_of_Family_name != null) { my_Guest.FamilyName = TextBox_of_Family_name.Text.ToString(); } if (email != null) { my_Guest.MailAddress = email.Text.ToString(); } if (TextBox_of_number_phon != null) { my_Guest.FhoneNumber = TextBox_of_number_phon.Text.ToString(); } if (TextBox_of_number_SubArea != null) { my_Guest.SubArea = TextBox_of_number_SubArea.Text.ToString(); } if (TextBox_of_Adults != null) { my_Guest.Adults = int.Parse(TextBox_of_Adults.Text.ToString()); } if (TextBox_of_children != null) { my_Guest.Children = int.Parse(TextBox_of_children.Text.ToString()); } if (DatePicker_EntryDate.SelectedDate != null) { my_Guest.EntryDate = DateTime.Parse(DatePicker_EntryDate.Text); } if (DatePicker_ReleaseDate.SelectedDate != null) { my_Guest.ReleaseDate = DateTime.Parse(DatePicker_ReleaseDate.Text); } if (ComboBox_of_Area.SelectedItem != null) { my_Guest.Area = CheckEnums.CheckArea(ComboBox_of_Area.SelectionBoxItem.ToString()); } if (ComboBox_of_Type.SelectedItem != null) { my_Guest.Type = CheckEnums.CheckType(ComboBox_of_Type.SelectionBoxItem.ToString()); } if (ComboBox_of_pool.SelectedItem != null) { my_Guest.Pool = CheckEnums.CheckYes_Or_No(ComboBox_of_pool.SelectionBoxItem.ToString()); } if (ComboBox_of_Jacuzzi.SelectedItem != null) { my_Guest.Jacuzzi = CheckEnums.CheckYes_Or_No(ComboBox_of_Jacuzzi.SelectionBoxItem.ToString()); } if (ComboBox_of_Garden.SelectedItem != null) { my_Guest.Garden = CheckEnums.CheckYes_Or_No(ComboBox_of_Garden.SelectionBoxItem.ToString()); } if (ComboBox_of_ChildrensAttractions.SelectedItem != null) { my_Guest.ChildrensAttractions = CheckEnums.CheckYes_Or_No(ComboBox_of_ChildrensAttractions.SelectionBoxItem.ToString()); } // בדיקה שמילא את כל השדות של הטקסט if ((TextBox_of_privat_name.Text == "") || (TextBox_of_Family_name.Text == "") || (email.Text == "") || (TextBox_of_number_phon.Text == "") || (TextBox_of_Adults.Text == "") || (TextBox_of_children.Text == "")) { MessageBox_Project y = new MessageBox_Project(":שִׂים לֵב ", "לא מילאת את כל השדות אנא מלא את כל השדות"); y.ShowDialog(); } bl.AddGuestRequest(my_Guest); // ההעברה למימוש, הוספה לרשימת הדרישות לקוח HostingUnit my_hosting = bl.GetGuestRequest_RrtrunHostingUnit(my_Guest); //מחזיר את היחידת אירוח לפי הדרישות של הלקוח double sum = bl.Calculation_amount_to_pay(my_Guest, my_hosting); // סכום לתשלום MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", sum + " : הסכום שהינך צריך לשלם הוא"); x.ShowDialog(); // אחרי שיש יחידת אירוח פנויה ואחרי הצגת התשלום למשתמש ניתן לפתוח הזמנה חדשה //עם מפתח הדרישה ועם מפתח היחידה //ובפונקציה הוספת הזמנה נתפוס את הימים במטריצה //ונשלח לו מייל עם פרטי הזמנה ונגיד לו שהבקשה של אושרה Order o = new Order(); o.GuestRequestKey = my_Guest.guest_request_key; o.HostingUnitKey = my_hosting.hosting_unit_key; o.Amount_to_pay = sum; o.CreateDate = DateTime.Now; bl.AddOrder(o); } catch (NotImplementedException exp) { MessageBox.Show(exp.Message); MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", " מצטערים, " + "לא נמצאה יחידת אירוח התואמת את דרישתך"); x.ShowDialog(); } }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { try { if (TextBox_of_privat_name != null) { my_Guest.PrivateName = TextBox_of_privat_name.Text.ToString(); } if (TextBox_of_Family_name != null) { my_Guest.FamilyName = TextBox_of_Family_name.Text.ToString(); } if (email != null) { my_Guest.MailAddress = email.Text.ToString(); } if (TextBox_of_number_phon != null) { my_Guest.FhoneNumber = TextBox_of_number_phon.Text.ToString(); } if (TextBox_of_number_SubArea != null) { my_Guest.SubArea = TextBox_of_number_SubArea.Text.ToString(); } if (TextBox_of_Adults != null) { my_Guest.Adults = int.Parse(TextBox_of_Adults.Text.ToString()); } if (TextBox_of_children != null) { my_Guest.Children = int.Parse(TextBox_of_children.Text.ToString()); } if (DatePicker_EntryDate.SelectedDate != null) { my_Guest.EntryDate = DateTime.Parse(DatePicker_EntryDate.Text); } if (DatePicker_ReleaseDate.SelectedDate != null) { my_Guest.ReleaseDate = DateTime.Parse(DatePicker_ReleaseDate.Text); } if (ComboBox_of_Area.SelectedItem != null) { my_Guest.Area = CheckEnums.CheckArea(ComboBox_of_Area.SelectionBoxItem.ToString()); } if (ComboBox_of_Type.SelectedItem != null) { my_Guest.Type = CheckEnums.CheckType(ComboBox_of_Type.SelectionBoxItem.ToString()); } if (ComboBox_of_pool.SelectedItem != null) { my_Guest.Pool = CheckEnums.CheckAreaoptions(ComboBox_of_pool.SelectionBoxItem.ToString()); } if (ComboBox_of_Jacuzzi.SelectedItem != null) { my_Guest.Jacuzzi = CheckEnums.CheckAreaoptions(ComboBox_of_Jacuzzi.SelectionBoxItem.ToString()); } if (ComboBox_of_Garden.SelectedItem != null) { my_Guest.Garden = CheckEnums.CheckAreaoptions(ComboBox_of_Garden.SelectionBoxItem.ToString()); } if (ComboBox_of_ChildrensAttractions.SelectedItem != null) { my_Guest.ChildrensAttractions = CheckEnums.CheckAreaoptions(ComboBox_of_ChildrensAttractions.SelectionBoxItem.ToString()); } } catch (ArgumentException exp) { MessageBox.Show(exp.Message); } // בדיקה שמילא את כל השדות של הטקסט if ((TextBox_of_privat_name.Text == "") || (TextBox_of_Family_name.Text == "") || (email.Text == "") || (TextBox_of_number_phon.Text == "") || (TextBox_of_Adults.Text == "") || (TextBox_of_children.Text == "")) { MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "לא מילאת את כל השדות אנא מלא את כל השדות"); } bl.AddGuestRequest(my_Guest); // ההעברה למימוש }