public void LoadQueue(int id) { string mySql = string.Format("SELECT * FROM " + MainTable + " WHERE ID = {0}", id); DataSet ds = Database.LoadSQL(mySql, MainTable); if (ds.Tables[0].Rows.Count != 1) { MessageBox.Show("Unable load Order", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } foreach (DataRow dr in ds.Tables[0].Rows) { LoadByRow(dr); } mySql = string.Format("SELECT * FROM {0} WHERE QUEUEID = {1} ORDER BY ID", SubTable, _ID); ds.Clear(); ds = Database.LoadSQL(mySql, SubTable); _QueueColl = new QueueCol(); foreach (DataRow dr in ds.Tables[SubTable].Rows) { QueueLines tmpqueulines = new QueueLines(); tmpqueulines.LoadByRow(dr); _QueueColl.Add(tmpqueulines); } }
private void btnVoid_Click(object sender, EventArgs e) { if (lvOrderHist.SelectedItems.Count == 0) { return; } if (MessageBox.Show("Do you want to void this?", "Void", MessageBoxButtons.YesNo) == DialogResult.No) { return; } QueueLines qi = new QueueLines(); qi.ID = Convert.ToInt32(lvOrderHist.SelectedItems[0].Tag); qi.LoadLines(); qi.voidOrder(Convert.ToInt32(lvOrderHist.SelectedItems[0].Tag)); ClientOrder cl = new ClientOrder(); cl.AmountDue = Convert.ToDouble(lvOrderHist.SelectedItems[0].SubItems[4].Text); cl.UpdateAmountDue(Convert.ToInt32(lvOrderHist.SelectedItems[0].SubItems[6].Text)); MessageBox.Show("Successfully voided.", "Void", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadOrder(); }
private void btnVoidWO_Click(object sender, EventArgs e) { if (lvOrderNum.SelectedItems.Count == 0) { return; } int idx = Convert.ToInt32(lvOrderNum.SelectedItems[0].Tag); ClientOrder cl = new ClientOrder(); cl.Void_ClientOrder(idx); Queue q = new Queue(); q.Void_Oueue(idx); int i; for (i = 0; i <= lvOrderNum.Items.Count - 1; i++) { QueueLines ql = new QueueLines(); ql.voidOrder(Convert.ToInt32(lvOrderNum.Items[i].Tag)); } MessageBox.Show("Successfully voided.", "Void", MessageBoxButtons.YesNo, MessageBoxIcon.Information); LoadWholeOder(); lvWholeOrder.Items.Clear(); }
public void Add(QueueLines IDCard) { // Invokes Add method of the List object to add a widget. List.Add(IDCard); }
private void btnOrder_Click(object sender, EventArgs e) { QueOrder = new Queue(); Maintenance tmpMain = new Maintenance(); string tmpOrderNum = tmpMain.GetValue("ORDERNUM"); var with = QueOrder; with.OrderNum = tmpOrderNum; //Queue Number from table Maintenance with.OrderDate = DateTime.Now; //with.Status = true; with.SaveQueue(); foreach (ListViewItem lv in lvOrderList.Items) { QueueLines tmpLines = new QueueLines(); tmpLines.QueueID = QueOrder.GetLastID(); tmpLines.MenuID = Convert.ToInt32(lv.Tag); tmpLines.QTY = Convert.ToDouble(lv.SubItems[4].Text.ToString()); tmpLines.Price = Convert.ToDouble(lv.SubItems[3].Text.ToString()); tmpLines.Status = true; tmpLines.SaveInfo(); } MessageBox.Show("Order Post", "Information"); int tmpNum = Convert.ToInt32(tmpOrderNum) + 1; string finalNum = Convert.ToString(tmpNum); tmpMain.UpdateOption("ORDERNUM", finalNum); lvDisplay.Items.Clear(); lvOrderList.Items.Clear(); string optPrint = tmpMain.GetValue("ORDERPRINT"); if (optPrint == "YES") { Reporting AutoPrint = new Reporting(); string printerName = tmpMain.GetValue("PrinterOrder"); if (canPrint(printerName) == false) { return; } LocalReport report = new LocalReport(); String dsName = "dsOrderPrint"; string mysql = "Select OrderNum From tblQueue Where ID = '" + QueOrder.GetLastID() + "'"; DataSet ds = Database.LoadSQL(mysql, "tblQueue"); report.ReportPath = @"Report\rpt_OrderPrint.rdlc"; report.DataSources.Clear(); report.DataSources.Add(new ReportDataSource(dsName, ds.Tables[0])); Dictionary <string, string> addParameters = new Dictionary <string, string>(); if ((addParameters != null)) { foreach (KeyValuePair <string, string> nPara_loopVariable in addParameters) { var nPara = nPara_loopVariable; ReportParameter tmpPara = new ReportParameter(); tmpPara.Name = nPara.Key; tmpPara.Values.Add(nPara.Value); report.SetParameters(new ReportParameter[] { tmpPara }); } } Dictionary <string, double> paperSize = new Dictionary <string, double>(); paperSize.Add("width", 3.5); paperSize.Add("height", 2.5); try { AutoPrint.Export(report, paperSize); AutoPrint.m_currentPageIndex = 0; AutoPrint.Print(printerName); } catch (Exception ex) { MessageBox.Show(ex.Message, "PRINT FAILED"); } } }