Beispiel #1
0
        private void lklDetalle_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            eDETALLE_IMPUESTO o = new eDETALLE_IMPUESTO();

            o.IMP_codigo = this.txtCodigo.Text;
            frmOP_AsignacionImpuesto o2 = new frmOP_AsignacionImpuesto(o);

            o2.MdiParent = this.MdiParent;
            o2.Show();
        }
Beispiel #2
0
        public frmOP_AsignacionImpuesto(eDETALLE_IMPUESTO o)
        {
            InitializeComponent();
            tabla = "IMPUESTO";

            this._o = o;

            this.cmbImpuesto.ValueMember   = "IMP_codigo";
            this.cmbImpuesto.DisplayMember = "IMP_nombre_corto";
            this.cmbImpuesto.DataSource    = balIMPUESTO.poblar();
        }
        public bool eliminarGrilla(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_op_DETALLE_IMPUESTO_eliminarGrilla";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeDETALLE_IMPUESTO.IMP_codigo));

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
        public bool actualizarFila(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_op_DETALLE_IMPUESTO_insertar_actualizar";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeDETALLE_IMPUESTO.IMP_codigo));
                cmd.Parameters.Add(new SqlParameter("@DIM_PORCENTAJE", oeDETALLE_IMPUESTO.DIM_porcentaje));

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
        public DataTable obtenerDetallePorImpuesto(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "[pa_bf_DETALLE_IMPUESTO_CargarPorImpuesto]";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter dad = new SqlDataAdapter(cmd);
                dad.SelectCommand.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeDETALLE_IMPUESTO.IMP_codigo));

                DataTable dt = new DataTable();
                dad.Fill(dt);

                return(dt);
            }
        }
        public bool actualizarRegistro(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_DETALLE_IMPUESTO_actualizarRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeDETALLE_IMPUESTO.IMP_codigo));                 //variable tipo:string
                cmd.Parameters.Add(new SqlParameter("@DIM_NUMERO", oeDETALLE_IMPUESTO.DIM_numero));                 //variable tipo:int
                cmd.Parameters.Add(new SqlParameter("@DIM_PORCENTAJE", oeDETALLE_IMPUESTO.DIM_porcentaje));         //variable tipo:double

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
Beispiel #7
0
        private void cargarDatos()
        {
            if (this.cmbImpuesto.SelectedValue.ToString() == "IGV")
            {
                this.dgvListado.AllowUserToAddRows = false;
            }
            else
            {
                this.dgvListado.AllowUserToAddRows = true;
            }

            eDETALLE_IMPUESTO o = new eDETALLE_IMPUESTO();

            o.IMP_codigo = this.cmbImpuesto.SelectedValue != null?this.cmbImpuesto.SelectedValue.ToString() : "";

            this.dgvListado.DataSource = balDETALLE_IMPUESTO.obtenerDetallePorImpuesto(o);
        }
        public DataTable obtenerRegistro(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_DETALLE_IMPUESTO_obtenerRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter dad = new SqlDataAdapter(cmd);
                dad.SelectCommand.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeDETALLE_IMPUESTO.IMP_codigo));
                dad.SelectCommand.Parameters.Add(new SqlParameter("@DIM_NUMERO", oeDETALLE_IMPUESTO.DIM_numero));

                DataTable dt = new DataTable();
                dad.Fill(dt);

                return(dt);
            }
        }
Beispiel #9
0
        public override void Guardar()
        {
            if (this.cmbImpuesto.SelectedValue != null)
            {
                eDETALLE_IMPUESTO o = new eDETALLE_IMPUESTO();
                o.IMP_codigo = this.cmbImpuesto.SelectedValue.ToString();
                int contadorInsertadosCorrectos   = 0;
                int contadorInsertadosIncorrectos = 0;

                double u;
                balDETALLE_IMPUESTO.eliminarGrilla(o);

                foreach (DataGridViewRow row in this.dgvListado.Rows)
                {
                    if (!row.IsNewRow)
                    {
                        o.DIM_porcentaje = row.Cells["DIM_porcentaje"].Value != null?double.TryParse(row.Cells["DIM_porcentaje"].Value.ToString(), out u) ? Convert.ToDouble(row.Cells["DIM_porcentaje"].Value.ToString()) : -1 : -1;

                        try
                        {
                            if (balDETALLE_IMPUESTO.actualizarFila(o))
                            {
                                contadorInsertadosCorrectos++;
                            }
                            else
                            {
                                contadorInsertadosIncorrectos++;
                            }
                        }
                        catch (CustomException ex)
                        {
                            MessageBox.Show(ex.Message, "SICO", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Ocurrió un error inesperado:\r\n" + ex.Message, "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                mensaje("guardar", contadorInsertadosCorrectos, contadorInsertadosIncorrectos);
                cargarDatos();
            }
        }
Beispiel #10
0
        public frmDM_Producto(ePRODUCTO o)
        {
            InitializeComponent();
            tabla = "PRODUCTO";

            this.cmbFormato.ValueMember   = "FOR_codigo";
            this.cmbFormato.DisplayMember = "FOR_nombre";
            this.cmbFormato.DataSource    = balFORMATO.poblar();

            this.cmbUnidadMedida.ValueMember   = "UME_codigo";
            this.cmbUnidadMedida.DisplayMember = "UME_descripcion";
            this.cmbUnidadMedida.DataSource    = balUNIDAD_MEDIDA.poblar();

            this.cmbCategoria.ValueMember   = "CAT_codigo";
            this.cmbCategoria.DisplayMember = "CAT_nombre";
            this.cmbCategoria.DataSource    = balCATEGORIA.poblar();

            this.cmbLinea.DataSource = null;

            this.cmbMarca.ValueMember   = "MAR_codigo";
            this.cmbMarca.DisplayMember = "MAR_nombre";
            this.cmbMarca.DataSource    = balMARCA.poblar();

            this.cmbPack.ValueMember   = "PRO_codigo";
            this.cmbPack.DisplayMember = "PRO_descripcion";
            this.cmbPack.DataSource    = balPRODUCTO.poblarPacks();


            eDETALLE_IMPUESTO oDETALLE = new eDETALLE_IMPUESTO();

            oDETALLE.IMP_codigo = "ISC";
            this.cmbPorcentajeISC.ValueMember   = "DIM_porcentaje";
            this.cmbPorcentajeISC.DisplayMember = "DIM_porcentaje";
            this.cmbPorcentajeISC.DataSource    = balDETALLE_IMPUESTO.obtenerDetallePorImpuesto(oDETALLE);

            //this.cmbPorcentajeISC.ValueMember = "PRO_codigo";
            //this.cmbPorcentajeISC.DisplayMember = "PRO_descripcion";
            //this.cmbPorcentajeISC.DataSource = balPRODUCTO.poblarPacks();

            this._o = o;
        }