public frmAperturarCaja(Empleado empleado) { try { InitializeComponent(); this.empleado = empleado; this.turnoxempleado = TurnoXEmpleadoBL.findTurnoXEmpleado(empleado.Id); this.txtMontoInicialSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtMontoInicialDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtMontoInicialSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos); this.txtMontoInicialDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos); inicializarCampos(); cajaSeleccionada = null; tipoCambio = new TipoCambioBL().DameUltimo(); if (continuar) { if (!ValidarTurnos()) { Utils.Utils.Error(null, "Su turno de trabajo aun no empieza"); this.continuar = false; this.Dispose(); } } else this.Dispose(); } catch (Exception exception) { Utils.Utils.Error(null, "EL empleado no tiene turno asignado"); continuar = false; } }
private void btnAceptar_Click(object sender, EventArgs e) { List<TurnoXEmpleado> listaTEs = new List<TurnoXEmpleado>(); for (int i = 1; i < 7; i++) { for (int j = 0; j < 3; j++) { if ((bool)dgvTurnos.Rows[j].Cells[i].Value == true) { Turno turno = turnos[((i - 1) * 3) + j]; TurnoXEmpleado turEmp = new TurnoXEmpleado(); turEmp.Empleado = empleado; turEmp.FechaAsignacion = DateTime.Now; turEmp.Turno = turno; listaTEs.Add(turEmp); } } } if (TurnoXEmpleadoBL.Grabar(listaTEs)) { Utils.Utils.Mensaje("Modificación Exitosa", MessageBoxButtons.OK, MessageBoxIcon.None); } else { Utils.Utils.Error(null, "No se pudo hacer la Actualizacion"); } }
public RegistroCaja find(TurnoXEmpleado turnoxempleado, Caja caja) { try { RegistroCajaDA registroCajaDA = new RegistroCajaDA(); return registroCajaDA.findRegistroCajaAbierto(turnoxempleado.Id, caja.Id); } catch (Exception) { return null; } }
public frmCerrarCaja(Empleado empleado, TurnoXEmpleado turnoxempleado, RegistroCaja registroCaja, Caja caja, TipoCambio tipoCambio) { InitializeComponent(); this.turnoxempleado = turnoxempleado; this.registroCaja = registroCaja; this.caja = caja; this.tipoCambio = tipoCambio; this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtSaldoSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos); this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos); this.empleado = empleado; }
public static void Grabar(TurnoXEmpleado turEmp) { try { if (turEmp.Id == 0) { new TurnoXEmpleadoDA().Save(turEmp); return ; } else { new TurnoXEmpleadoDA().Update(turEmp); return ; } } catch (Exception E) { return; } }
public void Update(TurnoXEmpleado turEmp) { ISession hisession = null; try { hisession = NHibernateHelper.GetCurrentSession(); hisession.BeginTransaction(); hisession.Merge(turEmp); hisession.Transaction.Commit(); hisession.Close(); } catch (Exception ex) { if (hisession != null) { if (hisession.IsOpen) { hisession.Close(); } } } }
public RegistroCaja find(TurnoXEmpleado turnoxempleado, Caja caja) { RegistroCajaDA registroCajaDA = new RegistroCajaDA(); return registroCajaDA.findRegistroCajaAbierto(turnoxempleado.Id, caja.Id); }
private void frmCerrarCaja_Load(object sender, EventArgs e) { try { this.turnoxempleado = new TurnoXEmpleadoBL().findTurnoXEmpleado(empleado.Id); caja = new RegistroCajaBL().DameCaja(empleado); registroCaja = new RegistroCajaBL().find(turnoxempleado,caja); InicializarRegistroCaja(); InicializarCampos(); }catch(Exception exception){this.Dispose();} }
public bool ValidarTurnos() { bool aux=false; IList<TurnoXEmpleado> turnosE = TurnoXEmpleadoBL.findTurnoXEmpleadoAll(empleado.Id); foreach (TurnoXEmpleado te in turnosE) { turnoxempleado = te; if (ValidarTurno()) { aux = true; break; } } return aux; }