コード例 #1
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);
            }
        }
コード例 #2
0
        private void btn_Dosis_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            frmreporte frm = new frmreporte(dt, null, 8);

            frm.Show(this);
            Cursor = Cursors.Default;
        }
コード例 #3
0
        private void tsb_Verificacion_Click(object sender, EventArgs e)
        {
            DataSet dt;

            dt = Cargar_DosimetrioAnual();

            frmreporte frm = new frmreporte(dt, dt, 5);

            frm.Show(this);
        }
コード例 #4
0
        private void Btn_Imprimir_Click(object sender, EventArgs e)
        {
            DataSet dt;

            dt = RptSobre(Convert.ToInt64(lbl_id_cliente.Text));

            frmreporte frm = new frmreporte(dt, dt, 2);

            frm.Show(this);
        }
コード例 #5
0
        private void btn_Reporte_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            DataSet dt;

            dt = Llamadoreporte();

            frmreporte frm = new frmreporte(dt, dt, 3);

            frm.Show(this);

            Cursor = Cursors.Default;
        }
コード例 #6
0
        static public void CargarReporteListadoTLD()
        {
            clsConectorSqlServer Conectar = new clsConectorSqlServer();
            SqlCommand           cmd      = new SqlCommand
            {
                CommandText = "rtpListaIngresoTLD"
            };
            //cmd.CommandText = "SELECT Id_Periodo,Anno, Mes,Id_TipoPeriodo FROM conf_periodo WHERE Id_TipoPeriodo=3";
            DataSet ds;

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


            frmreporte frm3 = new frmreporte(ds, null, 9)
            {
                ShowInTaskbar = false
            };

            frm3.Show();
        }
コード例 #7
0
        private void Btn_Imprimir_Click(object sender, EventArgs e)
        {
            DataSet    ds  = new DataSet();
            DataSet    ds2 = new DataSet();
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "rtpDosimetriaPersonal_Enc " + lbl_id_cliente.Text + "," + cbx_id_periodo.SelectedValue + "," + cbx_NDocumento.Text,
                CommandType = CommandType.Text
            };

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

            cmd.CommandText = "rtpDosimetriaPersonal_det " + lbl_id_cliente.Text + "," + cbx_id_periodo.SelectedValue + "," + cbx_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 btn_Guardar_Click(object sender, EventArgs e)
        {
            DataTable tabla = new DataTable();

            tabla.Columns.Add("N_orden");
            tabla.Columns.Add("Institucion");
            tabla.Columns.Add("Fecha");
            tabla.Columns.Add("Trimestre");
            tabla.Columns.Add("N_dosimetros");
            SqlCommand cmd = new SqlCommand();
            //// SqlCommand cmd = new SqlCommand();

            ////// dtcombo = Conectar.Listar(Clases.clsBD.BD,cmdcombo);

            DataGridViewCheckBoxCell checkMarca;

            //  string strId;
            pnl_Progreso.Visible = true;
            btn_Guardar.Enabled  = false;
            pnl_Progreso.Text    = "Progreso de Grabado";
            pnl_Progreso.Refresh();
            pgb_Barra.Minimum = 0;
            pgb_Barra.Maximum = grdDatos.RowCount;//

            //        DataRow workRow;

            cmd.CommandText = "select isnull(max(n_orden),0) as N_orden from ges_OrdenTrabajo";
            cmd.CommandType = CommandType.Text;
            DataSet ds1 = new DataSet();

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

            int intN_Orden;

            if (ds1.Tables[0].Rows.Count == 0)
            {
                intN_Orden = 1;
            }
            else
            {
                intN_Orden = Convert.ToInt32(ds1.Tables[0].Rows[0]["N_orden"].ToString()) + 1;
            }

            for (int i = 0; i <= grdDatos.RowCount - 1; ++i)
            {
                pgb_Barra.Value = i + 1;
                pgb_Barra.Refresh();
                checkMarca = (DataGridViewCheckBoxCell)grdDatos.Rows[i].Cells["marca"];
                DataGridViewTextBoxCell txtRazon_Social = (DataGridViewTextBoxCell)grdDatos.Rows[i].Cells["Razon_Social"];

                DataGridViewTextBoxCell txtFechaOrdenTrabajo = (DataGridViewTextBoxCell)grdDatos.Rows[i].Cells["FechaOrdenTrabajo"];
                DataGridViewTextBoxCell txtperiodo           = (DataGridViewTextBoxCell)grdDatos.Rows[i].Cells["periodo"];
                DataGridViewTextBoxCell txtN_Dosimetro       = (DataGridViewTextBoxCell)grdDatos.Rows[i].Cells["N_Dosimetro"];
                DataGridViewTextBoxCell txtid = (DataGridViewTextBoxCell)grdDatos.Rows[i].Cells["id"];


                if (checkMarca.Value.ToString() == "1")
                {
                    cmd.CommandText = "INSERT INTO [dbo].[ges_OrdenTrabajo] ([n_orden],[Razon_Social],[FechaOrdenTrabajo],[Periodo],[n_dosimetro],id_dosimetro)" +
                                      "values(" + intN_Orden.ToString() + ",'" + txtRazon_Social.Value + "','" + txtFechaOrdenTrabajo.Value + "','" + txtperiodo.Value + "','" + txtN_Dosimetro.Value + "','" + txtid.Value + "')";
                    cmd.CommandType = CommandType.Text;

                    Conectar.AgregarModificarEliminar(Clases.clsBD.BD, cmd);


                    cmd.CommandText = "pa_DosimetroOrdenTrabajo_upd " + intintId_Estado_temp.ToString() + ",'" + Clases.clsUsuario.Usuario + "','" + txtFechaOrdenTrabajo.Value + "','" + txtid.Value + "'";
                    cmd.CommandType = CommandType.Text;
                    Conectar.AgregarModificarEliminar(Clases.clsBD.BD, cmd);
                }
            }
            DataSet dsrpt = new DataSet();

            cmd.CommandText = "rptOrdenTrabajo " + intN_Orden.ToString();

            cmd.CommandType = CommandType.Text;

            dsrpt = Conectar.Listar(Clases.clsBD.BD, cmd);
            //rptOrdenTrabajo
            frmreporte frm = new frmreporte(dsrpt, ds1, 4);

            frm.Show(this);
            Listar_Grilla();
            MessageBox.Show("Informacion grabada");
            btn_Guardar.Enabled  = true;
            pnl_Progreso.Visible = false;
        }