Esempio n. 1
0
        public static Order_Dtl getNewLineOrder(DataRow dr)
        {
            Order_Dtl order = new Order_Dtl();

            string currency = System.Configuration.ConfigurationManager.AppSettings["kCurrency"];

            order = new Order_Dtl
            {
                _code       = dr["arv_article"].ToString(),
                _artName    = dr["arv_name"].ToString(),
                _brand      = dr["brv_description"].ToString(),
                _brandImg   = dr["brv_image"].ToString(),
                _color      = dr["cov_description"].ToString(),
                _majorCat   = dr["mcv_description"].ToString(),
                _cat        = dr["cav_description"].ToString(),
                _subcat     = dr["scv_description"].ToString(),
                _origin     = dr["arv_origin"].ToString(),
                _originDesc = dr["arv_origin"].ToString().Equals(Constants.IdOriginImported) ? "Artículo importado" : "Artículo nacional",
                _comm       = (int)Convert.ToInt16(dr["arn_commission"]),
                _uriPhoto   = dr["arv_photo"].ToString(),
                _price      = Convert.ToDecimal(dr["prn_public_price"]),
                _priceDesc  = Convert.ToDecimal(dr["prn_public_price"]).ToString(currency),
                _dsctoDesc  = order._dscto.ToString(currency),
                _units      = int.Parse(dr["son_qty"].ToString())
            };

            return(order);
        }
Esempio n. 2
0
        /// <summary>
        /// Crear una nueva linea de pedido
        /// </summary>
        /// <param name="dtArt"></param>
        /// <param name="dtDisscArt"></param>
        /// <returns></returns>
        public static Order_Dtl getNewLineOrder(DataTable dtArt, int _idOfe)
        {
            Order_Dtl order = new Order_Dtl();

            string currency = System.Configuration.ConfigurationManager.AppSettings["kCurrency"];

            if (dtArt == null || dtArt.Rows.Count == 0)
            {
                return(null);
            }

            DataRow dr = dtArt.Rows[0];

            order = new Order_Dtl
            {
                _code    = dr["Art_Id"].ToString(),
                _artName = dr["Art_Descripcion"].ToString(),
                _brand   = dr["Mar_Descripcion"].ToString(),
                //_brandImg = dr["brv_image"].ToString(),
                _color    = dr["Col_Descripcion"].ToString(),
                _majorCat = dr["Cat_Pri_Descripcion"].ToString(),
                _cat      = dr["Cat_Descripcion"].ToString(),
                _subcat   = dr["Sca_Descripcion"].ToString(),
                //_origin = dr["arv_origin"].ToString(),
                //_originDesc = dr["arv_origin"].ToString().Equals(Constants.IdOriginImported) ? "Artículo importado" : "Artículo nacional",
                _comm           = (int)Convert.ToInt16(dr["Art_Comision"]),
                _uriPhoto       = dr["Art_Foto"].ToString(),
                _price          = Convert.ToDecimal(dr["Art_Pre_Sin_Igv"]),
                _priceDesc      = Convert.ToDecimal(dr["Art_Pre_Sin_Igv"]).ToString(currency),
                _dsctoDesc      = order._dscto.ToString(currency),
                _priceigv       = Convert.ToDecimal(dr["Art_Pre_Con_Igv"]),
                _priceigvDesc   = Convert.ToDecimal(dr["Art_Pre_Con_Igv"]).ToString(currency),
                _ap_percepcion  = dr["Afec_Percepcion"].ToString(),
                _ofe_Tipo       = dr["Ofe_tipo"].ToString(),
                _ofe_PrecioPack = Convert.ToDecimal(dr["Ofe_ArtVenta"]),
                _ofe_id         = Convert.ToDecimal(dr["Ofe_Id"]),
                _ofe_maxpares   = Convert.ToDecimal(dr["Ofe_MaxPares"]),
                _ofe_porc       = Convert.ToDecimal(dr["Ofe_Porc"]),
                id_tran_ofe     = _idOfe,
                nroProms        = dtArt.Rows.Count,
            };

            //if (dtDisscArt == null || dtDisscArt.Rows.Count == 0)
            //    return order;

            //dr = dtDisscArt.Rows[0];

            //order._dscto = Convert.ToDecimal(dr["valdiscount"]);
            //order._dsctoDesc = order._dscto.ToString(currency);
            //order._dsctoPerc = Convert.ToDecimal(dr["porcentaje"]);
            //order._dsctoVale = order._price - order._dscto;
            //order._dsctoValeDesc = order._dsctoVale.ToString(currency);
            //order._dsctoMsg = dr["div_message"].ToString();

            return(order);
        }