public void addCustomerToCourse(CustomerInCourse cic1) { if (cic1.get_course().get_Coursenumber() == this.courseNumber) { this.customersInThisCourse.Add(cic1); } }
public void addCustomerToCourse(CustomerInCourse cic1) { if (cic1.get_cust().get_customerID() == this.customerID) { this.customerCourses.Add(cic1); } }
public static void init_Customer_In_Courses()//init data from sql { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.Get_All_Customers_In_Courses"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); Customers_In_Course = new List <CustomerInCourse>(); while (rdr.Read()) { CustomerInCourse CusiCou = new CustomerInCourse(seekCourse(rdr.GetValue(0).ToString()), seekCustomer(int.Parse(rdr.GetValue(1).ToString())), false); Customers_In_Course.Add(CusiCou); } }
private void Submit_Click(object sender, EventArgs e) { //Customer C = Program.seekCustomer(Convert.ToInt32(CID.Text)); //ShorashimCourse sc = Program.seekCourse(this.courseNumber1); string data = string.Empty; foreach (DataGridViewRow row in dataGridView1.Rows) { data = Convert.ToString(row.Cells[1].Value); int customer1 = Convert.ToInt32(row.Cells[0].Value); Customer chosenCustomer = Program.seekCustomer(customer1); ShorashimCourse chosenCourse = Program.seekCourseByName(data); if (chosenCustomer != null && chosenCourse != null) { CustomerInCourse NewCIC = new CustomerInCourse(chosenCourse, chosenCustomer, true); } } //EMAIL HERE this.Close(); Main_Menu mainMenu1 = new Main_Menu(EID); mainMenu1.Enabled = true; mainMenu1.Show(); foreach (ShorashimCourse o in Program.Shorashim_Courses) //check of hahalot - products of every order { o.printAllcustomersInThisCourse(); } foreach (Customer c in Program.customers) //check of hahalot - orders of this product { Console.WriteLine("printing CustomersInCourse lists of Customers"); c.printAllCustomersInCourse(); } }