private void ButtonUpdateTrainee_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         My_HostUnit = bl.GetName_GiveHostingUnit(NameTextBox.Text.ToString());
         if (My_HostUnit == null)
         {
             throw new Exception("השם יחידת אירוח שביקשת לעדכן אינו נמצא ברשימה");
         }
         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());
         }
         MessageBox.Show("הוכנס לעידכון, לחץ על 'אישור' אחרי הזנת הפרטים מחדש  ");
     }
     catch (Exception ms)
     {
         MessageBox.Show(ms.Message);
     }
 }
        private void Sumbit_Click(object sender, RoutedEventArgs e)
        {
            This_Host.FhoneNumber         = FhoneFill.Text.ToString();
            This_Host.MailAddress         = email.Text.ToString();
            This_Host.BankAccountNumber   = Convert.ToInt32(BankAccountNumberFill.Text);
            This_Host.CollectionClearance = CheckEnums.CheckYes_Or_No(ComboBox_of_YesOrNo.SelectionBoxItem.ToString());

            BankBranch BankAccuont = new BankBranch();

            BankAccuont.BankName      = BankNameFill.Text.ToString();
            BankAccuont.BankNumber    = int.Parse(BankAccountNumberFill.Text); // מספר חשבון בנק
            BankAccuont.BranchNumber  = int.Parse(BankNumberFill.Text);        //מספר סניף
            BankAccuont.BranchAddress = BranchAddressFill.Text.ToString();
            BankAccuont.BranchCity    = BranchCityFill.Text.ToString();

            This_Host.BankAccuont = BankAccuont;

            bl.AddHost(this.This_Host);


            Window_Password window = new Window_Password();

            window.Show();
            this.Close();
        }
 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);
     }
 }
Ejemplo n.º 4
0
 private void ButtonUpdateTrainee_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         my_Guest = bl.Getid_GiveGuestRequest(idTextBox.Text.ToString());
         if (my_Guest == null)
         {
             throw new Exception("התעודת זהות שהקשת אינה קיימת ברשימת דרישות לקוח");
         }
         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.FhoneNumber = TextBox_of_number_SubArea.Text.ToString();
         }
         if (TextBox_of_Adults != null)
         {
             my_Guest.FhoneNumber = TextBox_of_Adults.Text.ToString();
         }
         if (TextBox_of_children != null)
         {
             my_Guest.FhoneNumber = 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());
         }
         MessageBox.Show("הוכנס לעידכון, לחץ על 'אישור' אחרי הזנת הפרטים מחדש  ");
     }
     catch (Exception ms)
     {
         MessageBox.Show(ms.Message);
     }
 }
Ejemplo n.º 5
0
        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); // ההעברה למימוש
        }