public List <TicketExceptions> GetTicket_VoidnExpired(Tickets oTickets, List <string> lstPositions) { string strTicketInException = string.Empty; List <TicketExceptions> lstTickets = null; TicketExceptions excep = null; try { DataTable dtTickets = DBBuilder.GetTickets(oTickets); if (dtTickets == null && dtTickets.Rows.Count < 0) { } else { lstTickets = new List <TicketExceptions>(); foreach (DataRow row in dtTickets.Rows) { excep = new TicketExceptions(); excep.SEGM = row["PrintDevice"].ToString(); excep.Machine = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100; if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions)) { excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.TransactionType = "TITO"; excep.Zone = "n/a"; excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " + Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm"); excep.PayDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " + Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm"); excep.Value = Convert.ToDouble(row["iAmount"]) / 100; excep.Amount = "(" + Convert.ToDouble(row["iAmount"]) / 100 + ")"; excep.Status = (row["StrVoucherStatus"].ToString() == "NA" ? "Auto Cancelled" : "Void"); excep.cExceptionsTotal += excep.currValue; } lstTickets.Add(excep); } } } catch (Exception ex) { LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } return(lstTickets); }
public List <TicketExceptions> TITOTicketInExceptions(Tickets oTickets, List <string> lstPositions) { // ' //' //Dim oRs As adodb.Recordset //Dim myItem As ListItem //Dim cTicketTotal As Currency //Dim currValue As Currency string strTicketInException = string.Empty; List <TicketExceptions> lstTickets = null; try { if (DBBuilder.GetTickets(oTickets) == null && DBBuilder.GetTickets(oTickets).Rows.Count < 0) { } else { lstTickets = new List <TicketExceptions>(); TicketExceptions excep = null; DataTable dtTickets = DBBuilder.GetTickets(oTickets); foreach (DataRow row in dtTickets.Rows) { excep = new TicketExceptions(); excep.SEGM = row["PrintDevice"].ToString(); excep.Machine = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100; if (!string.IsNullOrEmpty(excep.SEGM) && DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions)) { excep.bExceptionRecordFound = true; excep.Type = "IN"; excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " + Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm"); if (!string.IsNullOrEmpty(row["strBarCode"].ToString())) { excep.Ticket = row["ActualBarcode"].ToString(); } else { excep.Ticket = row["strBarcode"].ToString(); } excep.Value = Convert.ToDouble(row["iAmount"]) / 100; excep.Asset = row["PrintDevice"].ToString(); excep.PayDevice = row["PayDevice"].ToString(); excep.CreateCompleted = string.Empty; excep.cTicketTotal += excep.currValue; excep.cExceptionsTotal += excep.currValue; } else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString())) { excep.bExceptionRecordFound = true; excep.Type = "IN"; excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " + Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm"); if (!string.IsNullOrEmpty(row["strBarCode"].ToString())) { excep.Ticket = row["ActualBarcode"].ToString(); } else { excep.Ticket = row["strBarcode"].ToString(); } excep.Value = Convert.ToDouble(row["iAmount"]) / 100; excep.Asset = row["PrintDevice"].ToString(); excep.PayDevice = row["PayDevice"].ToString(); excep.CreateCompleted = string.Empty; excep.cTicketTotal += excep.currValue; excep.cExceptionsTotal += excep.currValue; } lstTickets.Add(excep); } } } catch (Exception ex) { LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } return(lstTickets); }