/// <summary> /// Inicializa el formulario para agregarle la nota a un delivery. /// </summary> /// <param name="_ID_Pedido">ID del pedido.</param> /// <param name="_FormCrearEditarDelivery">Instancia del formulario que necesita reicibir los cambios.</param> public FrmAgregarNotaPedidos(int _ID_Pedido, FrmCrearEditarDelivery _FormCrearEditarDelivery) { InitializeComponent(); ID_Pedido = _ID_Pedido; FormCrearEditarDelivery = _FormCrearEditarDelivery; }
public void BtnCrearDelivery_Click(object sender, EventArgs e) { using (FrmCrearEditarDelivery FormCrearEditarDelivery = new FrmCrearEditarDelivery()) { FormCrearEditarDelivery.ShowDialog(); DeliveryPendientes(); } }
private void DgvDelivery_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView DetectarTipoCasilla = (DataGridView)sender; if (!(DetectarTipoCasilla.Columns[e.ColumnIndex] is DataGridViewButtonColumn) && !(DetectarTipoCasilla.Columns[e.ColumnIndex] is DataGridViewCheckBoxColumn) && e.RowIndex >= 0) { string InformacionDelError = string.Empty; ClsPedidos Pedidos = new ClsPedidos(); Pedido InformacionDelPedido = new Pedido(); InformacionDelPedido = Pedidos.LeerPorNumero((int)dgvDelivery.Rows[e.RowIndex].Cells[(int)ENumColDGVDelivery.ID_Pedido].Value, ref InformacionDelError); if (InformacionDelPedido != null) { using (FrmCrearEditarDelivery FormCrearEditarDelivery = new FrmCrearEditarDelivery((int)dgvDelivery.Rows[e.RowIndex].Cells[(int)ENumColDGVDelivery.ID_Delivery].Value, (int)dgvDelivery.Rows[e.RowIndex].Cells[(int)ENumColDGVDelivery.ID_Pedido].Value, InformacionDelPedido.ID_Chef)) { if (InformacionDelPedido.ID_EstadoPedido != (int)ClsEstadosPedidos.EEstadosPedidos.Entregado) { if (InformacionDelPedido.Delivery.ID_EstadoDelivery == (int)ClsEstadosDeliveries.EEstadosDeliveries.EnCocina) { FormCrearEditarDelivery.ShowDialog(); DeliveryPendientes(); } else { using (FrmInformacion FormInformacion = new FrmInformacion($"No puede editar el delivery con fecha {InformacionDelPedido.Fecha.ToShortDateString()} " + $"a las {InformacionDelPedido.Hora.ToString(@"hh\:mm")} del cliente {InformacionDelPedido.Cliente.Nombre} {InformacionDelPedido.Cliente.Apellido} " + $"porque ya fue confirmado su estado o fue eliminado.", ClsColores.Blanco, 300, 350)) { FormInformacion.ShowDialog(); } } } else { using (FrmInformacion FormInformacion = new FrmInformacion($"No puede editar el delivery con fecha {InformacionDelPedido.Fecha.ToShortDateString()} " + $"a las {InformacionDelPedido.Hora.ToString(@"hh\:mm")} del cliente {InformacionDelPedido.Cliente.Nombre} {InformacionDelPedido.Cliente.Apellido} " + $"porque ya fue indicado como finalizado desde cocina.", ClsColores.Blanco, 300, 350)) { FormInformacion.ShowDialog(); } } } } else if (InformacionDelError == string.Empty) { FrmPrincipal.ObtenerInstancia().MensajeAdvertencia("Ocurrio un fallo al buscar el pedido"); MessageBox.Show($"Ocurrio un fallo al buscar el pedido", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { FrmPrincipal.ObtenerInstancia().MensajeAdvertencia("Ocurrio un fallo al buscar el pedido"); MessageBox.Show($"{InformacionDelError}", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
/// <summary>Inicializa la variable que contendra la instancia del formulario de administracion de reservas.</summary> /// <param name="_FormCrearEditarDelivery">Instancia del formulario.</param> public void AsignarFormCrearDelivery(FrmCrearEditarDelivery _FormCrearEditarDelivery) => FormCrearEditarDelivery = _FormCrearEditarDelivery;