public List <TicketExceptions> GetTicket_VoidnExpired(Tickets oTickets, List <string> lstPositions) { string strTicketInException = string.Empty; List <TicketExceptions> lstTickets = null; TicketExceptions excep = null; try { DataTable dtTickets = cashdeskmanagerDataAccess.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 = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100; if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions)) { excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.TransactionType = "Voucher"; excep.Zone = "n/a"; System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB"); DateTime dt = DateTime.Parse(row["dtPrinted"].ToString(), System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat); excep.Asset = row["Asset"].ToString(); // excep.PrintDate = row["dtPrinted"].ToString().ReadDateTimeWithSeconds().ToString(); excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString(); excep.PayDate = Convert.ToDateTime(row["dtExpire"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString(); excep.Value = Convert.ToDouble(row["iAmount"]) / 100; //excep.Amount = (Convert.ToDouble().ToString("###0.#0") +")"; excep.Amount = CurrencySymbol + " " + (Convert.ToDecimal(row["iAmount"]) / 100).GetUniversalCurrencyFormat(); excep.Status = (row["StrVoucherStatus"].ToString().Trim().ToUpper() == "NA" ? "Auto Cancelled" : row["StrVoucherStatus"].ToString().Trim().ToUpper() == "VD" ? "Void" : row["StrVoucherStatus"].ToString().Trim().ToUpper() == "EXP" ? "Expired" : "Expired"); 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> 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); }
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 { DataTable dtTickets = cashdeskmanagerDataAccess.GetTickets(oTickets); if (dtTickets == null && dtTickets.Rows.Count < 0) { } else { lstTickets = new List <TicketExceptions>(); TicketExceptions excep = null; // DataTable dtTickets = cashdeskmanagerDataAccess.GetTickets(oTickets); foreach (DataRow row in dtTickets.Rows) { excep = new TicketExceptions(); excep.SEGM = row["PrintDevice"].ToString(); excep.Machine = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100; System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB"); DateTime dt = DateTime.Parse(row["dtPrinted"].ToString(), System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat); if (!string.IsNullOrEmpty(excep.SEGM) && DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions)) { excep.bExceptionRecordFound = true; excep.Type = "IN"; excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString()); // excep.PrintDate = row["dtPrinted"].ToString().ReadDateTimeWithSeconds().ToString(); excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString(); 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.Amount = excep.Value.ToString("###0.#0"); excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat(); excep.Asset = row["Asset"].ToString(); excep.PayDevice = row["PayDevice"].ToString(); excep.CreateCompleted = string.Empty; excep.DeviceID = row["DeviceID"].ToString(); excep.cTicketTotal += excep.currValue; excep.cExceptionsTotal += excep.currValue; } else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString())) { excep.bExceptionRecordFound = true; excep.Type = "IN"; excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString()); excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString(); // excep.PrintDate = dt.ToString().ReadDateTimeWithSeconds().ToString(); 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.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat(); //excep.Amount = excep.Value.ToString("###0.#0"); excep.Asset = row["Asset"].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); }