Subo cambios 508
This commit is contained in:
Generated
+27
-16
@@ -41,18 +41,20 @@
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(29, 31);
|
||||
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label1.Font = new System.Drawing.Font("Poppins", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.ForeColor = System.Drawing.Color.Transparent;
|
||||
this.label1.Location = new System.Drawing.Point(113, 129);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(79, 25);
|
||||
this.label1.Size = new System.Drawing.Size(88, 36);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Cliente:";
|
||||
//
|
||||
// txtCliente
|
||||
//
|
||||
this.txtCliente.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtCliente.Location = new System.Drawing.Point(33, 75);
|
||||
this.txtCliente.Location = new System.Drawing.Point(117, 173);
|
||||
this.txtCliente.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.txtCliente.Name = "txtCliente";
|
||||
this.txtCliente.Size = new System.Drawing.Size(448, 30);
|
||||
@@ -61,7 +63,7 @@
|
||||
// txtDireccion
|
||||
//
|
||||
this.txtDireccion.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtDireccion.Location = new System.Drawing.Point(33, 183);
|
||||
this.txtDireccion.Location = new System.Drawing.Point(117, 281);
|
||||
this.txtDireccion.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.txtDireccion.Name = "txtDireccion";
|
||||
this.txtDireccion.Size = new System.Drawing.Size(448, 30);
|
||||
@@ -70,18 +72,20 @@
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label2.Location = new System.Drawing.Point(29, 135);
|
||||
this.label2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label2.Font = new System.Drawing.Font("Poppins", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label2.ForeColor = System.Drawing.Color.Transparent;
|
||||
this.label2.Location = new System.Drawing.Point(113, 233);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(99, 25);
|
||||
this.label2.Size = new System.Drawing.Size(112, 36);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Direccion:";
|
||||
//
|
||||
// txtTelefono
|
||||
//
|
||||
this.txtTelefono.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtTelefono.Location = new System.Drawing.Point(32, 279);
|
||||
this.txtTelefono.Location = new System.Drawing.Point(116, 377);
|
||||
this.txtTelefono.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.txtTelefono.Name = "txtTelefono";
|
||||
this.txtTelefono.Size = new System.Drawing.Size(449, 30);
|
||||
@@ -90,18 +94,20 @@
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label3.Location = new System.Drawing.Point(28, 235);
|
||||
this.label3.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label3.Font = new System.Drawing.Font("Poppins", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label3.ForeColor = System.Drawing.Color.Transparent;
|
||||
this.label3.Location = new System.Drawing.Point(112, 333);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(95, 25);
|
||||
this.label3.Size = new System.Drawing.Size(105, 36);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "Telefono:";
|
||||
//
|
||||
// btnAceptar
|
||||
//
|
||||
this.btnAceptar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnAceptar.Location = new System.Drawing.Point(137, 341);
|
||||
this.btnAceptar.Location = new System.Drawing.Point(221, 439);
|
||||
this.btnAceptar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnAceptar.Name = "btnAceptar";
|
||||
this.btnAceptar.Size = new System.Drawing.Size(103, 38);
|
||||
@@ -113,7 +119,7 @@
|
||||
// btnCancelar
|
||||
//
|
||||
this.btnCancelar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnCancelar.Location = new System.Drawing.Point(271, 341);
|
||||
this.btnCancelar.Location = new System.Drawing.Point(355, 439);
|
||||
this.btnCancelar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnCancelar.Name = "btnCancelar";
|
||||
this.btnCancelar.Size = new System.Drawing.Size(111, 38);
|
||||
@@ -126,7 +132,11 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(499, 420);
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(104)))), ((int)(((byte)(255)))));
|
||||
this.BackgroundImage = global::compabetov2.Properties.Resources.Form;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.ClientSize = new System.Drawing.Size(736, 561);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.btnCancelar);
|
||||
this.Controls.Add(this.btnAceptar);
|
||||
this.Controls.Add(this.txtTelefono);
|
||||
@@ -135,9 +145,10 @@
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.txtCliente);
|
||||
this.Controls.Add(this.label1);
|
||||
this.DoubleBuffered = true;
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.Name = "datosEnvio";
|
||||
this.Text = "Datos del envio";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Load += new System.EventHandler(this.datosEnvio_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
+26
-1
@@ -44,6 +44,8 @@ namespace compabetov2.Ventas
|
||||
ventanaPadre.eliminarProductosTocket();
|
||||
ventanaPadre.llenarLayout();
|
||||
ventanaPadre.total = 0;
|
||||
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +125,7 @@ namespace compabetov2.Ventas
|
||||
"------------------------------------\n" +
|
||||
" Detalle envío:\n" +
|
||||
$" Cliente: {txtCliente.Text}\n" +
|
||||
$" Dirección: {txtDireccion.Text}\n" +
|
||||
$" Dirección: {AjustarDireccion(txtDireccion.Text)}\n" +//tengo duda aquí
|
||||
$" Teléfono: {txtTelefono.Text}";
|
||||
|
||||
|
||||
@@ -134,6 +136,29 @@ namespace compabetov2.Ventas
|
||||
// Imprimir el contenido
|
||||
e.Graphics.DrawString(contenido, fuente, Brushes.Black, posicion);
|
||||
}
|
||||
private string AjustarDireccion(string direccion)
|
||||
{
|
||||
const int maxCaracteresPorLinea = 8;
|
||||
|
||||
// Verifica la longitud de la dirección
|
||||
if (direccion.Length > maxCaracteresPorLinea)
|
||||
{
|
||||
// Inserta un salto de línea después de 8 caracteres
|
||||
int segmentos = direccion.Length / maxCaracteresPorLinea;
|
||||
string direccionFormateada = "";
|
||||
|
||||
for (int i = 0; i < segmentos; i++)
|
||||
{
|
||||
int inicio = i * maxCaracteresPorLinea;
|
||||
direccionFormateada += direccion.Substring(inicio, maxCaracteresPorLinea) + "\n";
|
||||
}
|
||||
|
||||
return direccionFormateada;
|
||||
}
|
||||
|
||||
// Devuelve la dirección sin cambios si no se necesita ajustar
|
||||
return direccion;
|
||||
}
|
||||
|
||||
public void ImprimirTicketEnvio()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user