Beispiel #1
0
 private static void ApplyPriceList(ProductEntity product, ITM1 x)
 {
     if (x.PriceList == 2) //SELL PRICE LIST
     {
         product.SellPriceList ??= new Dictionary <string, decimal>();
         if (!string.IsNullOrEmpty(x.Currency))
         {
             product.SellPriceList.Add(x.Currency, x.Price.Value);
         }
         if (!string.IsNullOrEmpty(x.Currency1))
         {
             product.SellPriceList.Add(x.Currency1, x.AddPrice1.Value);
         }
         if (!string.IsNullOrEmpty(x.Currency2))
         {
             product.SellPriceList.Add(x.Currency2, x.AddPrice2.Value);
         }
     }
     else //BUY PRICE LIST
     {
         product.BuyPriceList ??= new Dictionary <string, decimal>();
         if (!string.IsNullOrEmpty(x.Currency))
         {
             product.BuyPriceList.Add(x.Currency, x.Price.Value);
         }
         if (!string.IsNullOrEmpty(x.Currency1))
         {
             product.BuyPriceList.Add(x.Currency1, x.AddPrice1.Value);
         }
         if (!string.IsNullOrEmpty(x.Currency2))
         {
             product.BuyPriceList.Add(x.Currency2, x.AddPrice2.Value);
         }
     }
 }
Beispiel #2
0
        IList <ITM1> IQITM1.FP_LISTAR_ITM1_Filtrar(int ListNum)
        {
            List <ITM1> objResult = new List <ITM1>();

            try
            {
                using (SqlConnection cnn = new SqlConnection(_strCadenaConexion))
                {
                    cnn.Open();
                    using (SqlCommand cmd = new SqlCommand("SBO_SP_LGS_BUS_PrecioListaArticulo_FIltrar", cnn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@ListNum", ListNum);
                        using (SqlDataReader dr = cmd.ExecuteReader())
                        {
                            objResult = new List <ITM1>();
                            while (dr.Read())
                            {
                                ITM1 mItem = new ITM1();
                                mItem.ListNum    = dr.GetInt32(dr.GetOrdinal("ListNum"));
                                mItem.ListName   = dr.GetString(dr.GetOrdinal("LstName"));
                                mItem.ItemCode   = dr.GetString(dr.GetOrdinal("ItemCode"));
                                mItem.ItemName   = dr.GetString(dr.GetOrdinal("ItemName"));
                                mItem.Price      = dr.GetDecimal(dr.GetOrdinal("Price"));
                                mItem.CurrenCyId = dr.GetInt32(dr.GetOrdinal("CurrenCyId"));
                                objResult.Add(mItem);
                            }
                        }
                        return(objResult);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }