private void set_Info_en_Controles() { try { if (InfoCbteCble != null) { if (InfoCbteCble.IdCbteCble != 0) { ct_Cbtecble_det_Bus _CbteCbleBus = new ct_Cbtecble_det_Bus(); List <ct_Cbtecble_det_Info> lm = new List <ct_Cbtecble_det_Info>(); lbl_no_comprobante.Text = InfoCbteCble.IdCbteCble.ToString(); txt_codCbteCble.Text = InfoCbteCble.CodCbteCble.ToString(); cmb_tipocomprobante.EditValue = InfoCbteCble.IdTipoCbte; ct_Cbtecble_tipo_Info a = List_Tipo_Comprobante.FirstOrDefault(q => q.IdTipoCbte == InfoCbteCble.IdTipoCbte); dtFecha.Value = InfoCbteCble.cb_Fecha; txt_concepto.Text = InfoCbteCble.cb_Observacion; UC_Diario.setInfo(param.IdEmpresa, InfoCbteCble.IdTipoCbte, InfoCbteCble.IdCbteCble); ct_cbtecble_Reversado_Bus BusReverso = new ct_cbtecble_Reversado_Bus(); var DiarioReverso = BusReverso.Get_Info_cbtecble_Reversado(param.IdEmpresa, InfoCbteCble.IdTipoCbte, InfoCbteCble.IdCbteCble); if (DiarioReverso.IdCbteCble_Anu != 0) { lblEstado.Text = "Reversado Con el Diario # " + DiarioReverso.IdCbteCble_Anu.ToString(); lblEstado.Visible = true; } } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void set_Accion_x_Controles() { try { switch (_Accion) { case Cl_Enumeradores.eTipo_action.grabar: ucGe_Menu.Visible_bntImprimir = false; ucGe_Menu.Visible_bntAnular = false; ucGe_Menu.Visible_bntGuardar_y_Salir = true; ucGe_Menu.Visible_btnGuardar = true; UC_Diario.setAccion(Cl_Enumeradores.eTipo_action.grabar); cmb_sucursal.EditValue = param.IdSucursal; break; case Cl_Enumeradores.eTipo_action.actualizar: this.Text = this.Text + "***Actualizar***"; ucGe_Menu.Visible_bntImprimir = true; this.Text = this.Text + "***Guardar***"; cmb_tipocomprobante.Enabled = false; cmb_tipocomprobante.ForeColor = Color.Black; ucGe_Menu.Visible_bntAnular = false; UC_Diario.setAccion(Cl_Enumeradores.eTipo_action.actualizar); set_Info_en_Controles(); ucGe_Menu.Visible_bntGuardar_y_Salir = true; ucGe_Menu.Visible_btnGuardar = true; break; case Cl_Enumeradores.eTipo_action.Anular: this.Text = this.Text + "***Anular***"; ucGe_Menu.Visible_bntImprimir = false; ucGe_Menu.Visible_bntGuardar_y_Salir = false; ucGe_Menu.Visible_btnGuardar = false; inhabilitar(); UC_Diario.setAccion(Cl_Enumeradores.eTipo_action.Anular); set_Info_en_Controles(); break; case Cl_Enumeradores.eTipo_action.consultar: this.Text = this.Text + "***Consulta***"; inhabilitar(); UC_Diario.setAccion(Cl_Enumeradores.eTipo_action.consultar); set_Info_en_Controles(); break; default: break; } } catch (Exception ex) { } }
private Boolean Guardar() { Boolean res = false; try { string codContable2 = ""; res = Validar(); if (res) { get_CbteCbleInfo(); codContable2 = txt_codCbteCble.Text; double valorCbteCble = 0; valorCbteCble = UC_Diario.Get_ValorCbteCble(); decimal IdCbteCntable = 0; string msg = ""; res = BusCbteCble.GrabarDB(InfoCbteCble, ref IdCbteCntable, ref msg); if (res) { set_Info_en_Controles(); lbl_no_comprobante.Text = IdCbteCntable.ToString(); txt_codCbteCble.Text = (txt_codCbteCble.Text == "") ? InfoCbteCble.CodCbteCble : txt_codCbteCble.Text; MessageBox.Show("Grabado Comprobante Ok"); if (MessageBox.Show("¿Desear Imprimir el Comprobante..?", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { ucGe_Menu_event_btnImprimir_Click(new object(), new EventArgs()); } } else { MessageBox.Show(msg); } } return(res); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(res); }
private void LImpiarDatos() { try { InfoCbteCble = new ct_Cbtecble_Info(); this.cmb_tipocomprobante.EditValue = ""; lbl_no_comprobante.Text = ""; txt_codCbteCble.Text = ""; this.txt_concepto.Text = ""; UC_Diario.LimpiarGrid(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_bucarPLantilla_Click(object sender, EventArgs e) { try { ct_cbtecble_Plantilla_Info InfoPlan = new ct_cbtecble_Plantilla_Info(); if (txt_no_plantillacomprobante.Text == "0" || txt_no_plantillacomprobante.Text == "") { frmCon_cbtecble_Plantilla_Consulta frm = new frmCon_cbtecble_Plantilla_Consulta(); frm.LlamaOtraPantalla = true; frm.ShowDialog(); InfoCbteCble = frm.Get_Info_CbteCble(); } else { ct_cbtecble_Plantilla_Bus Pla_B = new ct_cbtecble_Plantilla_Bus(); InfoCbteCble = Pla_B.Get_Info_Plantilla_CbteCble(param.IdEmpresa, Convert.ToInt32(this.cmb_tipocomprobante.EditValue), Convert.ToDecimal(txt_no_plantillacomprobante.Text)); } if (InfoCbteCble != null) { if (InfoCbteCble.cb_Fecha != new DateTime(1, 1, 1)) { List <ct_Cbtecble_det_Info> lm = new List <ct_Cbtecble_det_Info>(); lm = InfoCbteCble._cbteCble_det_lista_info; this.cmb_tipocomprobante.EditValue = InfoCbteCble.IdTipoCbte; dtFecha.Value = InfoCbteCble.cb_Fecha; txt_concepto.Text = InfoCbteCble.cb_Observacion; UC_Diario.setDetalle(lm); } else { MessageBox.Show("Usted ha seleccionado mas de una plantilla, por favor intente de nuevo.", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); LImpiarDatos(); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ct_Cbtecble_Info get_CbteCbleInfo() { InfoCbteCble = new ct_Cbtecble_Info(); try { string codigo; string MensajeError = ""; InfoPeriodo = BusPeriodo.Get_Info_Periodo(param.IdEmpresa, dtFecha.Value, ref MensajeError); if (InfoPeriodo != null && InfoPeriodo.pe_cerrado != "S") { InfoCbteCble.IdEmpresa = param.IdEmpresa; InfoCbteCble.IdUsuario = param.IdUsuario; codigo = cbtipobus.Get_Codigo_x_CbtCble_tipo(param.IdEmpresa, Convert.ToInt32(this.cmb_tipocomprobante.EditValue), ref MensajeError).Trim(); InfoCbteCble.IdPeriodo = InfoPeriodo.IdPeriodo; InfoCbteCble.Anio = InfoPeriodo.IdanioFiscal; InfoCbteCble.Mes = InfoPeriodo.pe_mes; InfoCbteCble.IdTipoCbte = Convert.ToInt32(this.cmb_tipocomprobante.EditValue); InfoCbteCble.CodCbteCble = txt_codCbteCble.Text; InfoCbteCble.cb_Fecha = Convert.ToDateTime(this.dtFecha.Value.ToShortDateString()); InfoCbteCble.cb_FechaTransac = param.GetDateServer(); InfoCbteCble.IdSucursal = (cmb_sucursal.EditValue == null ? 0 : Convert.ToInt32(cmb_sucursal.EditValue)); InfoCbteCble.Mayorizado = "N"; InfoCbteCble.cb_Observacion = this.txt_concepto.Text; InfoCbteCble.Secuencia = BusCbteCble.Get_IdSecuencia(ref MensajeError); InfoCbteCble.Estado = "A"; InfoCbteCble._cbteCble_det_lista_info = UC_Diario.Get_List_Cbtecble_det(); return(InfoCbteCble); } else { MessageBox.Show("El periodo de la fecha está cerrado.. No podrá grabar.."); InfoCbteCble = new ct_Cbtecble_Info(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); InfoCbteCble = new ct_Cbtecble_Info(); } return(InfoCbteCble); }
void inhabilitar() { try { btn_bucarPLantilla.Enabled = false; txt_codCbteCble.Enabled = false; txt_codCbteCble.ForeColor = Color.Black; txt_concepto.Enabled = false; txt_concepto.ForeColor = Color.Black; cmb_tipocomprobante.Enabled = false; cmb_tipocomprobante.ForeColor = Color.Black; dtFecha.Enabled = false; dtFecha.ForeColor = Color.Black; UC_Diario.setAccion(Cl_Enumeradores.eTipo_action.consultar); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name + " " + this.Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }