Exemple #1
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                string returnValue = null;

                // Look for the name in the connectionStrings section.
                ConnectionStringSettings settings =
                    ConfigurationManager.ConnectionStrings["ProfitContenedor.Properties.Settings.Profit_RGConnectionString"];

                // If found, return the connection string.
                if (settings != null)
                {
                    returnValue = settings.ConnectionString;
                }

                //SqlConnection sqlConn = new SqlConnection("Server=172.16.1.4;uid=profit;password=profit;initial catalog=Profit_RG;");
                SqlConnection sqlConn = new SqlConnection(returnValue);


                SqlCommand comd;
                comd             = new SqlCommand();
                comd.Connection  = sqlConn;
                comd.CommandType = CommandType.StoredProcedure;
                comd.CommandText = "pRepResumenMetasVentas";

                comd.Parameters.Add("@Grupo", SqlDbType.NChar);
                comd.Parameters[0].Value = cboGrupo.Text.Trim();
                comd.Parameters.Add("@Desde", SqlDbType.DateTime);
                comd.Parameters[1].Value = txtDesde.Value;
                comd.Parameters.Add("@Hasta", SqlDbType.DateTime);
                comd.Parameters[2].Value = txtHasta.Value;


                SqlDataAdapter sqlAdapter = new SqlDataAdapter();
                sqlAdapter.SelectCommand = comd;
                DataSet ds = new DataSet();
                sqlAdapter.Fill(ds, "pRepResumenMetasVentas");

                FrmRep Fr = new FrmRep(ds, "RepResumenMetasVtas.rpt", false);
                Fr.Show();
            }
            catch (Exception ex1)
            {
                MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        /// <summary>
        /// Programacion del Reporte: RepAutorizacion
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonItem3_Click(object sender, EventArgs e)
        {
            try
            {
                string returnValue = null;

                // Look for the name in the connectionStrings section.
                ConnectionStringSettings settings =
                    ConfigurationManager.ConnectionStrings["ProfitContenedor.Properties.Settings.Profit_RGConnectionString"];

                // If found, return the connection string.
                if (settings != null)
                {
                    returnValue = settings.ConnectionString;
                }

                //SqlConnection sqlConn = new SqlConnection("Server=172.16.1.4;uid=profit;password=profit;initial catalog=Profit_RG;");
                SqlConnection sqlConn = new SqlConnection(returnValue);


                SqlCommand comd;
                comd             = new SqlCommand();
                comd.Connection  = sqlConn;
                comd.CommandType = CommandType.StoredProcedure;
                comd.CommandText = "pSeleccionarEmpleadobyActivo";

                comd.Parameters.Add("@id_activo", SqlDbType.NChar);
                comd.Parameters[0].Value = txtCo_activo.Text.Trim();



                SqlDataAdapter sqlAdapter = new SqlDataAdapter();
                sqlAdapter.SelectCommand = comd;
                DataSet ds = new DataSet();
                sqlAdapter.Fill(ds, "pSeleccionarEmpleadobyActivo");

                FrmRep Fr = new FrmRep(ds, "RepAutorizacion.rpt", false);
                Fr.Show();
            }
            catch (Exception ex1)
            {
                MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                string returnValue = null;

                // Look for the name in the connectionStrings section.
                ConnectionStringSettings settings =
                    ConfigurationManager.ConnectionStrings["ProfitContenedor.Properties.Settings.Profit_RGConnectionString"];

                // If found, return the connection string.
                if (settings != null)
                {
                    returnValue = settings.ConnectionString;
                }

                //SqlConnection sqlConn = new SqlConnection("Server=192.168.1.4;uid=profit;password=profit;initial catalog=Profit_RG;");
                SqlConnection sqlConn = new SqlConnection(returnValue);


                SqlCommand comd;
                comd             = new SqlCommand();
                comd.Connection  = sqlConn;
                comd.CommandType = CommandType.StoredProcedure;
                comd.CommandText = "pRepEmbarque";
                comd.Parameters.Add("@Nro_viaje", SqlDbType.Int);
                comd.Parameters[0].Value = Convert.ToInt32(txtViaje.Text);
                SqlDataAdapter sqlAdapter = new SqlDataAdapter();
                sqlAdapter.SelectCommand = comd;
                DataSet ds = new DataSet();
                sqlAdapter.Fill(ds, "pRepEmbarque");

                FrmRep Fr = new FrmRep(ds, "RepEmbarques.rpt");
                Fr.Show();
            }
            catch (Exception ex1)
            {
                MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }