Esempio n. 1
0
        //----------------------------------------------
        // Insert PerDetallePorcentajeDscto por Muestra
        //----------------------------------------------
        public bool Ins_PerDetallePorcentajeDscto(BE_ReqPerPorcentajeDscto Objeto)
        {
            bool exito = false;

            try
            {
                clsConection Obj    = new clsConection();
                string       Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "[usp_Ins_PerDetallePorcentajeDscto]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("cPerCodigo", Objeto.cPerCodigo);
                        cm.Parameters.AddWithValue("cPerParCodigo", Objeto.cPerParCodigo);
                        cm.Parameters.AddWithValue("nCtaCteSerCodigo", Objeto.nCtaCteSerCodigo);
                        cm.Parameters.AddWithValue("nIntCodigo", Objeto.nIntCodigo);
                        cm.Parameters.AddWithValue("nTipoDscto", Objeto.nTipoDscto);
                        cm.Parameters.AddWithValue("nPorcDscto", Objeto.porcentajeCalc());
                        cm.Parameters.AddWithValue("cPerUsuario", Objeto.cPerUsuario);

                        cm.Connection = cn;

                        if (cm.ExecuteNonQuery() > 0)
                        {
                            exito = true;
                        }
                        else
                        {
                            throw new ApplicationException("se ha producido un error procedimiento almacenado: [usp_Ins_PerDetallePorcentajeDscto]; Consulte al administrador del sistema");
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(exito);
        }