private bool cajacerrada() { bool lSigo = false; try { var BE = new tb_t1_caja(); var BL = new tb_t1_cajaBL(); DataTable dt = new DataTable(); BE.moduloid = modulo.ToString(); BE.local = local.ToString(); BE.fecha = Convert.ToDateTime(fechdoc.Text); dt = BL.GetAllCab(VariablesPublicas.EmpresaID, BE).Tables[0]; if (dt.Rows.Count>0) { lSigo = Convert.ToBoolean(dt.Rows[0]["cerrado"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return lSigo; }
private void ConsultaDatos() { var BE = new tb_t1_caja(); var BL = new tb_t1_cajaBL(); var dt = new DataTable(); BE.moduloid = modulo; BE.local = local; BE.fecha = Convert.ToDateTime(fecha.Text); dt = BL.GetAllCab(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { loc_id.Text = dt.Rows[0]["local"].ToString().Trim(); ValidaLocal(loc_id.Text); idadmin.Text = dt.Rows[0]["adminid"].ToString().Trim(); ValidaPersona(idadmin.Text); idcajero.Text = dt.Rows[0]["cajeroid"].ToString().Trim(); ValidaPerson2(idcajero.Text); chkcerrado.Checked = Convert.ToBoolean(dt.Rows[0]["cerrado"].ToString() == "True" ? 1 : 0); btnNew.Enabled = false; btnEdit.Enabled = !Convert.ToBoolean(dt.Rows[0]["cerrado"].ToString() == "True" ? 1 : 0); idadmin.Enabled = false; idcajero.Enabled = false; txttcambio.Enabled = false; } else { bloquear(false); } fecha.Enabled = true; }
private void get_cajas() { try { var BE = new tb_t1_caja(); var BL = new tb_t1_cajaBL(); BE.moduloid = modulo.ToString(); BE.local = local.ToString(); gridControl1.DataSource = BL.GetAllCab(VariablesPublicas.EmpresaID, BE).Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }