示例#1
0
        private void TxbCodigo_Leave(object sender, EventArgs e)
        {
            try
            {
                SqlParameter[] Parametros_ConsultaCargos = new SqlParameter[4];
                Parametros_ConsultaCargos[0] = new SqlParameter("@Op", "SubTiposEspe");
                Parametros_ConsultaCargos[1] = new SqlParameter("@ParametroChar", this.TxbCodigo.Text.Trim());
                Parametros_ConsultaCargos[2] = new SqlParameter("@ParametroInt", "0");
                Parametros_ConsultaCargos[3] = new SqlParameter("@ParametroNuemric", "0");

                ConsultaEntidades Maestro = new ConsultaEntidades();
                GuardarDatos      Guardar = new GuardarDatos();
                Ent_SubTipos      Reader  = new Ent_SubTipos();

                Reader = Maestro.Subtipos("SpConsulta_Tablas", Parametros_ConsultaCargos);

                if (Reader.Codigo != null)
                {
                    this.TxbNombre.Text  = Reader.Nombre;
                    this.TxbDetalle.Text = Reader.Detalle;
                }
                else
                {
                    this.TxbNombre.Text  = "";
                    this.TxbDetalle.Text = "";
                }
            }
            catch (Exception Ex1)
            {
                MessageBox.Show(Ex1.Message);;
            }
        }
        private void Frm_VistaVehiculos_Load(object sender, EventArgs e)
        {
            SqlParameter[] Parametros_Consulta = new SqlParameter[4];
            Parametros_Consulta[0] = new SqlParameter("@Op", "VehiculosEspe");
            Parametros_Consulta[1] = new SqlParameter("@ParametroChar", this.Placa);
            Parametros_Consulta[2] = new SqlParameter("@ParametroInt", "0");
            Parametros_Consulta[3] = new SqlParameter("@ParametroNuemric", "0");

            ConsultaEntidades Maestro = new ConsultaEntidades();
            Ent_Vehiculo      Reader  = new Ent_Vehiculo();

            Reader                              = Maestro.Vehiculo("SpConsulta_Tablas", Parametros_Consulta);
            this.TxbPlaca.Text                  = Reader.Placa;
            this.ChbEstado.Checked              = Reader.Estado;
            this.TxbLicencia.Text               = Reader.Licencia;
            this.TxbNombrePropietario1.Text     = Reader.NombrePropietario;
            this.TxbModelo1.Text                = Reader.Modelo;
            this.TxbMarca1.Text                 = Reader.Marca;
            this.TxbCilindraje1.Text            = Reader.Cilindraje.ToString("###,###,##0.#0").Trim();
            this.CmbTipoVehiculo1.SelectedIndex = Reader.TipoVehiculo;
            this.TxbCombustible1.Text           = Reader.Combustible;
            this.TxbClase1.Text                 = Reader.Clase;
            this.TxbCapacidad1.Text             = Reader.Peso.ToString("###,###,##0.#0").Trim();
            this.TxbMotor1.Text                 = Reader.Motor;
            this.TxbDetalle.Text                = Reader.Descripcion;
            this.ptbVehiculo.Image              = ImageConvert.byteToImage(Reader.Foto);
        }
示例#3
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (DirectorioActivo.Autenticar(Common.Common.Dominio, txtUser.Text.ToString(), txtPwd.Text.ToString(), DBMETAL_SHARP.Common.Common.path))
            {
                List <Entidades.Ent_Usuario> user = ConsultaEntidades.ObtenerUsuarioPorRoles("GetUserForRoles", txtUser.Text.ToString().Trim());

                if (user != null && user.Count() > 0)
                {
                    Common.Common.User        = user;
                    Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", txtUser.Text.ToString().Trim(), "frmPpal");

                    if (Common.Common.Permissions.Count > 0)
                    {
                        frmSplash oSplash = new frmSplash();
                        oSplash.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Usuario no posee permisos para este módulo", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Usuario no activo en directorio activo", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Usuario no registrado en DBMetal", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void txbIdentificacion_Leave(object sender, EventArgs e)
        {
            SqlParameter[] Parametros_Consulta = new SqlParameter[4];
            Parametros_Consulta[0] = new SqlParameter("@Op", "PropietariosEspe");
            Parametros_Consulta[1] = new SqlParameter("@ParametroChar", this.txbIdentificacion.Text.Trim());
            Parametros_Consulta[2] = new SqlParameter("@ParametroInt", "0");
            Parametros_Consulta[3] = new SqlParameter("@ParametroNuemric", "0");

            ConsultaEntidades Maestro = new ConsultaEntidades();
            Ent_Propietarios  Reader  = new Ent_Propietarios();

            Reader = Maestro.Propietarios("SpConsulta_Tablas", Parametros_Consulta);

            if (Reader.Nombre == null)
            {
                this.txbNombre.Text    = "";
                this.txbApellido.Text  = "";
                this.txbTelfijo.Text   = "";
                this.txbExtension.Text = "";
                this.txbCelular.Text   = "";
                this.txbEmail.Text     = "";
                this.ChbEstado.Checked = true;
            }
            else
            {
                this.txbNombre.Text    = Reader.Nombre;
                this.txbApellido.Text  = Reader.Apellido;
                this.txbTelfijo.Text   = Reader.TelFijo;
                this.txbExtension.Text = Reader.Extension;
                this.txbCelular.Text   = Reader.Celular;
                this.txbEmail.Text     = Reader.Email;
                this.ChbEstado.Checked = Reader.Deshabilitado;
            }
        }
        public Frm_PesajesMineraPlanta(string login)
        {
            InitializeComponent();
            //Pruebas Llamadoss
            this.Login        = login;
            this.label11.Text = DateTime.Now.ToString("dd/MM/yyyy");
            #region Configuracion inicial carga
            List <Ent_Localizacion> Reader = new List <Ent_Localizacion>();
            Reader = ConsultaEntidades.ObtenerLocalizacion("SpConsulta_Tablas", "recuLocalizacion", "", 0, "0");
            cboLocalizacion.DataSource    = Reader;
            cboLocalizacion.ValueMember   = "Identificacacion";
            cboLocalizacion.DisplayMember = "Nombre";
            cboLocalizacion.SelectedIndex = -1;

            this.tolSripValorSalida.Image = null;
            txtConcecutivo.Text           = 0.ToString();
            txtConcecutivo.BackColor      = Color.FromArgb(217, 213, 213);
            txtConcecutivo.Focus();


            TxtPlaca.Enabled               = true;
            TxbConductor.Enabled           = true;
            txtProyectoInfProyecto.Enabled = true;
            txtPlaza.Enabled               = true;
            #endregion
        }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            #region Consulta al Server para traer datos del Sello

            try
            {
                string         SelloConsulta = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                SqlParameter[] Parametros    = new SqlParameter[1];
                Parametros[0] = new SqlParameter("@Sello", SelloConsulta);

                ConsultaEntidades Entidad = new ConsultaEntidades();
                Ent_MinaSello     Reader  = new Ent_MinaSello();
                Reader = Entidad.MinaSello("ConsultarSelloSGS", Parametros);

                if (Reader.Consecutivo == 0)
                {
                    this.StsLabel1.Text = " Sello No Encontrado";
                }
                else
                {
                    this.StsLabel1.Text = Reader.Mina + " ==> " + Reader.Consecutivo + " Fecha: " + Reader.Fecha.ToShortDateString();
                }
            }
            catch (Exception Ext)
            {
                MessageBox.Show("OCURRIÓ UN ERROR AL CONSULTAR O CARGAR LOS DATOS: \n\n" + Ext.Message, "Error del Sistema...", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            #endregion
        }
示例#7
0
        private void loadPeriodo(int anoPeriodo)
        {
            this.cboAno.DropDownStyle     = ComboBoxStyle.DropDownList;
            this.cboMes.DropDownStyle     = ComboBoxStyle.DropDownList;
            this.cboPeriodo.DropDownStyle = ComboBoxStyle.DropDownList;
            if (anoPeriodo == 0)
            {
                cboAno.Items.Clear();
                var read  = ConsultaEntidades.ObtenerPeriodos("SpConsulta_Tablas", "FechaPeriodo", "", anoPeriodo, string.Empty);
                var query = read.Select(c => c.FechaAplica).ToArray();
                cboAno.Items.AddRange(query.ToArray());
                cboAno.SelectedIndex = 0;
                anoPeriodo           = Convert.ToInt32(cboAno.Items[0].ToString());
            }
            var readHistory = ConsultaEntidades.ObtenerPeriodos("SpConsulta_Tablas", "PeriodoAno", "", anoPeriodo, string.Empty);

            dataHistoryPeriodo.DataSource = readHistory;

            if (dataHistoryPeriodo.Rows.Count > 0)
            {
                DateTime valorAnterior = Convert.ToDateTime(dataHistoryPeriodo.Rows[0].Cells[3].Value);
                dtpEventInitial.Value = valorAnterior.AddDays(1);
                dtpDatenEnd.Value     = dtpEventInitial.Value.AddDays(1);
            }
            else
            {
                dtpEventInitial.Value = DateTime.Now;
                dtpDatenEnd.Value     = DateTime.Now.AddDays(1);
            }

            dataHistoryPeriodo.Columns[0].Visible       = false;
            dataHistoryPeriodo.Columns[10].DisplayIndex = 0;

            dataHistoryPeriodo.Columns[10].HeaderText = "Estado Abierto";
            dataHistoryPeriodo.Columns[2].HeaderText  = "Fecha Inicio";
            dataHistoryPeriodo.Columns[3].HeaderText  = "Fecha Fin";
            dataHistoryPeriodo.Columns[4].HeaderText  = "Año";
            dataHistoryPeriodo.Columns[5].HeaderText  = "Mes";
            dataHistoryPeriodo.Columns[6].HeaderText  = "Periodo";
            dataHistoryPeriodo.Columns[7].HeaderText  = "Onzas Fundidas";
            dataHistoryPeriodo.Columns[8].HeaderText  = "Onzas Recuperadas";
            dataHistoryPeriodo.Columns[9].HeaderText  = "Recuperación Planta";
            dataHistoryPeriodo.Columns["RecuperacionPlanta"].DefaultCellStyle.Format    = "##,##.00";
            dataHistoryPeriodo.Columns["RecuperacionPlanta"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["OnzasFundidas"].DefaultCellStyle.Format         = "##,##.00";
            dataHistoryPeriodo.Columns["OnzasFundidas"].DefaultCellStyle.Alignment      = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["OnzasRecuperadas"].DefaultCellStyle.Format      = "##,##.00";
            dataHistoryPeriodo.Columns["OnzasRecuperadas"].DefaultCellStyle.Alignment   = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["AnoPeriodo"].DefaultCellStyle.Alignment         = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["MesPeriodo"].DefaultCellStyle.Alignment         = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["Periodo"].DefaultCellStyle.Alignment            = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.Columns["IdPeriodo"].DefaultCellStyle.Alignment          = DataGridViewContentAlignment.MiddleRight;
            dataHistoryPeriodo.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.dataHistoryPeriodo.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
            dataHistoryPeriodo.AutoResizeColumns();

            label17.Text        = "     - - ";
            btnCerrarPe.Enabled = false;
        }
示例#8
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            #region Llenado los Textbox
            double        SumTenor = 0.00;
            double        Tenor1   = 0.00;
            double[]      ArrayTenor;
            List <double> ListArray = new List <double>();

            string Sello    = dataGridView1.CurrentRow.Cells[3].Value.ToString();
            int    TotalReg = 0;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (Convert.ToBoolean(row.Cells[0].Value) & Convert.ToString(row.Cells[3].Value) == Sello)
                {
                    TotalReg += 1;
                    SumTenor  = SumTenor + Convert.ToDouble(row.Cells[4].Value);
                    ListArray.Add(Convert.ToDouble(row.Cells[4].Value));
                    string SelloP = Convert.ToString(row.Cells[2].Value);
                    if (SelloP.IndexOf("a") + SelloP.IndexOf("b") + SelloP.IndexOf("c") == -3)
                    {
                        Tenor1 = Convert.ToDouble(row.Cells[4].Value);
                    }
                }
            }
            ArrayTenor         = ListArray.ToArray();
            this.TxbTenor.Text = Tenor1.ToString().Trim();
            //this.TxbTenorMedia.Text = Convert.ToString(SumTenor / TotalReg);
            this.TxbTenorMedia.Text = Estadisticas.Mediana(ListArray).ToString();
            this.TxbDesv.Text       = Math.Round(Estadisticas.Desv(ArrayTenor), 4).ToString().Trim();
            this.TxbTenorMin.Text   = ArrayTenor.Min().ToString().Trim();
            this.TxbTenorMax.Text   = ArrayTenor.Max().ToString().Trim();
            #endregion

            #region Consulta al Server para traer datos del Sello

            try
            {
                string         SelloConsulta = dataGridView1.CurrentRow.Cells[3].Value.ToString();
                SqlParameter[] Parametros    = new SqlParameter[1];
                Parametros[0] = new SqlParameter("@Sello", SelloConsulta);

                ConsultaEntidades Entidad = new ConsultaEntidades();
                Ent_MinaSello     Reader  = new Ent_MinaSello();
                Reader = Entidad.MinaSello("ConsultarSelloSGS", Parametros);

                this.TxbMina.Text  = Reader.Mina + " ==> " + Reader.Consecutivo;
                this.TxbFecha.Text = Reader.Fecha.ToString().Trim();
            }
            catch (Exception Ext)
            {
                MessageBox.Show("OCURRIÓ UN ERROR AL CONSULTAR O CARGAR LOS DATOS: \n\n" + Ext.Message, "Error del Sistema...", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            #endregion
        }
        private void btnNew_Click(object sender, EventArgs e)
        {
            foreach (Control control in this.Controls)
            {
                if (control is System.Windows.Forms.GroupBox)
                {
                    foreach (Control item in control.Controls)
                    {
                        if (item is System.Windows.Forms.TextBox)
                        {
                            item.Text = string.Empty;
                        }

                        if (item is System.Windows.Forms.MaskedTextBox)
                        {
                            item.Text = string.Empty;
                        }
                    }
                }
            }
            dtpDate.Value                  = DateTime.Now;
            tolstripPeso.Text              = string.Empty;
            tolstripDefaul.Text            = string.Empty;
            tolSripValorSalida.Text        = string.Empty;
            tolSripValorSalida.ToolTipText = string.Empty;
            cboLocalizacion.SelectedIndex  = -1;
            cboLocalizacion.Enabled        = true;
            cboLocalizacion.Enabled        = true;
            btnplaca.Enabled               = true;
            btnProyecto.Enabled            = true;
            btnPlaza.Enabled               = true;
            btnCatidadPlaca.Visible        = false;


            btnConduc.Enabled              = true;
            TxtPlaca.Enabled               = true;
            TxbConductor.Enabled           = true;
            txtProyectoInfProyecto.Enabled = true;
            txtPlaza.Enabled               = true;
            txtConcecutivo.Enabled         = true;
            txtConcecutivo.Text            = 0.ToString();
            dtpDate.Enabled   = true;
            consecutiveReturn = string.Empty;

            this.txtConcecutivo.Focus();
            this.toolTip1.SetToolTip(toolStrip1, "");


            List <Ent_Localizacion> Reader = new List <Ent_Localizacion>();

            Reader = ConsultaEntidades.ObtenerLocalizacion("SpConsulta_Tablas", "recuLocalizacion", "", 0, "0");
            cboLocalizacion.DataSource    = Reader;
            cboLocalizacion.ValueMember   = "Identificacacion";
            cboLocalizacion.DisplayMember = "Nombre";
            cboLocalizacion.SelectedIndex = -1;
        }
示例#10
0
 public Frm_Periodo(string User)
 {
     InitializeComponent();
     this.Usuario = User.Trim();
     loadPeriodo(0);
     dataHistoryPeriodo.Columns.Cast <DataGridViewColumn>().ToList().ForEach(f => f.SortMode = DataGridViewColumnSortMode.NotSortable);
     Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);
     this.Permission           = Common.Common.Permissions;
     ValidatePermission(this.Controls);
 }
示例#11
0
        public Frm_CargaAnalisis(string User)
        {
            InitializeComponent();
            this.Usuario = User.Trim();

            Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);

            this.Permission = Common.Common.Permissions;

            ValidatePermission(this.Controls);
        }
示例#12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                SqlParameter[] ParametrosEnt = new SqlParameter[12];
                ParametrosEnt[1]  = new SqlParameter("@Identificacion", this.txbIdentificacion.Text.Trim());
                ParametrosEnt[2]  = new SqlParameter("@Nombre", this.txbNombre.Text.Trim());
                ParametrosEnt[3]  = new SqlParameter("@Apellido", this.txbApellido.Text.Trim());
                ParametrosEnt[4]  = new SqlParameter("@TelFijo", this.txbTelfijo.Text.Trim());
                ParametrosEnt[5]  = new SqlParameter("@Extension", this.txbExtension.Text.Trim());
                ParametrosEnt[6]  = new SqlParameter("@Celular", this.txbCelular.Text.Trim());
                ParametrosEnt[7]  = new SqlParameter("@email", this.txbEmail.Text.Trim());
                ParametrosEnt[8]  = new SqlParameter("@Estado", this.ChbEstado.Checked);
                ParametrosEnt[9]  = new SqlParameter("@FechaCreacion", DateTime.Now.Date);
                ParametrosEnt[10] = new SqlParameter("@TipoIdentificacion", this.CmbTipoIdentificacion.SelectedIndex);
                ParametrosEnt[11] = new SqlParameter("@RazonCial", this.TxbRazonCial.Text.Trim());

                SqlParameter[] Parametros_Consulta = new SqlParameter[4];
                Parametros_Consulta[0] = new SqlParameter("@Op", "ContratistasEspe");
                Parametros_Consulta[1] = new SqlParameter("@ParametroChar", this.txbIdentificacion.Text.Trim());
                Parametros_Consulta[2] = new SqlParameter("@ParametroInt", "0");
                Parametros_Consulta[3] = new SqlParameter("@ParametroNuemric", "0");

                ConsultaEntidades Maestro      = new ConsultaEntidades();
                GuardarDatos      GuardarDatos = new GuardarDatos();
                Ent_Contratistas  Reader       = new Ent_Contratistas();

                Reader = Maestro.Contratistas("SpConsulta_Tablas", Parametros_Consulta);

                if (Reader.Nombre == null)
                {
                    ParametrosEnt[0] = new SqlParameter("@Op", "I");
                }
                else
                {
                    ParametrosEnt[0] = new SqlParameter("@Op", "U");
                }

                GuardarDatos.booleano("GrbBascula_Contratistas", ParametrosEnt);

                if (Reader.Identificacion == null)
                {
                    MessageBox.Show("Propietario creado satisfactoriamente.", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Propietario actualizado satisfactoriamente.", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception Exc)
            {
                MessageBox.Show(Exc.Message, "System Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#13
0
        private void TxbTipo_Leave(object sender, EventArgs e)
        {
            if (this.TxbTipo.Text.Trim().Length > 0)
            {
                SqlParameter[] Parametros_ConsultaTipo = new SqlParameter[4];
                Parametros_ConsultaTipo[0] = new SqlParameter("@Op", "TiposEspe");
                Parametros_ConsultaTipo[1] = new SqlParameter("@ParametroChar", this.TxbTipo.Text.Trim());
                Parametros_ConsultaTipo[2] = new SqlParameter("@ParametroInt", "0");
                Parametros_ConsultaTipo[3] = new SqlParameter("@ParametroNuemric", "0.0");

                ConsultaEntidades Maestro     = new ConsultaEntidades();
                Ent_TiposMineral  ReaderTipos = new Ent_TiposMineral();
                ReaderTipos = Maestro.TiposMineral("SpConsulta_Tablas", Parametros_ConsultaTipo);

                if (ReaderTipos.Codigo != null)
                {
                    this.TxbNombreTipo.Text = ReaderTipos.Nombre;
                    this.IdTipo             = ReaderTipos.Id;
                }
                else
                {
                    this.TxbTipo.Text       = "";
                    this.TxbNombreTipo.Text = "";
                }
            }

            #region Marcando los Check del arbol que cumplan la condicion
            if (this.TxbTipo.Text.Trim().Length > 0 && this.TxbOrigen.Text.Trim().Length > 0)
            {
                SqlParameter[] Parametros = new SqlParameter[4];
                Parametros[0] = new SqlParameter("@Op", "ConsultaTipoOrigen");
                Parametros[1] = new SqlParameter("@ParametroChar", "");
                Parametros[2] = new SqlParameter("@ParametroInt", this.IdTipo);
                Parametros[3] = new SqlParameter("@ParametroNuemric", this.IdOrigen);
                ConsultaEntidades Maestro = new ConsultaEntidades();
                List <Ent_RelacionTipoOrigenDestino> ListaTipo = new List <Ent_RelacionTipoOrigenDestino>();
                ListaTipo = Maestro.TipoOrigenDestino("SpConsulta_Tablas", Parametros);

                foreach (Ent_RelacionTipoOrigenDestino item in ListaTipo)
                {
                    string Tag       = item.CodigoDestino;
                    bool   EstadoTag = item.Estado;
                    foreach (TreeNode tree in this.TreeDestinos.Nodes)
                    {
                        if (tree.Tag.ToString().Trim() == Tag.Trim())
                        {
                            tree.Checked = EstadoTag;
                        }
                    }
                }
            }
            #endregion
        }
示例#14
0
        public static List <Ent_Periodos> ListPeriodos(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] Parametros = new SqlParameter[4];
            Parametros[0] = new SqlParameter("@Op", Op);
            Parametros[1] = new SqlParameter("@ParametroChar", ParametroChar);
            Parametros[2] = new SqlParameter("@ParametroInt", ParametroInt);
            Parametros[3] = new SqlParameter("@ParametroNuemric", ParametroNumeric);
            ConsultaEntidades   Maestro    = new ConsultaEntidades();
            List <Ent_Periodos> ListReturn = Maestro.ListPeriodos("SpConsulta_Tablas", Parametros);

            return(ListReturn);
        }
示例#15
0
        public static Ent_Periodos Periodos(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] ParamUsuario = new SqlParameter[4];
            ParamUsuario[0] = new SqlParameter("@Op", Op);
            ParamUsuario[1] = new SqlParameter("@ParametroChar", ParametroChar);
            ParamUsuario[2] = new SqlParameter("@ParametroInt", ParametroInt);
            ParamUsuario[3] = new SqlParameter("@ParametroNuemric", ParametroNumeric);
            ConsultaEntidades Maestro = new ConsultaEntidades();
            Ent_Periodos      Reader  = Maestro.Periodos("SpConsulta_Tablas", ParamUsuario);

            return(Reader);
        }
        private void TxbIdentificacion_Leave(object sender, EventArgs e)
        {
            try
            {
                Ent_PersonalMuestreo Reader = ConsultaEntidades.PersonalMuestreo("PersonalMuestreo", TxbIdentificacion.Text.Trim(), 0, 0.00);
                if (Reader.Nombre != null)
                {
                    TxbNombre.Text    = Reader.Nombre;
                    TxbApellido.Text  = Reader.Apellido;
                    TxbDireccion.Text = Reader.Direccion;
                    TxbTelFijo.Text   = Reader.TelFijo;
                    TxbCelular.Text   = Reader.Celular;
                    TxbEmail.Text     = Reader.Email;
                    DtpCreado.Value   = Reader.Create;

                    switch (Reader.Rol)
                    {
                    case 1:
                        ChbEncargado.Checked = true;
                        break;

                    case 2:
                        ChbTercero.Checked = true;
                        break;

                    case 3:
                        ChbSeguridad.Checked = true;
                        break;

                    case 4:
                        ChbCuartea.Checked = true;
                        break;

                    default:
                        break;
                    }
                    ChbEstado.Checked = Reader.Estado;
                    if (Reader.Foto != null)
                    {
                        PtbPersonal.Image = Convertir.byteEnImagen(Reader.Foto);
                    }
                }
                else
                {
                    this.Limpiar(2);
                }
            }
            catch (Exception Ex1)
            {
                MessageBox.Show(Ex1.Message);;
            }
        }
示例#17
0
        public static List <Ent_TiposDeEmpresa> ListaTipoEmpresas(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] ParamSQL = new SqlParameter[4];
            ParamSQL[0] = new SqlParameter("@Op", Op);
            ParamSQL[1] = new SqlParameter("@ParametroChar", ParametroChar);
            ParamSQL[2] = new SqlParameter("@ParametroInt", ParametroInt);
            ParamSQL[3] = new SqlParameter("@ParametroNuemric", ParametroNumeric);
            ConsultaEntidades         Maestro = new ConsultaEntidades();
            List <Ent_TiposDeEmpresa> Lista   = new List <Ent_TiposDeEmpresa>();

            Lista = Maestro.ListaTiposDeEmpresa("SpConsulta_Tablas", ParamSQL);
            return(Lista);
        }
示例#18
0
        private void FrmRptDiarioMuestreo_Load(object sender, EventArgs e)
        {
            DataTable datosReporte = new DataTable();

            datosReporte = ConsultaEntidades.ReporteDiarioMuestreo(FechaInicial, FechaFinal, Proyecto, Periodo, NumOrden);

            string reporte = Path.Combine(Application.StartupPath, @"Informes\ReporteMuestreoDiario.rdlc");

            this.reportViewer1.LocalReport.ReportPath = reporte;
            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ReporteDiarioMuestreoDataSet", datosReporte));
            this.reportViewer1.RefreshReport();
        }
示例#19
0
        public static List <Ent_Periodos> ListPeriodos(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] sP_Parametros = new SqlParameter[]
            {
                new SqlParameter("@Op", Op),
                new SqlParameter("@ParametroChar", ParametroChar),
                new SqlParameter("@ParametroInt", ParametroInt),
                new SqlParameter("@ParametroNuemric", ParametroNumeric)
            };
            ConsultaEntidades consultaEntidades = new ConsultaEntidades();

            return(consultaEntidades.ListPeriodos("SpConsulta_Tablas", sP_Parametros));
        }
示例#20
0
        public static Ent_Plazas TblPlazas(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] sP_Parametros = new SqlParameter[]
            {
                new SqlParameter("@Op", Op),
                new SqlParameter("@ParametroChar", ParametroChar),
                new SqlParameter("@ParametroInt", ParametroInt),
                new SqlParameter("@ParametroNuemric", ParametroNumeric)
            };
            ConsultaEntidades consultaEntidades = new ConsultaEntidades();
            Ent_Plazas        ent_Plazas        = new Ent_Plazas();

            return(consultaEntidades.Plazas("SpConsulta_Tablas", sP_Parametros));
        }
示例#21
0
        public static Ent_Plazas TblPlazas(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] ParamSQL = new SqlParameter[4];
            ParamSQL[0] = new SqlParameter("@Op", Op);
            ParamSQL[1] = new SqlParameter("@ParametroChar", ParametroChar);
            ParamSQL[2] = new SqlParameter("@ParametroInt", ParametroInt);
            ParamSQL[3] = new SqlParameter("@ParametroNuemric", ParametroNumeric);

            ConsultaEntidades Maestro = new ConsultaEntidades();
            Ent_Plazas        Entidad = new Ent_Plazas();

            Entidad = Maestro.Plazas("SpConsulta_Tablas", ParamSQL);
            return(Entidad);
        }
示例#22
0
        public static List <Ent_TiposDeEmpresa> ListaTipoEmpresas(string Op, string ParametroChar, int ParametroInt, double ParametroNumeric)
        {
            SqlParameter[] sP_Parametros = new SqlParameter[]
            {
                new SqlParameter("@Op", Op),
                new SqlParameter("@ParametroChar", ParametroChar),
                new SqlParameter("@ParametroInt", ParametroInt),
                new SqlParameter("@ParametroNuemric", ParametroNumeric)
            };
            ConsultaEntidades         consultaEntidades = new ConsultaEntidades();
            List <Ent_TiposDeEmpresa> list = new List <Ent_TiposDeEmpresa>();

            return(consultaEntidades.ListaTiposDeEmpresa("SpConsulta_Tablas", sP_Parametros));
        }
示例#23
0
        private void txbIdentificacion_Leave(object sender, EventArgs e)
        {
            SqlParameter[] Parametros_Consulta = new SqlParameter[4];
            Parametros_Consulta[0] = new SqlParameter("@Op", "ContratistasEspe");
            Parametros_Consulta[1] = new SqlParameter("@ParametroChar", this.txbIdentificacion.Text.Trim());
            Parametros_Consulta[2] = new SqlParameter("@ParametroInt", "0");
            Parametros_Consulta[3] = new SqlParameter("@ParametroNuemric", "0");

            ConsultaEntidades Maestro = new ConsultaEntidades();
            Ent_Contratistas  Reader  = new Ent_Contratistas();

            Reader = Maestro.Contratistas("SpConsulta_Tablas", Parametros_Consulta);

            if (Reader.Nombre == null)
            {
                this.CmbTipoIdentificacion.SelectedIndex = -1;
                this.TxbRazonCial.Text    = "";
                this.TxbRazonCial.Enabled = false;
                this.txbNombre.Text       = "";
                this.txbApellido.Text     = "";
                this.txbTelfijo.Text      = "";
                this.txbExtension.Text    = "";
                this.txbCelular.Text      = "";
                this.txbEmail.Text        = "";
                this.ChbEstado.Checked    = true;
            }
            else
            {
                this.CmbTipoIdentificacion.SelectedIndex = Reader.TipoIdentificacion;
                this.TxbRazonCial.Text = Reader.RazonCial.Trim();
                this.txbNombre.Text    = Reader.Nombre.Trim();
                this.txbApellido.Text  = Reader.Apellido.Trim();
                this.txbTelfijo.Text   = Reader.TelFijo.Trim();
                this.txbExtension.Text = Reader.Extension.Trim();
                this.txbCelular.Text   = Reader.Celular.Trim();
                this.txbEmail.Text     = Reader.Email.Trim();
                this.ChbEstado.Checked = Reader.Deshabilitado;
                if (this.CmbTipoIdentificacion.SelectedIndex == 0)
                {
                    this.TxbRazonCial.Enabled = true;
                }
                else
                {
                    this.TxbRazonCial.Enabled = false;
                }
            }
        }
示例#24
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                SqlParameter[] ParametrosEnt = new SqlParameter[4];
                ParametrosEnt[1] = new SqlParameter("@Codigo", this.TxbCodigo.Text.Trim());
                ParametrosEnt[2] = new SqlParameter("@Nombre", this.TxbNombre.Text.Trim());
                ParametrosEnt[3] = new SqlParameter("@Detalle", this.TxbDetalle.Text.Trim());

                SqlParameter[] Parametros_Consulta = new SqlParameter[4];
                Parametros_Consulta[0] = new SqlParameter("@Op", "SubTiposEspe");
                Parametros_Consulta[1] = new SqlParameter("@ParametroChar", this.TxbCodigo.Text.Trim());
                Parametros_Consulta[2] = new SqlParameter("@ParametroInt", "0");
                Parametros_Consulta[3] = new SqlParameter("@ParametroNuemric", "0");

                ConsultaEntidades Maestro = new ConsultaEntidades();
                GuardarDatos      Guardar = new GuardarDatos();
                Ent_SubTipos      Reader  = new Ent_SubTipos();

                Reader = Maestro.Subtipos("SpConsulta_Tablas", Parametros_Consulta);

                if (Reader.Detalle == null)
                {
                    ParametrosEnt[0] = new SqlParameter("@Op", "I");
                }
                else
                {
                    ParametrosEnt[0] = new SqlParameter("@Op", "U");
                }

                Guardar.booleano("Sp_Guardar_Subtipos", ParametrosEnt);


                if (Reader.Codigo == null)
                {
                    MessageBox.Show("SubTipo creado satisfactoriamente.", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("SubTipo actualizado satisfactoriamente.", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception Exc)
            {
                MessageBox.Show(Exc.Message, "System Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#25
0
 private void TxbIdentificacion_Leave(object sender, EventArgs e)
 {
     try
     {
         Ent_Localizacion Reader = ConsultaEntidades.ObtenerLocalizacion("ObeterLocalizacion", TxbIdentificacion.Text.Trim(), 0, 0.00).FirstOrDefault();
         if (Reader != null)
         {
             TxbNombre.Text    = Reader.nombre.Trim();
             txtDetail.Text    = Reader.Detalle;
             ChbEstado.Checked = Reader.estado;
         }
     }
     catch (Exception Ex1)
     {
         MessageBox.Show(Ex1.Message);;
     }
 }
示例#26
0
        private void CargarComboBox()
        {
            List <Ent_LiquidacionPeriodos> periodos;
            DataSet proyectos;

            periodos = ConsultaEntidades.ObtenerPeriodosSp();
            cmbPeriodo.DataSource    = periodos.OrderBy(p => p.MesPeriodo).ToList();
            cmbPeriodo.ValueMember   = "IdPeriodo";
            cmbPeriodo.DisplayMember = "IdPeriodo";
            cmbPeriodo.SelectedIndex = 0;

            proyectos = ConsultaEntidades.CargarProyectos();
            cmbProyecto.DataSource    = proyectos.Tables[0];
            cmbProyecto.ValueMember   = "NombreProyecto";
            cmbProyecto.DisplayMember = "NombreProyecto";
            cmbProyecto.SelectedIndex = 0;
        }
        private void txtProyectoInfProyecto_Leave(object sender, EventArgs e)
        {
            List <Ent_PesajeMineral> Reader = new List <Ent_PesajeMineral>();

            txtConcecutivo.BackColor = Color.White;

            if (!String.IsNullOrEmpty(this.txtProyectoInfProyecto.Text))
            {
                Reader = ConsultaEntidades.ObtenerPesoMinas("SpConsulta_Tablas", "MinasEspePe", this.txtProyectoInfProyecto.Text, 0, "0");
                if (Reader != null && Reader.Count() > 0)
                {
                    Ent_PesajeMineral value = Reader[0];

                    txtDescripcionProyecto.Text = value.NombreProyecto;
                    //btnplaca.Enabled = false;
                }
            }
        }
示例#28
0
        public frmReportMananger(string User)
        {
            InitializeComponent();
            this.Usuario = User.Trim();
            this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;

            comboBox1.Items.Insert(0, "Detalle Mina Día");
            comboBox1.Items.Insert(1, "Resumen Mina Día");
            comboBox1.Items.Insert(2, "Detalle Muestreo");

            dtpEventInitial.Value = DateTime.Now;

            dtpEventEnd.Value = DateTime.Now;

            DBMETAL_SHARP.Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);

            this.Permission = DBMETAL_SHARP.Common.Common.Permissions;

            ValidatePermission(this.Controls);


            var read = ConsultaEntidades.MinasReader("SpConsulta_Tablas", "Minas", "", 0, string.Empty);//.OrderBy(f=>f.Nombre);

            comboMina.DisplayMember = "Nombre";
            comboMina.ValueMember   = "Codigo";
            //CmbTypSub.DataSource = LoadShipmentAll();
            //Implementación David Ciro
            //var query1 = LoadShipmentAllTypSubEntity();

            this.comboMina.DropDownStyle = ComboBoxStyle.DropDownList;

            read = read.OrderBy(f => f.Nombre).ToList();

            Ent_Minas pre = new Ent_Minas();

            pre.Codigo = "-1";
            pre.Nombre = "Seleccione opción..";
            read.Insert(read.ToList().Count, pre);

            comboMina.DataSource    = read.Select(c => c.Nombre).ToList();
            comboMina.SelectedIndex = read.ToList().Count - 1;
        }
示例#29
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            #region LLenando el Combo de los Conceptos
            List <Ent_Periodos> ListaPeriodos = DatosEntidad.ListPeriodos("PeriodosGen", "", 0, 0.0);
            this.CmbPeriodos.DataSource    = ListaPeriodos;
            this.CmbPeriodos.DisplayMember = "Titulo";
            this.CmbPeriodos.ValueMember   = "Id";
            this.CmbPeriodos.SelectedIndex = 0;
            #endregion
            this.dataGridView1.DataSource = null;
            this.RtbBodyMail.Text         = "Buen@s, " + Environment.NewLine +
                                            "Anexamos archivo PDF con la relación de la liquidación del periodo." + Environment.NewLine +
                                            "Presentamos disculpas por el retraso en la generación de la información, así como agradecemos presenten hoy mismo la factura asociada con esta liquidación";

            ConsultaEntidades Consulta = new ConsultaEntidades();

            Ent_ImagenPublicidad Reader = Consulta.ImagenPublicidad();
            this.PtbLogo1.Image = Convertir.byteEnImagen(Reader.Logo1);
            this.PtbLogo2.Image = Convertir.byteEnImagen(Reader.Logo2);
        }
示例#30
0
        private void loadHistory()
        {
            cmbShipment.Items.Clear();
            this.cmbShipment.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cbmLabo.DropDownStyle     = ComboBoxStyle.DropDownList;
            // List<Ent_Destino> read = ConsultaEntidades.ObtenerHistorialSec("SpConsulta_Tablas", "ObeterLocalizacion", "1234", 0, string.Empty);
            var read = ConsultaEntidades.ObtenerHistorialSec("SpConsulta_Tablas", "ConsecutivoControlM", "", 0, string.Empty);

            obtenerHistorial = read.OrderByDescending(o => o.IdOrden).ToList();

            Ent_OrdenesMuestra pre = new Ent_OrdenesMuestra();

            pre.Id      = read.ToList().Count + 1;
            pre.IdOrden = "Seleccione Orden";
            read.Insert(obtenerHistorial.ToList().Count, pre);

            pre         = new Ent_OrdenesMuestra();
            pre.Id      = 0;
            pre.IdOrden = "Nueva Orden";
            read.Insert(0, pre);

            cmbShipment.DisplayMember = "IdOrden";
            cmbShipment.ValueMember   = "IdOrden";


            var query = from student in read
                        orderby student.Id descending
                        select student.IdOrden;

            //var query = obtenerHistorial.Select(c => c.IdOrden).ToList();
            cmbShipment.Items.AddRange(query.ToArray());
            cmbShipment.SelectedIndex = 0;

            dtpEvent.Value = DateTime.Now;
            //groupBox6.Visible = false;
            //     query = read.Select(c => c.Laboratorio).ToList();
            //cbmLabo.Items.AddRange(query.ToArray());
            //cbmLabo.SelectedIndex = query.ToList().Count - 1;
        }