Exemplo n.º 1
0
        private void frmCon_CentroCosto_x_cliente_Mant_Load(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    if (_Accion == 0)
                    {
                        _Accion = Cl_Enumeradores.eTipo_action.grabar;
                    }
                    cargar_combo_cliente();
                    switch (_Accion)
                    {
                    case Cl_Enumeradores.eTipo_action.grabar:
                        limpiarFj();
                        chk_estado.Checked            = true;
                        ucGe_Menu.Visible_bntAnular   = false;
                        ucGe_Menu.Visible_bntImprimir = false;
                        txt_codigo.Text = Centro_costo_Bus.Get_IdCentroCosto_x_Raiz(param.IdEmpresa, ref MensajeError);
                        break;

                    case Cl_Enumeradores.eTipo_action.actualizar:
                        ucGe_Menu.Enabled_bntAnular  = false;
                        ucGe_Menu.Enabled_bntLimpiar = false;
                        ucGe_Menu.Visible_btnGuardar = false;
                        this.txt_codigo.Enabled      = false;
                        this.txt_codigo.BackColor    = System.Drawing.Color.White;
                        this.txt_codigo.ForeColor    = System.Drawing.Color.Black;
                        set_info_in_controls();
                        break;

                    case Cl_Enumeradores.eTipo_action.Anular:
                        ucGe_Menu.Visible_bntLimpiar         = false;
                        ucGe_Menu.Visible_btnGuardar         = false;
                        ucGe_Menu.Visible_bntImprimir        = false;
                        ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                        this.cmbCliente.Enabled   = false;
                        this.txt_codigo.Enabled   = false;
                        this.txt_codigo.BackColor = System.Drawing.Color.White;
                        this.txt_codigo.ForeColor = System.Drawing.Color.Black;
                        set_info_in_controls();
                        break;

                    case Cl_Enumeradores.eTipo_action.consultar:
                        ucGe_Menu.Visible_bntLimpiar         = false;
                        ucGe_Menu.Visible_btnGuardar         = false;
                        ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                        ucGe_Menu.Visible_bntAnular          = false;
                        this.cmbCliente.Enabled   = false;
                        this.txt_codigo.Enabled   = false;
                        this.txt_codigo.BackColor = System.Drawing.Color.White;
                        this.txt_codigo.ForeColor = System.Drawing.Color.Black;
                        set_info_in_controls();
                        break;

                    default:
                        break;
                    }
                }
                catch (Exception ex)
                {
                    string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                    NameMetodo = NameMetodo + " - " + ex.ToString();
                    Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                    MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                                    , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                NameMetodo = NameMetodo + " - " + ex.ToString();
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                                , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }