コード例 #1
0
        public void Delete(Enl_CotizacionesDetail enlCotizacionDetail)
        {
            try
            {
                SqlCommand command = new SqlCommand("CxC.Spr_Delete_CotizacionDetail", Connection.Get);
                command.CommandType = CommandType.StoredProcedure;
                Connection.Get.Open();

                command.Parameters.Add(new SqlParameter("@NoCotizacion", enlCotizacionDetail.NoCotizacion)
                {
                    SqlDbType = SqlDbType.NVarChar
                });

                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                //Guardar Error en la tabla de Erroes V.2
                throw;
            }

            finally
            {
                if (Connection.Get.State != ConnectionState.Closed)
                {
                    Connection.Get.Close();
                }
            }
        }
コード例 #2
0
        public void Update(Enl_CotizacionesDetail enlCotizacionDetail)
        {
            try
            {
                SqlCommand command = new SqlCommand("CxC.Spr_Update_CotizacionDetail", Connection.Get);
                command.CommandType = CommandType.StoredProcedure;
                Connection.Get.Open();

                command.Parameters.Add(new SqlParameter("@NoCotizacion", enlCotizacionDetail.NoCotizacion)
                {
                    SqlDbType = SqlDbType.NVarChar
                });
                command.Parameters.Add(new SqlParameter("@Articulo", enlCotizacionDetail.Codigo)
                {
                    SqlDbType = SqlDbType.NVarChar
                });
                command.Parameters.Add(new SqlParameter("@Descripcion", enlCotizacionDetail.Descripcion)
                {
                    SqlDbType = SqlDbType.NVarChar
                });
                command.Parameters.Add(new SqlParameter("@Precio", enlCotizacionDetail.Precio)
                {
                    SqlDbType = SqlDbType.Decimal
                });
                command.Parameters.Add(new SqlParameter("@Cantidad", enlCotizacionDetail.Cantidad)
                {
                    SqlDbType = SqlDbType.Decimal
                });
                command.Parameters.Add(new SqlParameter("@Impuesto", enlCotizacionDetail.Impuesto)
                {
                    SqlDbType = SqlDbType.Decimal
                });
                command.Parameters.Add(new SqlParameter("@TotalLinea", enlCotizacionDetail.TotalLinea)
                {
                    SqlDbType = SqlDbType.Decimal
                });


                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                //Guardar Error en la tabla de Erroes V.2
                throw;
            }

            finally
            {
                if (Connection.Get.State != ConnectionState.Closed)
                {
                    Connection.Get.Close();
                }
            }
        }
コード例 #3
0
        public IList <Enl_CotizacionesDetail> Search(Enl_CotizacionesDetail enlCotizacionDetail)
        {
            try
            {
                SqlCommand command = new SqlCommand("CxC.Spr_Search_CotizacionDetail", Connection.Get);
                command.CommandType = CommandType.StoredProcedure;
                Connection.Get.Open();

                command.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@NoCotizacion",
                    SqlDbType     = SqlDbType.NVarChar,
                    Value         = enlCotizacionDetail.NoCotizacion
                });



                var dr   = command.ExecuteReader();
                var list = new List <Enl_CotizacionesDetail>();

                while (dr.Read())
                {
                    list.Add(new Enl_CotizacionesDetail
                    {
                        Codigo      = dr.GetString(dr.GetOrdinal("Articulo")),
                        Descripcion = dr.GetString(dr.GetOrdinal("Descripcion")),
                        Precio      = dr.GetDecimal(dr.GetOrdinal("Precio")),
                        Cantidad    = dr.GetDecimal(dr.GetOrdinal("Cantidad")),
                        Impuesto    = dr.GetDecimal(dr.GetOrdinal("Impuesto")),
                        TotalLinea  = dr.GetDecimal(dr.GetOrdinal("TotalLinea"))
                    });
                }

                return(list);
            }
            catch (Exception)
            {
                //Guardar Error en Tabla
                throw;
            }
            finally
            {
                if (Connection.Get.State != ConnectionState.Closed)
                {
                    Connection.Get.Close();
                }
            }
        }
コード例 #4
0
        public bool Delete(Enl_CotizacionesDetail enlCotizacionesDetail)
        {
            //Validaciones De Lugar


            if (!string.IsNullOrEmpty(enlCotizacionesDetail.NoCotizacion))
            {
                if (MessageBox.Show("Realmente Desea Eliminar El Registro", "Eliminar", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
                {
                    dalCotizacionDetail.Delete(enlCotizacionesDetail);
                    return(true);
                }
            }

            return(false);
        }
コード例 #5
0
        public IList <Enl_CotizacionesDetail> Search(Enl_CotizacionesDetail enlCotizacionesDetail)
        {
            //Validaciones de Lugar

            return(dalCotizacionDetail.Search(enlCotizacionesDetail));
        }
コード例 #6
0
        public void Update(Enl_CotizacionesDetail enlCotizacionesDetail)
        {
            //Validaciones De Lugar

            dalCotizacionDetail.Update(enlCotizacionesDetail);
        }
コード例 #7
0
        public void Insert(Enl_CotizacionesDetail enlCotizacionesDetail)
        {
            //Validaciones De Lugar

            dalCotizacionDetail.Insert(enlCotizacionesDetail);
        }