public OrderDetails(CSearchOrderInfo cSearchOrderInfo, int cID) { InitializeComponent(); //MessageBox.Show(orderID); tempSearchOrderInfo = new CSearchOrderInfo(); tempSearchOrderInfo = cSearchOrderInfo; orderID = (int)cSearchOrderInfo.OrderID; customerId = cID; lelOrderID.Text += cSearchOrderInfo.OrderID; this.showOrderDetails(cSearchOrderInfo.OrderID.ToString()); lelOrderInfo.Text += "Serial no :" + cSearchOrderInfo.SerialNumber; lelOrderInfo.Text += "\r\nOrder Date: " +cSearchOrderInfo.OrderDateTime.ToString(); lelOrderInfo.Text += "\r\nOrder Type: " + cSearchOrderInfo.OrderType; lelOrderInfo.Text += "\r\nCovers: " + cSearchOrderInfo.Covers; label2.Text = "Food Price: " + cSearchOrderInfo.FoodTotal.ToString("F02"); label2.Text += "\r\nNonFood Price: " + cSearchOrderInfo.NonfoodTotal.ToString("F02"); label2.Text += "\r\nOrder Total: " + cSearchOrderInfo.OrderTotal.ToString("F02"); label2.Text += "\r\nService Charge: " + cSearchOrderInfo.ServiceChargeCash.ToString("F02"); label2.Text += "\r\nDiscount Charge: " + cSearchOrderInfo.Discount.ToString("F02"); label3.Text = "Total Paid (ExVat): " + cSearchOrderInfo.TotalPaidExcludingVat.ToString("F02"); label3.Text += "\r\nTotal Paid (IncVat): " + cSearchOrderInfo.TotalPaidIncludingVat.ToString("F02"); label3.Text += "\r\nVat Total: " + cSearchOrderInfo.VatPaid.ToString("F02"); label3.Text += "\r\nVat Impsed: " + cSearchOrderInfo.VatImposed; label3.Text += "\r\nCash: " + cSearchOrderInfo.CashPaid.ToString("F02"); label3.Text += "\r\nEFT: " + cSearchOrderInfo.EFTPaid.ToString("F02"); label3.Text += "\r\nDUE BILL: " + cSearchOrderInfo.DueBill.ToString("F02"); label3.Text += "\r\nEFT Card Name: " + cSearchOrderInfo.EFTCardName; strGuestBill = cSearchOrderInfo.GuestBill + "\r\n\r\nPrinted from archive\r\n"; cPrintMethodsEXT = new CPrintMethodsEXT(); }
public void AddItem(CSearchOrderInfo item) { orderListPerday.Add(item); }
// New added // Change by Mithu private List<CSearchOrderInfo> CheckBeetweenTime(List<CSearchOrderInfo> OrderInfos) { int fromHour = 0; int fromMin = 0; string formFormat = string.Empty; int toHour = 0; int toMin = 0; string toFormat = string.Empty; Boolean fromMinCheck = false; Boolean toMinCheck = false; CSearchOrderInfo aInfo = new CSearchOrderInfo(); // string ss = cSearchOrderInfos[0].PaymentDateTime.TimeOfDay.ToString(); // string sr = cSearchOrderInfos[0].PaymentDateTime.Date.ToString(); try { if (fromHourcomboBox.SelectedItem.ToString() != null) { fromHour = Convert.ToInt32(fromHourcomboBox.SelectedItem.ToString()); } } catch { } try { if (fromMinutecomboBox.SelectedItem.ToString() != null) { fromMin = Convert.ToInt32(fromMinutecomboBox.SelectedItem.ToString()); } } catch { fromMinCheck = true; } try { if (fromTimeFormatcomboBox.SelectedItem.ToString() != null) { formFormat = fromTimeFormatcomboBox.SelectedItem.ToString(); } } catch { } try { if (toHourcomboBox.SelectedItem.ToString() != null) { toHour = Convert.ToInt32(toHourcomboBox.SelectedItem.ToString()); } } catch { } try { if (toMinutecomboBox.SelectedItem.ToString() != null) { toMin = Convert.ToInt32(toMinutecomboBox.SelectedItem.ToString()); } } catch { toMinCheck = true; } try { if (toTimeFormatcomboBox.SelectedItem.ToString() != null) { toFormat = toTimeFormatcomboBox.SelectedItem.ToString(); } } catch { } string totime = string.Empty; string fromtime = string.Empty; fromtime = dtpStart.Value.Month + "/" + dtpStart.Value.Day + "/" + dtpStart.Value.Year + " "; totime = dtpEnd.Value.Month + "/" + dtpEnd.Value.Day + "/" + dtpEnd.Value.Year + " "; if (toHour == 0 && toMin == 0 && toFormat == "" && fromHour == 0 && fromMin == 0 && formFormat == "") { fromtime += "00:00:00"; totime += "23:59:00"; } else if (toHour == 0 || toFormat == "" || fromHour == 0 || formFormat == "" || fromMinCheck || toMinCheck) { MessageBox.Show("Please Check your Time Format"); fromtime += "00:00:00"; totime += "23:59:00"; } else { if (toHour < 10) { totime += "0"; } totime += toHour + ":"; if (toMin < 10) { totime += "0"; } totime += toMin + ":"; totime += "00 "; if (fromHour < 10) { fromtime += "0"; } fromtime += fromHour + ":"; if (fromMin < 10) { fromtime += "0"; } fromtime += fromMin + ":"; fromtime += "00 "; if (toFormat == "AM") { totime += "AM"; } else totime += "PM"; if (formFormat == "AM") { fromtime += "AM"; } else fromtime += "PM"; } DateTime fromDate = DateTime.Parse(fromtime); DateTime toDate = DateTime.Parse(totime); if (fromDate > toDate) { MessageBox.Show("fromDateTime Must be Less Than Or Equal To toDateTime "); } List<CSearchOrderInfo> aSearch = new List<CSearchOrderInfo>(); foreach (CSearchOrderInfo info in OrderInfos) { if (info.PaymentDateTime >= fromDate && info.PaymentDateTime <= toDate) { aSearch.Add(info); } } return aSearch; }