• R/O
  • SSH
  • HTTPS

softbanking: Commit


Commit MetaInfo

Revision66 (tree)
Time2022-03-18 10:28:55
Authorhemaxvi_soft

Log Message

(empty log message)

Change Summary

Incremental Difference

--- Capas/Datos/TransactionsDAL.cs (revision 65)
+++ Capas/Datos/TransactionsDAL.cs (revision 66)
@@ -695,7 +695,100 @@
695695 return transactionsList;
696696 }
697697
698+ public List<TransactionsDAL> SearchPayWinCuadre(LoginDAL loginDAL, bool usedDate = false)
699+ {
700+ ErrorCode = 0;
701+ ErrorDescription = "Successful";
702+ SqlConnection con = new SqlConnection();
703+ SqlParameter parametros;
704+ SqlDataReader dr = null;
705+ List<TransactionsDAL> transactionsList = new List<TransactionsDAL>();
706+ try
707+ {
708+ dbm.DataSource = loginDAL.DataSource; dbm.DataBase = loginDAL.DataBaseName; dbm.User = loginDAL.UserName; dbm.Password = loginDAL.UserPassword; con = dbm.getConexion(dbm);
709+ con.Open();
710+ SqlCommand cmd = new SqlCommand("TransactionsSearchPayWinCuadre", con);
698711
712+ if (TransactionID > 0)
713+ {
714+ parametros = cmd.Parameters.Add("@TransactionID", SqlDbType.Int);
715+ parametros.Value = TransactionID;
716+ }
717+ if (!string.IsNullOrEmpty(UserName))
718+ {
719+ parametros = cmd.Parameters.Add("@UserName", SqlDbType.VarChar);
720+ parametros.Value = UserName;
721+ }
722+ if (BranchID > 0)
723+ {
724+ parametros = cmd.Parameters.Add("@BranchID", SqlDbType.Int);
725+ parametros.Value = BranchID;
726+ }
727+
728+ if (LotteryID > 0)
729+ {
730+ parametros = cmd.Parameters.Add("@LotteryID", SqlDbType.Int);
731+ parametros.Value = LotteryID;
732+ }
733+
734+
735+ parametros = cmd.Parameters.Add("@CustomerID", SqlDbType.Int);
736+ parametros.Value = CustomerID;
737+
738+ if (usedDate)
739+ {
740+ parametros = cmd.Parameters.Add("@StartDate", SqlDbType.DateTime);
741+ parametros.Value = StartTime;
742+ }
743+ else
744+ {
745+ parametros = cmd.Parameters.Add("@StartDate", SqlDbType.DateTime);
746+ parametros.Value = Convert.ToDateTime(StartTime.ToShortDateString() + " 00:00:00");
747+ }
748+
749+ parametros = cmd.Parameters.Add("@EndDate", SqlDbType.DateTime);
750+ parametros.Value = Convert.ToDateTime(EndTime.ToShortDateString() + " 23:59:59");
751+
752+ cmd.CommandType = CommandType.StoredProcedure;
753+ dr = cmd.ExecuteReader();
754+ if (dr.HasRows)
755+ {
756+ while (dr.Read())
757+ {
758+ transactionsDAL = new TransactionsDAL();
759+ transactionsDAL.transactionID = dr.GetInt64(dr.GetOrdinal("TransactionID"));
760+ transactionsDAL.branchID = dr.GetInt32(dr.GetOrdinal("BranchID"));
761+ transactionsDAL.amount = dr.GetDecimal(dr.GetOrdinal("Amount"));
762+ transactionsDAL.shiftID = dr.GetInt32(dr.GetOrdinal("ShiftID"));
763+ transactionsDAL.date = dr.GetDateTime(dr.GetOrdinal("Date"));
764+ transactionsDAL.transactionStatusID = dr.GetInt32(dr.GetOrdinal("TransactionStatusID"));
765+ transactionsDAL.userID = dr.GetInt32(dr.GetOrdinal("UserID"));
766+ transactionsDAL.commission = dr.GetDecimal(dr.GetOrdinal("Commission"));
767+ transactionsDAL.partnerCommission = dr.GetDecimal(dr.GetOrdinal("PartnerCommission"));
768+ transactionsDAL.totalGainAmount = dr.GetInt32(dr.GetOrdinal("TotalGainAmount"));
769+ transactionsDAL.branchName = dr.GetString(dr.GetOrdinal("BranchName"));
770+ transactionsDAL.transactionStatusName = dr.GetString(dr.GetOrdinal("TransactionStatusName"));
771+ transactionsDAL.shiftName = dr.GetString(dr.GetOrdinal("ShiftName"));
772+ transactionsDAL.userName = dr.GetString(dr.GetOrdinal("UserName"));
773+ transactionsDAL.lotteryName = dr.GetString(dr.GetOrdinal("LotteryName"));
774+ transactionsDAL.ticketID = dr.GetString(dr.GetOrdinal("TicketID"));
775+ transactionsDAL.discount = dr.GetDecimal(dr.GetOrdinal("Discount"));
776+ transactionsDAL.codeName = dr.GetString(dr.GetOrdinal("CodeName"));
777+ transactionsList.Add(transactionsDAL);
778+ }
779+ }
780+ con.Close();
781+ }
782+ catch (Exception e)
783+ {
784+ errorDescription = "Error de SQL :" + e.Message;
785+ errorCode = 1;
786+ }
787+
788+ return transactionsList;
789+ }
790+
791+
699792 public Boolean GetByKey(LoginDAL loginDAL)
700793 {
701794 bool res = false;
--- CuadreWF.aspx.cs (revision 65)
+++ CuadreWF.aspx.cs (revision 66)
@@ -324,7 +324,7 @@
324324 transactionsDAL.StartTime = DateTime.Now.AddYears(-50);
325325 transactionsDAL.EndTime = DateTime.Now;
326326 transactionsDAL.CustomerID = -1;
327- list = transactionsDAL.SearchPayWin(loginDAL);
327+ list = transactionsDAL.SearchPayWinCuadre(loginDAL);
328328
329329 foreach (TransactionsDAL item in list)
330330 {
--- FacturacionWF.aspx.cs (revision 65)
+++ FacturacionWF.aspx.cs (revision 66)
@@ -633,6 +633,7 @@
633633 {
634634 TicketImprimirC.Style.Add("display", "block");
635635 PintarTicket();
636+ // PintarTicketTest();
636637 ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "printTest();", true);
637638
638639 //ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "BtPrint(document.getElementById('TicketImprimir').innerText)", true)
@@ -846,6 +847,129 @@
846847 }
847848
848849 }
850+
851+ public void PintarTicketTest()
852+ {
853+
854+ if (Cb1.Checked || Cb4.Checked || Cb5.Checked || Cb12.Checked || Cb15.Checked || Cb32.Checked || Cb33.Checked ||
855+ Cb37.Checked || Cb38.Checked || Cb39.Checked || Cb40.Checked || Cb41.Checked || Cb42.Checked || Cb43.Checked ||
856+ Cb44.Checked || Cb45.Checked || Cb46.Checked || Cb47.Checked || Cb48.Checked || Cb49.Checked)
857+ { }
858+
859+ string nombreBanca = customersDALList[0].PartnerShip;
860+ string esloganBanca = "Pagamos al instante!";
861+ string telefonoBanca = branchesDAL.Phone;
862+ string VendedorBanca = employeeDAL.Name;
863+ string numeroTicket = "0";
864+ string detalleTicket = "";
865+ int contadorLoterias = 1;
866+ string FechaBanca = "13/03/2022 03:05 PM";
867+ TicketImprimir.InnerHtml = "<h1 class='aling-T-C'>" + nombreBanca + "</h1>";
868+ TicketImprimir.InnerHtml += "<div class='aling-T-C' >" + esloganBanca + "</div><br/>";
869+ TicketImprimir.InnerHtml += "<div class='aling-T-L'><b><a>Telefono:&nbsp</a></b><a>" + telefonoBanca + "</a></div>";
870+ TicketImprimir.InnerHtml += "<div class='aling-T-L'><b><a>Vendedor:&nbsp</a></b><a>" + VendedorBanca + "</a></div>";
871+ TicketImprimir.InnerHtml += "<div class='aling-T-L'><b><a>Fecha:&nbsp</a></b><a>" + FechaBanca + "</a></div><br/>";
872+
873+ TicketImprimir.InnerHtml += "<h5 class='aling-T-C negrita-T' >Num. Ticket: " + numeroTicket + "</h5>";
874+ TicketImprimir.InnerHtml += "<h6 class='aling-T-C'>Jugadas</h6>";
875+
876+ if (Cb44.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>AM </a><a>" + Cb44.Text + "</a></div>"; }
877+ if (Cb1.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>NA </a><a>" + Cb1.Text + "</a></div>"; }
878+ if (Cb12.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>LO </a><a>" + Cb12.Text + "</a></div>"; }
879+ if (Cb15.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>GA </a><a>" + Cb15.Text + "</a></div>"; }
880+ if (Cb32.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>SRG </a><a>" + Cb32.Text + "</a></div>"; }
881+ if (Cb33.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>RE </a><a>" + Cb33.Text + "</a></div>"; }
882+ if (Cb37.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>NYT </a><a>" + Cb37.Text + "</a></div>"; }
883+ if (Cb38.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>NYN </a><a>" + Cb38.Text + "</a></div>"; }
884+ if (Cb39.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>FD </a><a>" + Cb39.Text + "</a></div>"; }
885+ if (Cb4.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>LE </a><a>" + Cb4.Text + "</a></div>"; }
886+ if (Cb40.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>FN </a><a>" + Cb40.Text + "</a></div>"; }
887+ if (Cb41.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>LP </a><a>" + Cb41.Text + "</a></div>"; }
888+ if (Cb42.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>LS </a><a>" + Cb42.Text + "</a></div>"; }
889+ if (Cb43.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>LD </a><a>" + Cb43.Text + "</a></div>"; }
890+ if (Cb45.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>AMD </a><a>" + Cb45.Text + "</a></div>"; }
891+ if (Cb46.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>AT </a><a>" + Cb46.Text + "</a></div>"; }
892+ if (Cb47.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>AN </a><a>" + Cb47.Text + "</a></div>"; }
893+ if (Cb48.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>KGT </a><a>" + Cb48.Text + "</a></div>"; }
894+ if (Cb49.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>KGN </a><a>" + Cb49.Text + "</a></div>"; }
895+ if (Cb5.Checked) { TicketImprimir.InnerHtml += "<div class='aling-T-L'><a>SNL </a><a>" + Cb5.Text + "</a></div>"; }
896+
897+
898+ TicketImprimir.InnerHtml += "<br/><div class='row' >";
899+ TicketImprimir.InnerHtml += "<div class='col-7'><div class='row justify-content-start negrita-T fs-5' >TP Num.</div></div>";
900+ TicketImprimir.InnerHtml += "<div class='col-2'><div class='row justify-content-start negrita-T fs-5' >Lot.</div></div>";
901+ TicketImprimir.InnerHtml += "<div class='col-3' ><div class='row justify-content-end negrita-T fs-5' >Valor</div></div>";
902+ TicketImprimir.InnerHtml += "<hr class='lineaPuntos-T' />";
903+ TicketImprimir.InnerHtml += "</div>";
904+
905+
906+ if (Cb44.Checked) { detalleTicket += PintarTicketDetalle("AM", Cb44.Text); contadorLoterias++; }
907+ if (Cb1.Checked) { detalleTicket += PintarTicketDetalle("NA", Cb1.Text); contadorLoterias++; }
908+ if (Cb12.Checked) { detalleTicket += PintarTicketDetalle("LO", Cb12.Text); contadorLoterias++; }
909+ if (Cb15.Checked) { detalleTicket += PintarTicketDetalle("GA", Cb15.Text); contadorLoterias++; }
910+ if (Cb32.Checked) { detalleTicket += PintarTicketDetalle("SRG", Cb32.Text); contadorLoterias++; }
911+ if (Cb33.Checked) { detalleTicket += PintarTicketDetalle("RE", Cb33.Text); contadorLoterias++; }
912+ if (Cb37.Checked) { detalleTicket += PintarTicketDetalle("NYT", Cb37.Text); contadorLoterias++; }
913+ if (Cb38.Checked) { detalleTicket += PintarTicketDetalle("NYN", Cb38.Text); contadorLoterias++; }
914+ if (Cb39.Checked) { detalleTicket += PintarTicketDetalle("FD", Cb39.Text); contadorLoterias++; }
915+ if (Cb4.Checked) { detalleTicket += PintarTicketDetalle("LE", Cb4.Text); contadorLoterias++; }
916+ if (Cb40.Checked) { detalleTicket += PintarTicketDetalle("FN", Cb40.Text); contadorLoterias++; }
917+ if (Cb41.Checked) { detalleTicket += PintarTicketDetalle("LP", Cb41.Text); contadorLoterias++; }
918+ if (Cb42.Checked) { detalleTicket += PintarTicketDetalle("LS", Cb42.Text); contadorLoterias++; }
919+ if (Cb43.Checked) { detalleTicket += PintarTicketDetalle("LD", Cb43.Text); contadorLoterias++; }
920+ if (Cb45.Checked) { detalleTicket += PintarTicketDetalle("AMD", Cb45.Text); contadorLoterias++; }
921+ if (Cb46.Checked) { detalleTicket += PintarTicketDetalle("AT", Cb46.Text); contadorLoterias++; }
922+ if (Cb47.Checked) { detalleTicket += PintarTicketDetalle("AN", Cb47.Text); contadorLoterias++; }
923+ if (Cb48.Checked) { detalleTicket += PintarTicketDetalle("KGT", Cb48.Text); contadorLoterias++; }
924+ if (Cb49.Checked) { detalleTicket += PintarTicketDetalle("KGN", Cb49.Text); contadorLoterias++; }
925+ if (Cb5.Checked) { detalleTicket += PintarTicketDetalle("SNL", Cb5.Text); contadorLoterias++; }
926+
927+
928+ TicketImprimir.InnerHtml += detalleTicket;
929+
930+ TicketImprimir.InnerHtml += "<h1></h1>";
931+ TicketImprimir.InnerHtml += "<h1></h1>";
932+ TicketImprimir.InnerHtml += "<div class='row' ><hr class='lineaPuntos-T' /></div>";
933+ TicketImprimir.InnerHtml += "<div class='row'>";
934+
935+ if (loginDAL.UsedFree)
936+ {
937+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T fs-5' ><div class='row justify-content-start' >SubTotal:</div></div>";
938+ int subtotal = int.Parse(LbSubTotal.Text.Substring(4, LbSubTotal.Text.Length - 4));
939+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T'><div class='row justify-content-end fs-5' >$" + subtotal * (contadorLoterias - 1) + "</div></div>";
940+
941+
942+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T fs-5' ><div class='row justify-content-start' >Free:</div></div>";
943+ int free = int.Parse(LbFree.Text.Substring(4, LbFree.Text.Length - 4));
944+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T'><div class='row justify-content-end fs-5' >$" + free * (contadorLoterias - 1) + "</div></div>";
945+ }
946+
947+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T fs-5' ><div class='row justify-content-start' >Total:</div></div>";
948+ int total = int.Parse(LbTotal.Text.Substring(8, LbTotal.Text.Length - 8));
949+ TicketImprimir.InnerHtml += "<div class='col-6 negrita-T'><div class='row justify-content-end fs-5' >$" + total * (contadorLoterias - 1) + "</div></div>";
950+ TicketImprimir.InnerHtml += "<hr class='lineaPuntos-T' />";
951+ TicketImprimir.InnerHtml += "<hr class='lineaPuntos-T' /><br/>";
952+ TicketImprimir.InnerHtml += "</div><br/><br/>";
953+ TicketImprimir.InnerHtml += "<br/><div class='aling-T-C'><a>Buena Suerte</a></div>";
954+ TicketImprimir.InnerHtml += "<div class='aling-T-C'><a>Revisar su ticket</a></div>";
955+ TicketImprimir.InnerHtml += "<div class='aling-T-C'><a>No pagamos sin ticket</a></div>";
956+ //TicketImprimir.InnerHtml += "<div id='DivQRCode'><img runat='server' src ='' id='imgQRCode'/></div>";
957+
958+
959+ QRCodeEncoder qRCodeEncoder = new QRCodeEncoder();
960+ Bitmap bitmap = qRCodeEncoder.Encode(numeroTicket);
961+ System.Drawing.Image image = (System.Drawing.Image)bitmap;
962+ using (MemoryStream memoryStream = new MemoryStream())
963+ {
964+ image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
965+ byte[] imageBytes = memoryStream.ToArray();
966+ imgQRCode.Src = "data:image/gif;base64," + Convert.ToBase64String(imageBytes);
967+ imgQRCode.Height = 100;
968+ imgQRCode.Width = 100;
969+
970+ }
971+
972+ }
849973 public string PintarTicketDetalle(string loteriaIniciales, string loteria)
850974 {
851975 string respues = "";
--- FacturacionWF.aspx.designer.cs (revision 65)
+++ FacturacionWF.aspx.designer.cs (revision 66)
@@ -483,6 +483,15 @@
483483 protected global::System.Web.UI.WebControls.Button BtnJugar;
484484
485485 /// <summary>
486+ /// Control Button1.
487+ /// </summary>
488+ /// <remarks>
489+ /// Campo generado automáticamente.
490+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
491+ /// </remarks>
492+ protected global::System.Web.UI.WebControls.Button Button1;
493+
494+ /// <summary>
486495 /// Control BtbBorrar.
487496 /// </summary>
488497 /// <remarks>
--- TicketsDetalleWF.aspx.cs (revision 65)
+++ TicketsDetalleWF.aspx.cs (revision 66)
@@ -225,12 +225,12 @@
225225 string numeroTicket = id.ToString();
226226 string detalleTicket = "";
227227 int contadorLoterias = 1;
228- string FechaBanca = DateTime.Now.ToShortDateString();
228+ string FechaBanca = listTransactionsDAL[0].Date.ToString("dd/MM/yyyy hh:mm tt");
229229 TicketReImprimir.InnerHtml = "<h3 class='aling-T-C negrita-T'>" + nombreBanca + "</h3>";
230230 TicketReImprimir.InnerHtml += "<div class='aling-T-C'>" + esloganBanca + "</div><br/>";
231- TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Telefono:</a><a>" + telefonoBanca + "</a></div>";
232- TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Vendedor:</a><a>" + VendedorBanca + "</a></div>";
233- TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Fecha:</a><a>" + FechaBanca + "</a></div><br/>";
231+ TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Telefono:&nbsp</a><a>" + telefonoBanca + "</a></div>";
232+ TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Vendedor:&nbsp</a><a>" + VendedorBanca + "</a></div>";
233+ TicketReImprimir.InnerHtml += "<div class='aling-T-L'><a>Fecha:&nbsp</a><a>" + FechaBanca + "</a></div><br/>";
234234
235235 TicketReImprimir.InnerHtml += "<h5 class='aling-T-C negrita-T'>Num. Ticket: " + numeroTicket + "</h5>";
236236 TicketReImprimir.InnerHtml += "<h6 class='aling-T-C'>Jugadas</h6>";
@@ -239,7 +239,7 @@
239239
240240
241241 TicketReImprimir.InnerHtml += "<br/><div class='row'>";
242- TicketReImprimir.InnerHtml += "<div class='col-7 negrita-T'><div class='row justify-content-start negrita-T fs-5'>TP Numeros</div></div>";
242+ TicketReImprimir.InnerHtml += "<div class='col-7 negrita-T'><div class='row justify-content-start negrita-T fs-5'>TP Num.</div></div>";
243243 TicketReImprimir.InnerHtml += "<div class='col-2 negrita-T'><div class='row justify-content-start negrita-T fs-5'>Lot.</div></div>";
244244 TicketReImprimir.InnerHtml += "<div class='col-3 negrita-T'><div class='row justify-content-end negrita-T fs-5'>Valor</div></div>";
245245 TicketReImprimir.InnerHtml += "<hr class='lineaPuntos-T'/>";
Show on old repository browser