private void ctacte_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F1) { AyudaCliente(""); // Despues de Que Vuelva del F1 ValidaCliente(); sys_localBL BL = new sys_localBL(); tb_sys_local BE = new tb_sys_local(); DataTable dt = new DataTable(); BE.ctacte = ctacte.Text.ToString(); dt = BL.GenCodigo(EmpresaID, BE).Tables[0]; item.Text = dt.Rows[0]["item"].ToString().PadLeft(3, '0'); direcnume.Focus(); } if (e.KeyCode == Keys.Enter) { // Primero Validar ValidaCliente(); sys_localBL BL = new sys_localBL(); tb_sys_local BE = new tb_sys_local(); DataTable dt = new DataTable(); BE.ctacte = ctacte.Text.ToString(); dt = BL.GenCodigo(EmpresaID, BE).Tables[0]; item.Text = dt.Rows[0]["item"].ToString().PadLeft(3, '0'); direcnume.Focus(); } }
private void btn_agregar_Click(object sender, EventArgs e) { direcnume.Text = ""; localname.Text = ""; direcnume.Enabled = true; canalventaid.Enabled = true; btn_cancelar.Enabled = true; btn_nuevo.Enabled = false; btn_editar.Enabled = false; sys_localBL BL = new sys_localBL(); tb_sys_local BE = new tb_sys_local(); DataTable dt = new DataTable(); if (ctacte.Text == "") { MessageBox.Show("No Existe la Cuenta Corriente Para Generar el Item !!!"); return; } BE.ctacte = ctacte.Text.ToString(); dt = BL.GenCodigo(EmpresaID, BE).Tables[0]; item.Text = dt.Rows[0]["item"].ToString().PadLeft(3, '0'); ssModo = "NEW"; btn_grabar.Enabled = true; estabsunat.Enabled = true; telf.Enabled = true; rpc.Enabled = true; email.Enabled = true; direcnume.Focus(); }