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);
        }
Esempio n. 2
0
        public int Get_PerDetallePorcentajeDscto_nReg(BE_ReqPerPorcentajeDscto Request)
        {
            int nReg = 0;

            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_Get_PerDetallePorcentajeDscto_nReg]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("@cPerCodigo", Request.cPerCodigo);
                        cm.Parameters.AddWithValue("@cPerParCodigo", Request.cPerParCodigo);
                        cm.Parameters.AddWithValue("@nCtaCteSerCodigo", Request.nCtaCteSerCodigo);
                        cm.Parameters.AddWithValue("@nIntCodigo", Request.nIntCodigo);
                        cm.Parameters.AddWithValue("@nTipoDscto", Request.nTipoDscto);
                        cm.Parameters.AddWithValue("@nPorcDscto", Request.nPorcDscto);

                        cm.Connection = cn;

                        SqlParameter sqlParameter = new SqlParameter();
                        sqlParameter.ParameterName = "@nReg";
                        sqlParameter.DbType        = DbType.Int32;
                        sqlParameter.Direction     = ParameterDirection.Output;

                        cm.Parameters.Add(sqlParameter);
                        cm.ExecuteNonQuery();
                        nReg = Convert.ToInt32(cm.Parameters["@nReg"].Value);
                    }
                }
                return(nReg);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 3
0
        //---------------------------------------------------
        //Insert PerDetallePorcentajeDscto en Bloque con XML
        //---------------------------------------------------
        public bool Ins_PerDetallePorcentajeDscto_By_XML(BE_ReqPerPorcentajeDscto Objeto)
        {
            DA_PerPorcentajeDscto Obj = new DA_PerPorcentajeDscto();

            return(Obj.Ins_PerDetallePorcentajeDscto_By_XML(Objeto));
        }
Esempio n. 4
0
        public int Get_PerDetallePorcentajeDscto_nReg(BE_ReqPerPorcentajeDscto perPorcentajeDscto)
        {
            DA_PerPorcentajeDscto Obj = new DA_PerPorcentajeDscto();

            return(Obj.Get_PerDetallePorcentajeDscto_nReg(perPorcentajeDscto));
        }
Esempio n. 5
0
        //--------------------------------
        //DELETE PerDetallePorcentajeDscto
        //--------------------------------
        public bool Del_PerDetallePorcentajeDscto_by_cPerCodigo_cPerParCodigo_nIntCodigo(BE_ReqPerPorcentajeDscto Objeto)
        {
            DA_PerPorcentajeDscto Obj = new DA_PerPorcentajeDscto();

            return(Obj.Del_PerDetallePorcentajeDscto_by_cPerCodigo_cPerParCodigo_nIntCodigo(Objeto));
        }
Esempio n. 6
0
        //-------------------------------------------------------
        // Get Procentaje aplicado por Entidad y Tipo de Relacion
        //-------------------------------------------------------
        public DataTable Get_PerPorcentajeDscto_by_cPerJurCodigo_and_cPerParCodigo_and_nIntCodigo(BE_ReqPerPorcentajeDscto Objeto)
        {
            DA_PerPorcentajeDscto Obj = new DA_PerPorcentajeDscto();

            return(Obj.Get_PerPorcentajeDscto_by_cPerJurCodigo_and_cPerParCodigo_and_nIntCodigo(Objeto));
        }
Esempio n. 7
0
        //-------------------------
        //Insert PerPorcentajeDscto
        //---------------------------
        public bool Ins_PerPorcentajeDscto(BE_ReqPerPorcentajeDscto Objeto)
        {
            DA_PerPorcentajeDscto Obj = new DA_PerPorcentajeDscto();

            return(Obj.Ins_PerPorcentajeDscto(Objeto));
        }
Esempio n. 8
0
        //-------------------------------------------------------
        // Get Procentaje aplicado por Entidad y Tipo de Relacion
        //-------------------------------------------------------
        public DataTable Get_PerPorcentajeDscto_by_cPerJurCodigo_and_cPerParCodigo_and_nIntCodigo(BE_ReqPerPorcentajeDscto Request)
        {
            DataTable dt = new DataTable();

            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_Get_PerPorcentajeDscto_by_cPerJurCodigo_and_cPerParCodigo_and_nIntCodigo]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("cPerJurCodigo", Request.cPerCodigo);
                        cm.Parameters.AddWithValue("cPerParCodigo", Request.cPerParCodigo);
                        cm.Parameters.AddWithValue("nIntCodigo", Request.nIntCodigo);
                        cm.Parameters.AddWithValue("cFlag", Request.cFlag);
                        cm.Connection = cn;

                        using (SqlDataReader dr = cm.ExecuteReader())
                            dt.Load(dr);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(dt);
        }