Version OScar

This commit is contained in:
Jorge Luis caudillo esparza
2026-04-24 07:54:31 -07:00
parent 8e3df951b3
commit 83acc6b4f1
3780 changed files with 7042960 additions and 0 deletions

View File

@@ -0,0 +1,225 @@
namespace ADSUtileriasWF.Views.PV.ControlUser
{
partial class UscComanda
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.Panel1 = new System.Windows.Forms.Panel();
this.lblTiempoPedido = new System.Windows.Forms.Label();
this.lblHoraPedido = new System.Windows.Forms.Label();
this.lblMesero = new System.Windows.Forms.Label();
this.lblMesa = new System.Windows.Forms.Label();
this.Panel2 = new System.Windows.Forms.Panel();
this.lblOrden = new System.Windows.Forms.Label();
this.dgComanda = new System.Windows.Forms.DataGridView();
this.Pedido = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Cantidad = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.EstatusEntrega = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CveVentaDetalleTerminal = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Panel1.SuspendLayout();
this.Panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgComanda)).BeginInit();
this.SuspendLayout();
//
// Panel1
//
this.Panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Panel1.Controls.Add(this.lblTiempoPedido);
this.Panel1.Controls.Add(this.lblHoraPedido);
this.Panel1.Controls.Add(this.lblMesero);
this.Panel1.Controls.Add(this.lblMesa);
this.Panel1.Location = new System.Drawing.Point(1, 1);
this.Panel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(256, 69);
this.Panel1.TabIndex = 0;
//
// lblTiempoPedido
//
this.lblTiempoPedido.AutoSize = true;
this.lblTiempoPedido.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.lblTiempoPedido.Location = new System.Drawing.Point(97, 37);
this.lblTiempoPedido.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblTiempoPedido.Name = "lblTiempoPedido";
this.lblTiempoPedido.Size = new System.Drawing.Size(91, 16);
this.lblTiempoPedido.TabIndex = 5;
this.lblTiempoPedido.Text = "HoraPedido";
//
// lblHoraPedido
//
this.lblHoraPedido.AutoSize = true;
this.lblHoraPedido.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.lblHoraPedido.Location = new System.Drawing.Point(4, 37);
this.lblHoraPedido.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblHoraPedido.Name = "lblHoraPedido";
this.lblHoraPedido.Size = new System.Drawing.Size(73, 16);
this.lblHoraPedido.TabIndex = 4;
this.lblHoraPedido.Text = "(22:19:32)";
//
// lblMesero
//
this.lblMesero.AutoSize = true;
this.lblMesero.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.lblMesero.Location = new System.Drawing.Point(117, 7);
this.lblMesero.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblMesero.Name = "lblMesero";
this.lblMesero.Size = new System.Drawing.Size(65, 18);
this.lblMesero.TabIndex = 3;
this.lblMesero.Text = "Mesero";
//
// lblMesa
//
this.lblMesa.AutoSize = true;
this.lblMesa.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.lblMesa.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lblMesa.Location = new System.Drawing.Point(4, 7);
this.lblMesa.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblMesa.Name = "lblMesa";
this.lblMesa.Size = new System.Drawing.Size(54, 18);
this.lblMesa.TabIndex = 2;
this.lblMesa.Text = "Mesa:";
//
// Panel2
//
this.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Panel2.Controls.Add(this.lblOrden);
this.Panel2.Location = new System.Drawing.Point(262, 1);
this.Panel2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.Panel2.Name = "Panel2";
this.Panel2.Size = new System.Drawing.Size(70, 69);
this.Panel2.TabIndex = 1;
//
// lblOrden
//
this.lblOrden.AutoSize = true;
this.lblOrden.Dock = System.Windows.Forms.DockStyle.Right;
this.lblOrden.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.lblOrden.Location = new System.Drawing.Point(25, 0);
this.lblOrden.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblOrden.Name = "lblOrden";
this.lblOrden.Size = new System.Drawing.Size(43, 46);
this.lblOrden.TabIndex = 2;
this.lblOrden.Text = "1";
//
// dgComanda
//
this.dgComanda.AllowUserToAddRows = false;
this.dgComanda.AllowUserToDeleteRows = false;
this.dgComanda.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgComanda.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgComanda.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Pedido,
this.Cantidad,
this.EstatusEntrega,
this.CveVentaDetalleTerminal});
this.dgComanda.Location = new System.Drawing.Point(1, 75);
this.dgComanda.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.dgComanda.Name = "dgComanda";
this.dgComanda.ReadOnly = true;
this.dgComanda.RowHeadersVisible = false;
this.dgComanda.Size = new System.Drawing.Size(331, 380);
this.dgComanda.TabIndex = 2;
this.dgComanda.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgComanda_CellClick);
//
// Pedido
//
this.Pedido.DataPropertyName = "PSConCaracteristicas";
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.Pedido.DefaultCellStyle = dataGridViewCellStyle1;
this.Pedido.FillWeight = 142.132F;
this.Pedido.HeaderText = "Pedido";
this.Pedido.Name = "Pedido";
this.Pedido.ReadOnly = true;
//
// Cantidad
//
this.Cantidad.DataPropertyName = "Cantidad";
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle2.Format = "N";
this.Cantidad.DefaultCellStyle = dataGridViewCellStyle2;
this.Cantidad.FillWeight = 57.86803F;
this.Cantidad.HeaderText = "Cant.";
this.Cantidad.Name = "Cantidad";
this.Cantidad.ReadOnly = true;
//
// EstatusEntrega
//
this.EstatusEntrega.DataPropertyName = "EstatusEntrega";
this.EstatusEntrega.HeaderText = "EstatusEntrega";
this.EstatusEntrega.Name = "EstatusEntrega";
this.EstatusEntrega.ReadOnly = true;
this.EstatusEntrega.Visible = false;
//
// CveVentaDetalleTerminal
//
this.CveVentaDetalleTerminal.DataPropertyName = "CveVentaDetalleTerminal";
this.CveVentaDetalleTerminal.HeaderText = "CveVentaDetalleTerminal";
this.CveVentaDetalleTerminal.Name = "CveVentaDetalleTerminal";
this.CveVentaDetalleTerminal.ReadOnly = true;
this.CveVentaDetalleTerminal.Visible = false;
//
// UscComanda
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.dgComanda);
this.Controls.Add(this.Panel2);
this.Controls.Add(this.Panel1);
this.Margin = new System.Windows.Forms.Padding(1);
this.Name = "UscComanda";
this.Size = new System.Drawing.Size(332, 455);
this.Load += new System.EventHandler(this.controlComanda_Load);
this.Panel1.ResumeLayout(false);
this.Panel1.PerformLayout();
this.Panel2.ResumeLayout(false);
this.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgComanda)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel Panel1;
private System.Windows.Forms.Label lblTiempoPedido;
private System.Windows.Forms.Label lblHoraPedido;
private System.Windows.Forms.Label lblMesero;
private System.Windows.Forms.Label lblMesa;
private System.Windows.Forms.Panel Panel2;
private System.Windows.Forms.Label lblOrden;
private System.Windows.Forms.DataGridView dgComanda;
private System.Windows.Forms.DataGridViewTextBoxColumn Pedido;
private System.Windows.Forms.DataGridViewTextBoxColumn Cantidad;
private System.Windows.Forms.DataGridViewTextBoxColumn EstatusEntrega;
private System.Windows.Forms.DataGridViewTextBoxColumn CveVentaDetalleTerminal;
}
}

View File

@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using ADSUtileriasWF.Data.Externa.PV;
using System.Linq;
using ADSUtileriasWF.Helpers;
namespace ADSUtileriasWF.Views.PV.ControlUser
{
public partial class UscComanda : UserControl
{
public UscComanda()
{
InitializeComponent();
}
private void controlComanda_Load(object sender, EventArgs e)
{
SetUpEventHandler();
// Me.Visible = False
dgComanda.AutoGenerateColumns = false;
// dgComanda.AutoResizeRow(0, DataGridViewAutoSizeRowMode.AllCellsExceptHeader)
}
public void CargaComanda(int CveVentaTerminal, int CveCategoria)
{
var SS = new Stopwatch();
SS.Start();
var objVenta = new ClsVentas();
if (objVenta.GetVentasDetalle(CveVentaTerminal, WCF_PV.ClsVentasEstatusEntrega.Todas))
{
if (objVenta.DtResultados.Tabla.Rows.Count > 0)
{
dgComanda.DataSource = objVenta.DtResultados.Tabla.FiltraParametros("EstatusEntrega in (1, 2) and EsPromocion = 0 and CveCategoria = " + CveCategoria.ToString());
lblOrden.Text = objVenta.DtResultados.Tabla.Rows[0]["ComandaOrden"].ToString();
foreach (DataGridViewRow Row in dgComanda.Rows)
{
switch (Row.Cells["EstatusEntrega"].Value)
{
case WCF_PV.ClsVentasEstatusEntrega.Solicitado:
{
Row.DefaultCellStyle.BackColor = Color.White;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.EnProceso:
{
Row.DefaultCellStyle.BackColor = Color.LightGreen;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.Preparado:
{
Row.DefaultCellStyle.BackColor = Color.Orange;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.Entregado:
{
Row.DefaultCellStyle.BackColor = Color.Yellow;
break;
}
}
}
if (objVenta.GetVentas(CveVentaTerminal, -1, -1, "-1", -1, -1, ModVarsPV.UsuarioActual.CveEmpresa, EstatusVentaTerminal.Todas))
{
if (objVenta.CveVentaTerminal > 0)
{
lblMesa.Text = objVenta.Mesa;
lblMesero.Text = objVenta.Vendedor;
lblHoraPedido.Text = objVenta.FechaApertura.ToString("HH:mm:ss");
lblTiempoPedido.Text = string.Format("{0} Minutos",(DateTime.Now -objVenta.FechaApertura).TotalMinutes); //DateDiff(DateInterval.Minute, objVenta.FechaApertura, DateAndTime.Now).ToEntero
}
}
}
}
objVenta.Dispose();
SS.Stop();
// MessageBox.Show(SS.ElapsedMilliseconds)
this.Visible = true;
}
private int GetDataGridViewHeight(DataGridView dataGridView)
{
var sum = dataGridView.ColumnHeadersVisible ? dataGridView.ColumnHeadersHeight : 0 + dataGridView.Rows.OfType<DataGridViewRow>().Where(r => r.Visible).Sum(r => r.Height);
return sum;
}
private void dgComanda_CellClick(object sender, DataGridViewCellEventArgs e)
{
switch (dgComanda.Rows[e.RowIndex].Cells["EstatusEntrega"].Value)
{
case WCF_PV.ClsVentasEstatusEntrega.Solicitado:
{
dgComanda.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightGreen;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.EnProceso:
{
dgComanda.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Orange;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.Preparado:
{
dgComanda.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Yellow;
break;
}
case WCF_PV.ClsVentasEstatusEntrega.Entregado:
{
dgComanda.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White;
break;
}
}
EnSeleccion?.Invoke(dgComanda.Rows[e.RowIndex].Cells["CveVentaDetalleTerminal"].Value.ToString().ToEntero());
}
public event EnSeleccionEventHandler EnSeleccion;
public delegate void EnSeleccionEventHandler(int CveVentaDetalleTerminal);
public void HandleEnSeleccion(int CveVentaDetalleTerminal)
{
// Perform desired processing for when time has expired.
// MsgBox("HandleTimeExpired caught the TimeExpired event" & _
// vbCrLf & "Status = " & Status)
}
public void SetUpEventHandler()
{
EnSeleccion += HandleEnSeleccion;
}
}
}

View File

@@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>