private void Cargar_Menu()
        {
            Cursor = Cursors.WaitCursor;
            SqlCommand cmd = new SqlCommand();
            {
                cmd.CommandText = "SELECT Id_menuWeb, Menu FROM tbl_MenuWeb WHERE Id_menu_padre=0" +
                                  " union select -1 as Id_menuWeb, 'Seleccionar' as Menu " +
                                  "order by Id_menuWeb";
                DataSet dt;
                dt = Conectar.Listar(Clases.clsBD.BD, cmd);

                cbx_Id_menuWeb_Buscar.DisplayMember = dt.Tables[0].Columns[1].Caption.ToString();
                cbx_Id_menuWeb_Buscar.ValueMember   = dt.Tables[0].Columns[0].Caption.ToString();
                cbx_Id_menuWeb_Buscar.DataSource    = dt.Tables[0];

                cmd.CommandText = "SELECT Id_menuWeb, Menu FROM tbl_MenuWeb WHERE Id_menu_padre=0" +
                                  " union select 0 as Id_menuWeb, 'Menu Padre' as Menu " +
                                  "order by Id_menuWeb";

                dt = Conectar.Listar(Clases.clsBD.BD, cmd);
                cbx_Id_menu_Padre.DisplayMember = dt.Tables[0].Columns[1].Caption.ToString();
                cbx_Id_menu_Padre.ValueMember   = dt.Tables[0].Columns[0].Caption.ToString();
                cbx_Id_menu_Padre.DataSource    = dt.Tables[0];
                Cursor = Cursors.Default;

                //"SELECT Id_menuWeb, Menu FROM tbl_MenuWeb WHERE Id_menu_padre=0" +
                //                                      " union select 0 as Id_menuWeb, 'Menu Padre' as Menu " +
                //                                      "order by Id_menuWeb";
            }
        }
        private void Cargar_Cliente(Int64 intCodCliente)
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "select run,Razon_Social,N_Cliente_Ref,region + ','+ comuna +','+Direccion as Direccion ,r.Id_Region,c.Id_Provincia,c.Id_Comuna,Telefono, Id_TipoFuente,Id_estado,Fechainicio " +
                              "  FROM tbl_cliente c inner join [dbo].[glo_region] r on c.Id_Region=r.Id_Region inner join glo_comuna co on co.id_comuna=c.id_comuna" +
                              " WHERE Id_cliente= " + intCodCliente.ToString()
            };
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt.Tables[0].Rows.Count > 0)
            {
                lbl_id_cliente.Text = intCodCliente.ToString();
                //  lbl_nombreCliente.Text = dt.Tables[0].Rows[0]["Razon_Social"].ToString();
                // lbl_Direccion.Text = dt.Tables[0].Rows[0]["Direccion"].ToString();
                btn_cargar.Enabled = true;
                // btn_Cargar_cliente.Enabled = false;
                lbl_id_cliente.Enabled = false;
            }
            else
            {
                //    btn_Cargar_cliente.Enabled = true;
                btn_cargar.Enabled     = false;
                lbl_id_cliente.Enabled = true;
                //  lbl_nombreCliente.Text = "";
                // lbl_Direccion.Text = "";
            }



            //
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (lbl_NDocumento.Text != "")
            {
                DataSet ds  = new DataSet();
                DataSet ds2 = new DataSet();

                DataSet    ds3 = new DataSet();
                SqlCommand cmd = new SqlCommand();

                SqlCommand cmddet = new SqlCommand();

                cmddet.CommandText = "select distinct Id_cliente,id_periodo 	from ges_dosimetro_estado 	where N_Documento="+ lbl_NDocumento.Text;;
                cmddet.CommandType = CommandType.Text;

                ds3 = Conectar.Listar(Clases.clsBD.BD, cmddet);

                cmd.CommandText = "rtpDosimetriaPersonal_Enc " + ds3.Tables[0].Rows[0][0].ToString() + "," + ds3.Tables[0].Rows[0][1].ToString() + "," + lbl_NDocumento.Text;
                cmd.CommandType = CommandType.Text;

                ds = Conectar.Listar(Clases.clsBD.BD, cmd);

                cmd.CommandText = "rtpDosimetriaPersonal_det " + ds3.Tables[0].Rows[0][0].ToString() + "," + ds3.Tables[0].Rows[0][1].ToString() + "," + lbl_NDocumento.Text;
                cmd.CommandType = CommandType.Text;

                ds2 = Conectar.Listar(Clases.clsBD.BD, cmd);
                //pnl_sobre.Visible = true;
                frmreporte frm = new frmreporte(ds, ds2, 1);
                frm.Show(this);
            }
        }
        private void Cargar_Reporte()
        {
            ToolStripMenuItem tsiMenu;
            SqlCommand        cmd = new SqlCommand();

            cmd.CommandText = "pa_ListarReporte_Sel " + Id_Menu.ToString();
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt == null)
            {
                tsdReporte.Visible = false;
            }
            else
            {
                tsdReporte.Visible = dt.Tables[0].Rows.Count == 0 ? false : true;
                if (dt.Tables[0].Rows.Count > 0)
                {
                    for (int intFila = 0; intFila <= dt.Tables[0].Rows.Count - 1; intFila++)
                    {
                        tsiMenu        = new ToolStripMenuItem();
                        tsiMenu.Text   = dt.Tables[0].Rows[intFila]["Nombre"].ToString();
                        tsiMenu.Name   = dt.Tables[0].Rows[intFila]["nameMenu"].ToString();
                        tsiMenu.Tag    = dt.Tables[0].Rows[intFila]["N_Reporte"].ToString();
                        tsiMenu.Click += new EventHandler(this.LLamadoReporte_Click);

                        tsdReporte.DropDownItems.Add(tsiMenu);
                    }
                }
            }
        }
        private void Listar_Grilla()
        {
            SqlCommand cmd = new SqlCommand();
            //if (txt_NDocumento.Text == "")
            //{
            //    intN_Documento = 0;
            //}
            //else
            //    intN_Documento = Convert.ToInt64 (txt_NDocumento.Text);

            DataSet dt;

            cmd.CommandText = "pa_OrdenTrabajoPorCliente_sel " + txt_NCliente.Text;
            //pa_OrdenTrabajoPorFecha_sel
            cmd.CommandType = CommandType.Text;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            grdDatos.DataSource = dt.Tables[0];

            //if(txt_CodCliente.Text!="0")
            if (dt.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("No se ha ingresado información");
            }
        }
        public frmParametroMant(Int64 intCodigo)
        {
            InitializeComponent();
            Cargar_Estado();
            if (intCodigo == 0)
            {
                btn_Grabar.Text = "Grabar";
                this.Text       = "Agregar Configuración de parametro";
                cargar_valor_maximo();
                //
            }
            else
            {
                btn_Grabar.Text = "Modificar";
                this.Text       = "Modificar Configuración de parametro";
                txt_ID.Text     = intCodigo.ToString();
                SqlCommand cmd = new SqlCommand();
                //	 SqlCommand cmd = new SqlCommand();

                cmd.CommandText = "SELECT descripcion,orden,id_estado FROM conf_parametro where id_parametro= " + intCodigo.ToString();
                DataSet dt;
                dt = clsConector.Listar(Clases.clsBD.BD, cmd);

                txt_Descripcion.Text     = dt.Tables[0].Rows[0][0].ToString();
                txt_Orden.Text           = dt.Tables[0].Rows[0][1].ToString();
                cbx_EstadoId.Text        = dt.Tables[0].Rows[0][2].ToString();
                cbx_Estado.SelectedIndex = cbx_EstadoId.SelectedIndex;
            }
        }
Пример #7
0
        private void Listar_Cliente(Int64 intCliente)
        {
            //SqlCommand cmd = new SqlCommand();
            SqlCommand cmd = new SqlCommand();

            //MessageBox.Show("Conectado al servidor");

            if (intCliente != 0)
            {
                cmd.CommandText = "select id_cliente,run,razon_social,Direccion,telefono " +
                                  "from tbl_cliente " +
                                  "where  (id_cliente=" + intCliente.ToString() + ") or run ='" + txt_Rut.Text + "' " +
                                  " and id_estado= 1" +
                                  "order by id_cliente";
                txt_ref_cliente.Text = intCliente.ToString();
            }
            if (intCliente == 0)
            {
                cmd.CommandText = "select id_cliente,run,razon_social,Direccion,telefono " +
                                  "from tbl_cliente " +
                                  "where run  ='" + txt_Rut.Text + "' " + " and id_estado=1" +
                                  "order by id_cliente";
            }
            cmd.CommandType = CommandType.Text;

            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            if (dt.Tables[0].Rows.Count == 0)
            {
                txt_ref_cliente.Text      = "";
                txt_Rut.Text              = "";
                txt_RazonSocial.Text      = "";
                grp_Grilla.Enabled        = grpPersonal.Enabled = chk_AsignarTLD.Enabled = false;
                tsbPersonal.Visible       = tsbGuardar.Visible = false;
                bolDesdeCodigo            = false;
                chk_AsignarTLD.Checked    = false;
                btn_cargarCliente.Enabled = true;
            }
            else
            {
                txt_ref_cliente.Text      = dt.Tables[0].Rows[0]["id_cliente"].ToString();
                txt_Rut.Text              = dt.Tables[0].Rows[0]["run"].ToString();
                txt_RazonSocial.Text      = dt.Tables[0].Rows[0]["razon_social"].ToString();
                txt_ref_cliente.ReadOnly  = true;
                txt_Rut.ReadOnly          = true;
                grp_Grilla.Enabled        = grpPersonal.Enabled = chk_AsignarTLD.Enabled = true;
                tsbGuardar.Visible        = Modificacion;
                tsbPersonal.Visible       = Nuevo;
                txt_RazonSocial.ReadOnly  = true;
                btn_cargarCliente.Enabled = false;
                bolDesdeCodigo            = true;
                Cargar_Seccion();
                Cargar_Estado();
                Cargar_CodServicio();
                Listar_Personal();
                picFiltrarpersonal_Click(null, null);
            }
        }
Пример #8
0
        private void Cargar_TLD(int intTld)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "pa_ListadoDatosTLD " + intintId_Estado_temp.ToString() + "," + intTld.ToString();
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt.Tables[0].Rows.Count > 0)
            {
                lbl_NCliente.Text       = dt.Tables[0].Rows[0]["id_cliente"].ToString();
                lbl_NombreCliente.Text  = dt.Tables[0].Rows[0]["razon_social"].ToString();
                lbl_Periodo.Text        = dt.Tables[0].Rows[0]["tri"].ToString();
                lbl_TLD.Text            = dt.Tables[0].Rows[0]["n_dosimetro"].ToString();
                nudPosicion.Value       = Convert.ToInt32(dt.Tables[0].Rows[0]["PosDisco"].ToString());
                lbl_NombrePersonal.Text = dt.Tables[0].Rows[0]["nombrecompleto"].ToString();
                btn_Guardar.Visible     = true;
                txt_TLD.Text            = "";
                txtHasta.Text           = "";
                btn_Guardar.Enabled     = true;
            }
            else
            {
                LimpiarPantalla();
                txt_TLD.Text        = "";
                txtHasta.Text       = "";
                btn_Guardar.Enabled = false;
                MessageBox.Show("No se puede ingresar a este proceso, verifique en que estado se encuentra.");
            }
        }
        private void Listar_Grilla()
        {
            // CARGAR CLIENTES CON CHECKBOX CAMPO MARCA DESDE [pa_Dosimetro_Cliente_sel]

            SqlCommand cmd = new SqlCommand();
            //Int64  intN_Documento;

            /*
             * if (txt_NDocumento.Text == "")
             * {
             *  intN_Documento = 0;
             * }
             * else
             *  intN_Documento = Convert.ToInt64 (txt_NDocumento.Text);
             */
            DataSet dt;

            //  switch (intintId_Estado_temp)
            //  {
            //      case 0:
            cmd.CommandText = "pa_Dosimetro_Cliente_sel " + cbx_periodo.SelectedValue.ToString() + "," + intintId_Estado_temp.ToString();
            //          break;
            //      case 2:
            //          cmd.CommandText = "pa_Dosimetro_sel " + txt_CodCliente.Text + "," + cbx_id_periodo.Text + "," + intintId_Estado_temp.ToString() + "," + intN_Documento.ToString();
            //          break;
            //  }
            cmd.CommandType = CommandType.Text;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            grdDatos.DataSource = dt.Tables[0];

            //if(txt_CodCliente.Text!="0")

            if (dt.Tables [0].Rows.Count == 0)
            {
                MessageBox.Show("No existe información de clientes en este período");
            }

            //string filterExp = "id_cliente=" + lbl_id_cliente.Text;
            //string sortExp = "Per";
            //DataRow[] drarray;
            //drarray = dt.Tables[0].Select(filterExp, sortExp, DataViewRowState.CurrentRows);

            //  groupBox2.Text = "Listado       Registro:" + drarray.Count().ToString();
            // intContar = drarray.Count();
            //groupBox2   intContar
            //if (dt.Tables[0].Rows.Count == 0)
            //{
            //    btn_Guardar.Visible = false;
            //    MessageBox.Show("No se han cargado ningun número de pelicula para el cliente");
            //}
            //else
            //{
            //    btn_Guardar.Visible = true;
            //   // MessageBox.Show("Se encontraron personal asociado al cliente");
            //}
        }
Пример #10
0
        private void Listar_Cliente(Int64 intCliente)
        {
            //SqlCommand cmd = new SqlCommand();
            SqlCommand cmd = new SqlCommand();

            //MessageBox.Show("Conectado al servidor");

            if (intCliente != 0)
            {
                cmd.CommandText = "select id_cliente,run,razon_social,Direccion,telefono " +
                                  "from tbl_cliente " +
                                  "where  (id_cliente=" + intCliente.ToString() + ") or run ='" + txt_Rut.Text + "' " +
                                  " and id_estado=1 " +
                                  "order by id_cliente";
                txt_ref_cliente.Text = intCliente.ToString();
            }
            if (intCliente == 0)
            {
                cmd.CommandText = "select id_cliente,run,razon_social,Direccion,telefono " +
                                  "from tbl_cliente " +
                                  "where run  ='" + txt_Rut.Text + "' " + " and id_estado=1 " +
                                  "order by id_cliente";
            }
            cmd.CommandType = CommandType.Text;

            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            if (dt.Tables[0].Rows.Count == 0)
            {
                txt_ref_cliente.Text = "";
                txt_Rut.Text         = "";
                txt_RazonSocial.Text = "";
                tsb_Agregar.Visible  = false;
            }
            else
            {
                txt_ref_cliente.Text     = dt.Tables[0].Rows[0]["id_cliente"].ToString();
                txt_Rut.Text             = dt.Tables[0].Rows[0]["run"].ToString();
                txt_RazonSocial.Text     = dt.Tables[0].Rows[0]["razon_social"].ToString();
                txt_ref_cliente.ReadOnly = true;
                txt_Rut.ReadOnly         = true;
                tsb_Agregar.Visible      = true;
                txt_RazonSocial.ReadOnly = true;
                Listar_Personal();
            }

            Clases.ClsPersonal.Id_Personal = 0;
            Clases.ClsPersonal.Materno     = "";
            Clases.ClsPersonal.Nombres     = "";
            Clases.ClsPersonal.Paterno     = "";
            Clases.ClsPersonal.Rut         = "";
        }
Пример #11
0
        private void frmMantenedorClienteRazonSocial_Load(object sender, EventArgs e)
        {
            SqlCommand cmdcombo = new SqlCommand();
            DataSet    dtcombo;

            cmdcombo.CommandText = "select 0 as Id_DetParametro, 'Seleccione' as Glosa, 0 as orden union all " +
                                   "SELECT Id_DetParametro,Glosa,orden FROM conf_detparametro where id_estado=1 and Id_Parametro=2 order by orden ";
            cmdcombo.CommandType = CommandType.Text;
            dtcombo = Conectar.Listar(Clases.clsBD.BD, cmdcombo);
            AsignarPermiso();
            Cargar_Reporte();
            Cargar_Propiedades();
        }
Пример #12
0
        public frmIngresoDosimetriaV2(Int64 intId_Cliente)
        {
            InitializeComponent();

            SqlCommand cmdcombo = new SqlCommand();
            //	SqlCommand cmdcombo = new SqlCommand();
            DataSet dtcombo;

            cmdcombo.CommandText = "select 0 as Id_DetParametro, 'Seleccione' as Glosa, 0 as orden union all " +
                                   "SELECT Id_DetParametro,Glosa,orden FROM conf_detparametro where id_estado=1 and Id_Parametro=2 order by orden ";
            cmdcombo.CommandType = CommandType.Text;
            dtcombo = Conectar.Listar(Clases.clsBD.BD, cmdcombo);

            DataGridViewComboBoxColumn comboboxColumn = grdDatos.Columns["Estado"] as DataGridViewComboBoxColumn;

            //
            comboboxColumn.DataSource    = dtcombo.Tables[0];
            comboboxColumn.DisplayMember = "Glosa";
            comboboxColumn.ValueMember   = "Id_DetParametro";


            AsignarEvento();
            Cargar_Cliente(intId_Cliente);
            Cargar_Anno();
            pnl_Progreso.Visible = false;
            grp_ingreso.Visible  = false;
        }
        private void CargarGrilla()
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SELECT  [Id],[run],[Email],Id_Depto  FROM [dbo].[tbl_cliente_Email] where run='" + Rut + "'";

            cmd.CommandType = CommandType.Text;

            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            dgvGrilla.DataSource = dt.Tables[0];
        }
Пример #14
0
        private void Cargar_Anno(ref ComboBox cbxAnno)
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "SELECT distinct Anno FROM conf_periodo WHERE Id_TipoPeriodo=3"
            };
            //cmd.CommandText = "SELECT Id_Periodo,Anno, Mes,Id_TipoPeriodo FROM conf_periodo WHERE Id_TipoPeriodo=3";
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            cbxAnno.DisplayMember = dt.Tables[0].Columns[0].Caption.ToString();
            cbxAnno.DataSource    = dt.Tables[0];
        }
        private void CargarGrilla()
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SELECT  [Id_perfil] as id,Descripcion,Id_estado FROM [dbo].[tbl_perfil]  order by Descripcion";

            cmd.CommandType = CommandType.Text;

            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            dgvGrilla.DataSource = dt.Tables[0];
        }
        private void AsignarEvento()
        {
            SqlCommand cmd = new SqlCommand();

            //	SqlCommand cmd = new SqlCommand();
            DataSet dt;
            string  strname;

            foreach (System.Windows.Forms.Control c in tbl_Usuario.Controls)
            {
                //foreach (Control childc in c.Controls)
                //{
                if (c is TextBox)
                {
                    strname = ((TextBox)c).Name;

                    cmd.CommandText = "SELECT  requerido, validacion " +
                                      " FROM glo_configuracioncampo WHERE campo= '" + strname.Replace("txt_", "") + "'";

                    dt = Conectar.Listar(Clases.clsBD.BD, cmd);
                    if (dt.Tables[0].Rows.Count == 0)
                    {
                        ((TextBox)c).KeyPress += new KeyPressEventHandler(ClaseEvento.Avanzar_KeyPress);
                    }
                    else
                    {
                        if (dt.Tables[0].Rows[0]["validacion"].ToString() == "rut")
                        {
                            ((TextBox)c).KeyPress  += new KeyPressEventHandler(ClaseEvento.Rut_KeyPress);
                            ((TextBox)c).KeyDown   += new KeyEventHandler(ClaseEvento.Rut_KeyDown);
                            ((TextBox)c).Validated += new EventHandler(ClaseEvento.validarut_Validated);
                        }
                        if (dt.Tables[0].Rows[0]["validacion"].ToString() == "numerico")
                        {
                            ((TextBox)c).KeyPress += new KeyPressEventHandler(ClaseEvento.Numero_KeyPress);
                            ((TextBox)c).KeyDown  += new KeyEventHandler(ClaseEvento.Numero_KeyDown);
                        }
                    }
                }
                if (c is ComboBox)
                {
                    ((ComboBox)c).KeyPress += new KeyPressEventHandler(ClaseEvento.Avanzar_KeyPress);
                }
                if (c is DateTimePicker)
                {
                    ((DateTimePicker)c).KeyPress += new KeyPressEventHandler(ClaseEvento.Avanzar_KeyPress);
                }
            }
        }
        private void frmConsultaFilmico_Load(object sender, EventArgs e)
        {
            SqlCommand cmdcombo = new SqlCommand();
            //SqlCommand cmdcombo = new SqlCommand();
            DataSet dtcombo;

            cmdcombo.CommandText = "select 0 as Id_DetParametro, 'Seleccione' as Glosa, 0 as orden union all " +
                                   "SELECT Id_DetParametro,Glosa,orden FROM conf_detparametro where id_estado=1 and Id_Parametro=2 order by orden ";
            cmdcombo.CommandType = CommandType.Text;
            dtcombo = Conectar.Listar(Clases.clsBD.BD, cmdcombo);

            pnl_Progreso.Visible = false;
            grpFiltro.Enabled    = false;
            Cargar_Anno();
        }
        private void Cargar_Cliente(Int64 intCodCliente)
        {
            SqlCommand cmd = new SqlCommand();

            //  SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SELECT run,Razon_Social,N_Cliente_Ref,Direccion,Id_Region,Id_Provincia,Id_Comuna,Telefono, Id_TipoFuente,Id_estado,Fechainicio " +
                              " FROM tbl_cliente WHERE Id_cliente= " + intCodCliente.ToString();
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            lbl_id_cliente.Text    = intCodCliente.ToString();
            lbl_nombreCliente.Text = dt.Tables[0].Rows[0]["Razon_Social"].ToString();
        }
Пример #19
0
        private void Cargar_Fecha()
        {
            SqlCommand cmd = new SqlCommand();

            //	  SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "pa_ListarPeriodoFechaTermino_sel";
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            cbx_id_periodo.DisplayMember = dt.Tables[0].Columns[0].Caption.ToString();
            cbx_id_periodo.ValueMember   = dt.Tables[0].Columns[0].Caption.ToString();
            cbx_id_periodo.DataSource    = dt.Tables[0];
            dtp_FechaTermino.Text        = cbx_id_periodo.SelectedValue.ToString();
        }
Пример #20
0
        private void Cargar()
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "  SELECT [Desde] , [Credencial],[Clave],[Host],[Port]  FROM [dbo].[conf_Correo] where Id_Depto=" + cbx_Id_Depto.SelectedValue
            };
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            txt_Desde.Text      = dt.Tables[0].Rows[0]["Desde"].ToString();
            txt_Host.Text       = dt.Tables[0].Rows[0]["Host"].ToString();
            txt_Port.Text       = dt.Tables[0].Rows[0]["Port"].ToString();
            txt_Credencial.Text = dt.Tables[0].Rows[0]["Credencial"].ToString();
            txt_Clave.Text      = dt.Tables[0].Rows[0]["Clave"].ToString();
            try
            {
                txt_Clave1.Text = clsUtiles1.DecryptTripleDES(dt.Tables[0].Rows[0]["Clave"].ToString());
            }
            catch (Exception)
            {
                txt_Clave1.Text = clsUtiles1.GenerateHashMD5(dt.Tables[0].Rows[0]["Clave"].ToString());
                txt_Clave.Text  = dt.Tables[0].Rows[0]["Clave"].ToString();
            }
        }
        private void btnBuscarTLD_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txt_NTLD.Text))
            {
                classFuncionesGenerales.mensajes.MensajeError("Debe ingrsar un número de TLD");
                return;
            }
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = String.Format("pa_ConsultaDatosTLD_sel {0}", String.IsNullOrEmpty(txt_NTLD.Text) ? "0" : txt_NTLD.Text);
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt.Tables[0].Rows.Count == 1)
            {
                lblDirección.Text = dt.Tables[0].Rows[0]["Direccion"].ToString();
                lblNCliente.Text  = dt.Tables[0].Rows[0]["Id_cliente"].ToString();
                lblRut.Text       = dt.Tables[0].Rows[0]["RutPersona"].ToString();
                int intPeriodo = Convert.ToInt16(dt.Tables[0].Rows[0]["id_periodo"].ToString());
                clsFunc.Cargar_Cliente(intPeriodo, Convert.ToInt64(lblNCliente.Text.ToString()), ref lbl_rut_cliente, ref lbl_nombreCliente);

                btnBuscarTLD.Enabled = false;
                txt_NTLD.Enabled     = false;
                btn_Guardar.Enabled  = true;
            }
            else
            if (dt.Tables[0].Rows.Count > 1)
            {
                lblDirección.Text   = "";
                lblNCliente.Text    = "";
                lblRut.Text         = "";
                txt_NTLD.Enabled    = false;
                btn_Guardar.Enabled = false;

                MessageBox.Show("Existe mas cliente con el mismo N° documento");
            }
            else
            if (dt.Tables[0].Rows.Count == 0)
            {
                lblDirección.Text   = "";
                lblNCliente.Text    = "";
                lblRut.Text         = "";
                btn_Guardar.Enabled = false;
                txt_NTLD.Enabled    = false;
                MessageBox.Show("Documento no existe");
            }
        }
        private Documento BuscarDocumento(int iddoc)
        {
            Documento doc = null;
            SqlCommand sqlcmd = new SqlCommand
            {
                CommandText = "" +
            "SELECT	[Doc_Id], [Doc_Id_cliente], [Doc_Id_periodo],[Doc_Nombre], [Doc_Descripcion], [Doc_Extension], " +
            " [Doc_Archivo], [Doc_Id_Tipo_Documento] FROM	ges_documentos WHERE	[Doc_Id] = @Doc_Id"
            };
            sqlcmd.Parameters.Add("@Doc_Id", SqlDbType.Int).Value = iddoc;

            DataTable dtt = Conectar.Listar(Clases.clsBD.BD,sqlcmd).Tables[0];

            DataRow dr;
            if (dtt.Rows.Count == 1)
            {
                doc = new Documento();
                dr = dtt.Rows[0];

                doc.Doc_Id = iddoc;
                doc.Doc_Id_Cliente = Convert.ToInt32(dr["Doc_Id_Cliente"]);
                doc.Doc_Id_Periodo = Convert.ToInt32(dr["Doc_Id_Periodo"]);
                doc.Doc_Nombre = dr["Doc_Nombre"].ToString();
                doc.Doc_Descripcion = dr["Doc_Descripcion"].ToString();
                doc.Doc_Extension = dr["Doc_Extension"].ToString();
                doc.Doc_Archivo = (byte[])dr["Doc_Archivo"];
                doc.Doc_Id_Tipo_Documento = Convert.ToInt32(dr["Doc_Id_Tipo_Documento"]);
            }

            return doc;
        }
        private void Cargar_Cliente()
        {
            frmAyudaCliente frm = new frmAyudaCliente(Convert.ToInt64(txt_IdCliente.Text));

            if (frm.ShowDialog() == DialogResult.OK)
            {
                lbl_nombreCliente.Text = Clases.ClsCliente.Nombres;
                lbl_Rut.Text           = Clases.ClsCliente.Rut;

                SqlCommand cmd = new SqlCommand
                {
                    //	SqlCommand cmd = new SqlCommand();CargarClientePorRun

                    CommandText = String.Format("CargarClientePorRun '{0}'", lbl_Rut.Text)
                };
                DataSet dt;
                dt = Conectar.Listar(Clases.clsBD.BD, cmd);

                if (dt.Tables[0].Rows.Count > 0)
                {
                    cbx_anno.DataSource    = dt.Tables[1];
                    cbxSucursal.DataSource = dt.Tables[2];

                    LimpiarFormulario(1);
                }
            }
            else
            {
                LimpiarFormulario(2);
                LimpiarFormulario(3);
            }
        }
        private void Listar_Grilla()
        {
            SqlCommand cmd = new SqlCommand();
            DataSet    dt;

            cmd.CommandText = String.Format("pa_ConsultaCorregirHistorial_sel {0}", lbl_id_cliente.Text);
            // pa_OrdenTrabajo_sel
            cmd.CommandType = CommandType.Text;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            grdCliente.DataSource   = dt.Tables[0];
            dtgHistorial.DataSource = dt.Tables[1];
            //if(txt_CodCliente.Text!="0")
            if (dt.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("No se ha ingresado información");
            }
        }
Пример #25
0
        private void Cargar_TLD(Int64 intNTLD)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "pa_ListarDatosTLD_sel " + intNTLD.ToString();
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt.Tables[0].Rows.Count == 1)
            {
                lbl_NCliente.Text      = dt.Tables[0].Rows[0]["Id_cliente"].ToString();
                lbl_NombreCliente.Text = dt.Tables[0].Rows[0]["Razon_Social"].ToString();
                lblRut.Text            = dt.Tables[0].Rows[0]["run"].ToString();
                Cargar_Personal(dt.Tables[0].Rows[0]["Id_cliente"].ToString(), lblRut.Text);
                cbx_PersonalActual.SelectedValue = dt.Tables[0].Rows[0]["Id_Personal"];
                btn_Cargar.Enabled  = false;
                txt_NDoc.Enabled    = false;
                btn_Guardar.Enabled = true;
                grpDatos.Enabled    = true;
            }
            else
            if (dt.Tables[0].Rows.Count > 1)
            {
                lbl_NCliente.Text      = "";
                lbl_NombreCliente.Text = "";
                lblRut.Text            = "";
                btn_Guardar.Enabled    = false;
                grpDatos.Enabled       = false;
                MessageBox.Show("No existe el número TLD");
            }
            else
            if (dt.Tables[0].Rows.Count == 0)
            {
                lbl_NCliente.Text      = "";
                lbl_NombreCliente.Text = "";
                lblRut.Text            = "";
                grpDatos.Enabled       = false;
                btn_Guardar.Enabled    = false;
                MessageBox.Show("TLD no existe");
            }
        }
        public frmModuloEnviado(int intId_Estado)
        {
            InitializeComponent();

            SqlCommand cmdcombo = new SqlCommand();
            //	SqlCommand cmdcombo = new SqlCommand();
            DataSet dtcombo;

            cmdcombo.CommandText = "select 0 as Id_DetParametro, 'Seleccione' as Glosa, 0 as orden union all " +
                                   "SELECT Id_DetParametro,Glosa,orden FROM conf_detparametro where id_estado=1 and Id_Parametro=2 order by orden ";
            cmdcombo.CommandType = CommandType.Text;
            dtcombo = Conectar.Listar(Clases.clsBD.BD, cmdcombo);


            AsignarEvento();
            intintId_Estado_temp = intId_Estado;
            switch (intintId_Estado_temp)
            {
            case 0:
                this.Text = "Envio Dosimetros o TLD";
                break;

            case 1:
                this.Text = "Recepción Dosimetros";
                break;

            case 6:
                this.Text = "Informe Generado";
                break;
            }
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "pa_Log_usuario_ins '" + Clases.clsUsuario.Usuario + "',' " + this.Text + "'",
                CommandType = CommandType.Text
            };

            Conectar.AgregarModificarEliminar(Clases.clsBD.BD, cmd);
            Cargar_Anno();
            pnl_Progreso.Visible = false;
            btn_Guardar.Enabled  = false;
        }
Пример #27
0
        private void Listar_Referencia()
        {
            //SqlCommand cmd = new SqlCommand();
            SqlCommand cmd = new SqlCommand();

            //MessageBox.Show("Conectado al servidor");


            cmd.CommandText = "select id_referencia,encargado,fono,email " +
                              "from tbl_encargado " +
                              "where id_estado = " + cbx_EstadoId.SelectedValue + " and id_cliente= " + lbl_Codigo.Text + " " +
                              "order by id_cliente";
            cmd.CommandType = CommandType.Text;


            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            grdDatos.DataSource = dt.Tables[0];
        }
Пример #28
0
        private void Cargar_Cliente(Int64 intCodCliente)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "select run,Razon_Social,N_Cliente_Ref, Fechainicio " +
                              "  FROM tbl_cliente WHERE Id_cliente= " + intCodCliente.ToString();
            DataSet dt;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);
            if (dt.Tables[0].Rows.Count > 0)
            {
                lbl_id_cliente.Text          = intCodCliente.ToString();
                lbl_run.Text                 = dt.Tables[0].Rows[0]["run"].ToString();
                lbl_nombrecliente.Text       = dt.Tables[0].Rows[0]["Razon_Social"].ToString();
                dtp_FechaInicio.Text         = dt.Tables[0].Rows[0]["FechaInicio"].ToString();
                btn_Modificar.Visible        = true;
                btn_ModificarTermino.Visible = true;
            }
            else
            {
                lbl_id_cliente.Text    = "";
                lbl_nombrecliente.Text = "";
                lbl_run.Text           = "";
                dtp_FechaInicio.Text   = "";
                if (intCodCliente != 0)
                {
                    MessageBox.Show("El cliente no existe");
                }
            }
        }
Пример #29
0
        public static DataSet FiltroPersonal(int intIdCliente, string NombrePersonal, string Rut, string FecNac, int intEstado, int Id_Seccion, bool bolListarSinDireccion)
        {
            DataSet dt = new DataSet();
            clsConectorSqlServer Conectar = new clsConectorSqlServer();
            SqlCommand           cmd      = new SqlCommand();

            cmd.CommandText = String.Format("pa_ListarPersonalFiltro_sel {0},'{1}','{2}','{3}',{4},{5},{6}", intIdCliente.ToString(), NombrePersonal, Rut, FecNac, intEstado, Id_Seccion, (bolListarSinDireccion?1:0));
            cmd.CommandType = CommandType.Text;

            dt = Conectar.Listar(Clases.clsBD.BD, cmd);

            return(dt);
        }
        public void Llamado_reporte(DataSet ds, String NombreReporte)
        {
            DataSet    dtformato;
            SqlCommand cmdArchivo = new SqlCommand();

            cmdArchivo.CommandText = "" +
                                     "SELECT Id_DetParametro,Glosa,orden FROM conf_detparametro where id_estado=1 and Id_Parametro=7 order by orden ";
            cmdArchivo.CommandType = CommandType.Text;
            dtformato = Conectar.Listar(Clases.clsBD.BD, cmdArchivo);
            // string targetPath = @ConfigurationManager.AppSettings["Archivo"] + "Cliente " + lbl_id_cliente.Text;
            string targetPath = @dtformato.Tables[0].Rows[0]["Glosa"].ToString();

            reportViewer1.LocalReport.ReportEmbeddedResource = "ControlDosimetro.reporte." + NombreReporte;
            //reportViewer1.LocalReport.ReportPath = targetPath + "rptDosimetria.rdlc";
            ReportDataSource datasource = new ReportDataSource("DataSet1", ds.Tables[0]);

            this.reportViewer1.LocalReport.DataSources.Clear();

            this.reportViewer1.LocalReport.DataSources.Add(datasource);

            this.reportViewer1.RefreshReport();
        }