void DisplayOrders(string section, string query, DateTime firstDate, DateTime lastDate) { profit = 0; dgvOrders.Rows.Clear(); List <OrderModel> list = new List <OrderModel>(); List <OrderModel> list2 = new List <OrderModel>(); if (section == "customer") { list = HelperOrder.GetOrderModelCusList(query); } else if (section == "product") { list = HelperOrder.GetOrderModelProList(query); } else if (section == "category") { list = HelperOrder.GetOrderModelCateList(query); } else { list = HelperOrder.GetOrderModelList(); } foreach (var item in list) { if (Convert.ToDateTime(item.orderDate).Ticks >= firstDate.Ticks && Convert.ToDateTime(item.orderDate).Ticks <= lastDate.Ticks) { list2.Add(item); } } SubDisplayOrders(list2); }
private void FormPayment_Load(object sender, EventArgs e) { var list = HelperOrder.GetOrderModelList(cusID, status); foreach (var item in list) { dgvOrder.Rows.Add(item.orderID, Convert.ToDateTime(item.orderDate).ToShortDateString(), item.orderStatus, item.amount); } }
void DisplayOrders(DateTime firstDate, DateTime lastDate) { profit = 0; dgvOrders.Rows.Clear(); List <OrderModel> list = new List <OrderModel>(); List <OrderModel> list2 = new List <OrderModel>(); list = HelperOrder.GetOrderModelList(); foreach (var item in list) { if (Convert.ToDateTime(item.orderDate).Ticks >= firstDate.Ticks && Convert.ToDateTime(item.orderDate).Ticks <= lastDate.Ticks) { list2.Add(item); } } SubDisplayOrders(list2); }
void DisplayOrders() { profit = 0; dgvOrders.Rows.Clear(); SubDisplayOrders(HelperOrder.GetOrderModelList()); }