public OrderDetailsBuy GetOrderDetailsBuyWithMaxId() { OrderDetailsBuy orderDetailsBuy = new OrderDetailsBuy(); for (int i = 0; i < this.Count; i++) { if ((this[i] as OrderDetailsBuy).Id > orderDetailsBuy.Id) { orderDetailsBuy = this[i] as OrderDetailsBuy; } } return(orderDetailsBuy); }
public bool Delete() { OrderDetailsBuy orderDetailsBuy = null; for (int i = 0; i < this.Count; i++) { orderDetailsBuy = (this[i] as OrderDetailsBuy); if (!orderDetailsBuy.Delete()) { return(false); } } return(true); }
public OrderDetailsBuyArr Filter(CarExtra carExtra) { OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr(); for (int i = 0; i < this.Count; i++) { OrderDetailsBuy orderDetailsBuy = (this[i] as OrderDetailsBuy); if ((carExtra == null) || (orderDetailsBuy.CarExtra.Id == carExtra.Id)) { orderDetailsBuyArr.Add(orderDetailsBuy); } } return(orderDetailsBuyArr); }
public OrderDetailsBuyArr Filter(OrderBuy orderBuy) { OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr(); for (int i = 0; i < this.Count; i++) { OrderDetailsBuy orderDetailsBuy = (this[i] as OrderDetailsBuy); if ((orderBuy == null) || (orderDetailsBuy.OrderBuy.Id == orderBuy.Id)) { orderDetailsBuyArr.Add(orderDetailsBuy); } } return(orderDetailsBuyArr); }
public bool Insert() { //מוסיפה את אוסף המוצרים להזמנה למסד הנתונים bool flag = true; OrderDetailsBuy orderDetailsBuy = null; for (int i = 0; i < this.Count; i++) { orderDetailsBuy = (this[i] as OrderDetailsBuy); if (!orderDetailsBuy.Insert()) { flag = false; } } return(flag); }
public void Fill() { DataTable dataTable = OrderDetailsBuy_DAL.GetDataTable(); //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות //להעביר כל שורה בטבלה ללקוח DataRow dataRow; OrderDetailsBuy orderDetailsBuy; for (int i = 0; i < dataTable.Rows.Count; i++) { dataRow = dataTable.Rows[i]; orderDetailsBuy = new OrderDetailsBuy(dataRow); this.Add(orderDetailsBuy); } }