private string ValidarCorteFracc(bool lCuadreCaja) { string cRpta = "OK"; string msge = ""; string cCorFra = new clsInicioCuadreOperaciones().ValidaCorteFracc(DateTime.Today, idUsuario, ref msge); if (msge == "OK") { if (cCorFra != "0" && lCuadreCaja == false) { MyMessageBox.Show("Ya Realizó su Corte Fraccionario", "Validar Corte Fraccionario", MessageBoxButtons.OK, MessageBoxIcon.Information); dtgMoneda.Enabled = false; dtgBillete.Enabled = false; dtgBilletesDolares.Enabled = false; btnGrabarBilletaje.Enabled = false; btnContinuar.Enabled = true; btnEditar.Enabled = true; cRpta = "ERROR"; } if (cCorFra == "0" && lCuadreCaja == true) { MyMessageBox.Show("Primero debe Realizar su Corte Fraccionario... por Favor..", "Validar Corte Fraccionario", MessageBoxButtons.OK, MessageBoxIcon.Information); cRpta = "ERROR"; } } else { MyMessageBox.Show(msge, "Error al Validar Corte Fraccionario", MessageBoxButtons.OK, MessageBoxIcon.Error); cRpta = "ERROR"; } return(cRpta); }
private void frmInicioOperaciones_Load(object sender, EventArgs e) { btnGrabar.Enabled = true; VarGlobal.SysUser = new Usuario(); VarGlobal.SysUser.idUsuario = 1; pidUsuario = VarGlobal.SysUser.idUsuario; cUsuario = VarGlobal.SysUser.cNombre; DatosUsuario(); if (pidUsuario == 0) { MessageBox.Show("No existe usuario", "Validar Usuario", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); return; } DataTable tbSaldos = new clsInicioCuadreOperaciones().SaldoIniOpe(DateTime.Today, 1); if (tbSaldos.Rows.Count > 0) { txtInicioSoles.Text = tbSaldos.Rows[0]["nMontoCieSol"].ToString(); txtInicioDolares.Text = tbSaldos.Rows[1]["nMontoCieDol"].ToString(); } else { txtInicioSoles.Text = "0.00"; txtInicioDolares.Text = "0.00"; } //=========================================================== //--Validar Inicio de Operaciones //=========================================================== string cRpta = ValidarInicioOpeCaj(); switch (cRpta) // Si Estado es: F--> Falta Iniciar, A--> Caja Abierta, C--> Caja Cerrada { case "F": break; case "A": MessageBox.Show("El Usuario ya Inicio sus Operaciones", "Validar Inicio de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); return; case "C": MessageBox.Show("El Usuario ya Cerro sus Operaciones", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); return; default: MessageBox.Show(cRpta, "Error al Validar Estado de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Dispose(); return; } }
private void DatosUsuario() { dtpFechaCuadre.Value = DateTime.Today; txtUsuario.Text = "";// VarGlobal.SysUser.cApellidos; DataTable DatosCli = new clsInicioCuadreOperaciones().ListaUsuario(idUsuario, "D"); if (DatosCli.Rows.Count > 0) { txtUsuario.Text = DatosCli.Rows[0]["cNombre"].ToString(); } else { txtUsuario.Text = ""; } }
private void DatosUsuario() { dtpFechaInicio.Value = DateTime.Today; txtUsuario.Text = cUsuario; DataTable DatosCli = new clsInicioCuadreOperaciones().ListaUsuario(pidUsuario, "D"); if (DatosCli.Rows.Count > 0) { txtUsuario.Text = DatosCli.Rows[0]["cNombre"].ToString(); } else { txtUsuario.Text = ""; } }
private void btnGrabar_Click(object sender, EventArgs e) { var Msg = MessageBox.Show("Esta seguro de Realizar el Inicio de Operaciones?...", "Inicio de Operaciones", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (Msg == DialogResult.Yes) { string Rpta; double nMonSol = Convert.ToDouble(txtInicioSoles.Text); double nMonDol = Convert.ToDouble(txtInicioDolares.Text); Rpta = new clsInicioCuadreOperaciones().GuardaIniOpe(DateTime.Today, pidUsuario, nMonSol, nMonDol); if (Rpta == "OK") { MessageBox.Show("El Inicio de Operaciones se Realizó Correctamente...", "Inicio de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information); btnGrabar.Enabled = false; } else { MessageBox.Show(Rpta, "Inicio de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private string SalIniOpe() { string msge = ""; //===================================================================== //---Ingresos en Soles //===================================================================== DataTable tbSalIniOpe = new clsInicioCuadreOperaciones().SaldoinicialOpe(DateTime.Today, idUsuario, ref msge); if (msge == "OK") { if (tbSalIniOpe.Rows.Count > 0) { this.txtMontoInicioSoles.Text = tbSalIniOpe.Rows[0]["nSalIniSol"].ToString(); this.txtInicioDolares.Text = tbSalIniOpe.Rows[0]["nSalIniDol"].ToString(); } } else { return(msge); // MyMessageBox.Show(msge, "Error al Extraer El Saldo Inicial...", MessageBoxButtons.OK, MessageBoxIcon.Error); } return("OK"); }
private string VerificaCierreOpe() { string cRpta = ""; string msg = ""; DataTable tbvalcierre = new clsInicioCuadreOperaciones().ValidarCierreOpe(DateTime.Today, idUsuario, ref msg); if (msg == "OK") { if (tbvalcierre.Rows.Count > 0) { for (int i = 0; i < tbvalcierre.Rows.Count; i++) { cRpta = cRpta + tbvalcierre.Rows[i]["cNombre"].ToString() + " ;"; } cRpta = "FALTA QUE CIERREN CAJA: " + cRpta; MyMessageBox.Show(cRpta, "Validar Cierre de Caja", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { cRpta = "OK"; } } return(cRpta); }
private string ValidarInicioOpeCaj() { string cEstCie = new clsInicioCuadreOperaciones().ValIniOpeCaja(DateTime.Today, clsVarGlobal.User.idUsuario).Rows[0][0].ToString(); return(cEstCie); }
private void btnGrabarBilletaje_Click(object sender, EventArgs e) { var Msg = MyMessageBox.Show("Esta Seguro de Registrar su Corte Fraccionario?...", "Registrar Corte Fraccionario", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (Msg == DialogResult.No) { return; } //=================================================================== //Guardar Datos de Monedas Mediante XML //=================================================================== DataSet dsMonSol = new DataSet("dsMonSol"); dsMonSol.Tables.Add(tbMonSol); string xmlMonSol = dsMonSol.GetXml(); xmlMonSol = clsFormatoXML.EncodingXML(xmlMonSol); dsMonSol.Tables.Clear(); //=================================================================== //Guardar Datos de Billetes Soles Mediante XML //=================================================================== DataSet dsBillSol = new DataSet("dsBillSol"); dsBillSol.Tables.Add(tbBillSol); string xmlBillSol = dsBillSol.GetXml(); xmlBillSol = clsFormatoXML.EncodingXML(xmlBillSol); dsBillSol.Tables.Clear(); //=================================================================== //Guardar Datos de Billetes Dol Mediante XML //=================================================================== DataSet dsBillDol = new DataSet("dsBillDol"); dsBillDol.Tables.Add(tbBillDol); string xmlBillDol = dsBillDol.GetXml(); xmlBillDol = clsFormatoXML.EncodingXML(xmlBillDol); dsBillDol.Tables.Clear(); //================================================== //--Grabar Corte Fraccionario //================================================== string cRpta = new clsInicioCuadreOperaciones().registroCorFrac(idUsuario, DateTime.Today, xmlMonSol, xmlBillSol, xmlBillDol); if (cRpta == "OK") { MyMessageBox.Show("El Corte Fraccionario se Registro Correctamente...", "Registro de Corte Fraccionario", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MyMessageBox.Show(cRpta, "Error en Registro de Corte Fraccionario", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.btnGrabarBilletaje.Enabled = false; this.dtgMoneda.Enabled = false; this.dtgBillete.Enabled = false; this.dtgBilletesDolares.Enabled = false; this.btnContinuar.Enabled = true; this.btnEditar.Enabled = true; }
private string SaldoCorteFraccionario() { double nMonSoles = 0.00, nMonDolar = 0.00; string cRpta = new clsInicioCuadreOperaciones().RetMontoCorFracc(DateTime.Today, idUsuario, ref nMonSoles, ref nMonDolar); if (cRpta == "OK") { this.txtSaldoCortSoles.Text = nMonSoles.ToString(); this.txtSaldoCortDolares.Text = nMonDolar.ToString(); this.txtDiferencia.Text = Convert.ToString(Math.Round((Math.Round(nMonSoles, 2) - Math.Round(Convert.ToDouble(this.txtSaldoSoles.Text), 2)), 2)); this.txtDiferenciaDolares.Text = Convert.ToString(Math.Round((Math.Round(nMonDolar, 2) - Math.Round(Convert.ToDouble(this.txtSaldoOpeDolares.Text), 2)), 2)); //========================================================================= //-----Validar Cierre de Operaciones en Soles //========================================================================= double nDifSol = Math.Round(Convert.ToDouble(this.txtDiferencia.Text), 2); if (nDifSol == 0) { this.lblSoles.Text = "CIERRE EN SOLES OK..."; this.lblSoles.ForeColor = Color.Blue; } else { if (nDifSol > 0) { this.lblSoles.Text = "EXISTE DIFERENCIAS, VERIFICAR!!! (Emitir Recibo de INGRESO por SOBRANTE)"; this.lblSoles.ForeColor = Color.Red; } else { this.lblSoles.Text = "EXISTE DIFERENCIAS, VERIFICAR!!! (Emitir Recibo de EGRESO por FALTANTE)"; this.lblSoles.ForeColor = Color.Red; } } //========================================================================= //-----Validar Cierre de Operaciones en Dólares //========================================================================= double nDifDol = Math.Round(Convert.ToDouble(this.txtDiferenciaDolares.Text), 2); if (nDifDol == 0) { this.lblDolares.Text = "CIERRE EN DÓLARES OK..."; this.lblDolares.ForeColor = Color.Blue; } else { if (nDifDol > 0) { this.lblDolares.Text = "EXISTE DIFERENCIAS, VERIFICAR!!! (Emitir Recibo de INGRESO por SOBRANTE)"; this.lblDolares.ForeColor = Color.Red; } else { this.lblDolares.Text = "EXISTE DIFERENCIAS, VERIFICAR!!! (Emitir Recibo de EGRESO por FALTANTE)"; this.lblDolares.ForeColor = Color.Red; } } } else { return(cRpta); //MyMessageBox.Show(cRpta, "Error al Extraer El Saldo Inicial...", MessageBoxButtons.OK, MessageBoxIcon.Error); } return("OK"); }
private void btnGrabarCuadre_Click(object sender, EventArgs e) { //=================================================================== //--Validar Datos del Cuadre //=================================================================== if (Convert.ToDouble(this.txtSaldoSoles.Text) < 0) { MyMessageBox.Show("El Saldo Final en SOLES NO Puede ser NEGATIVO: VERIFICAR...", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (Convert.ToDouble(this.txtSaldoOpeDolares.Text) < 0) { MyMessageBox.Show("El Saldo Final en DÓLARES, NO Puede ser NEGATIVO: VERIFICAR...", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (Convert.ToDouble(this.txtDiferencia.Text) != 0) { MyMessageBox.Show("Existe Diferencia en SOLES entre el CORTE FRACCIONARIO y CUADRE CAJA.. VERIFICAR...", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (Convert.ToDouble(this.txtDiferenciaDolares.Text) != 0) { MyMessageBox.Show("Existe Diferencia en DOLARES entre el CORTE FRACCIONARIO y CUADRE CAJA.. VERIFICAR...", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //=================================================================== //Guardar Datos de Ingreso en Soles XML //=================================================================== DataSet dsIngSol = new DataSet("dsIngSol"); dsIngSol.Tables.Add(tbIngSol); string xmlIngSol = dsIngSol.GetXml(); xmlIngSol = clsFormatoXML.EncodingXML(xmlIngSol); dsIngSol.Tables.Clear(); //=================================================================== //Guardar Datos de Egresos en Soles XML //=================================================================== DataSet dsEgrSol = new DataSet("dsEgrSol"); dsEgrSol.Tables.Add(tbEgrSol); string xmlEgrSol = dsEgrSol.GetXml(); xmlEgrSol = clsFormatoXML.EncodingXML(xmlEgrSol); dsEgrSol.Tables.Clear(); //=================================================================== //Guardar Datos de ingreso en Dólares XML //=================================================================== DataSet dsIngDol = new DataSet("dsIngDol"); dsIngDol.Tables.Add(tbIngDol); string xmlIngDol = dsIngDol.GetXml(); xmlIngDol = clsFormatoXML.EncodingXML(xmlIngDol); dsIngDol.Tables.Clear(); //=================================================================== //Guardar Datos de Egresos en Dolares XML //=================================================================== DataSet dsEgrDol = new DataSet("dsEgrDol"); dsEgrDol.Tables.Add(tbEgrDol); string xmlEgrDol = dsEgrDol.GetXml(); xmlEgrDol = clsFormatoXML.EncodingXML(xmlEgrDol); dsEgrDol.Tables.Clear(); //================================================== //--Grabar Cuadre Operaciones //================================================== double nSalIniSol = Convert.ToDouble(this.txtMontoInicioSoles.Text); double nSalIniDol = Convert.ToDouble(this.txtInicioDolares.Text); double nSalFinSol = Convert.ToDouble(this.txtSaldoSoles.Text); double nSalFinDol = Convert.ToDouble(this.txtDiferenciaDolares.Text); string cRpta = new clsInicioCuadreOperaciones().RegCierreOperaciones(DateTime.Today, idUsuario, nSalIniSol, nSalIniDol, nSalFinSol, nSalFinDol, xmlIngSol, xmlEgrSol, xmlIngDol, xmlEgrDol); if (cRpta == "OK") { MyMessageBox.Show("El Cierre de Operaciones se Realizó Correctamente...", "Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information); //================================================== //--Actualizar Cierre //================================================== ActualizarCierre(); } else { MyMessageBox.Show(cRpta, "Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.btnGrabarCuadre.Enabled = false; btnAtras.Enabled = false; }