Esempio n. 1
0
        public in_movi_inve_detalle_Info Get_Info_StockAFechaPorProduct(int IdEmpresa, int IdSucursal, int IdBodega, decimal IdProducto, DateTime Fecha)
        {
            try
            {
                in_movi_inve_detalle_Info det = new in_movi_inve_detalle_Info();
                using (EntitiesInventario entity = new EntitiesInventario())
                {
                    ObjectResult <spIn_ObtenerStockAFechaPorProducto_Result> result = entity.spIn_ObtenerStockAFechaPorProducto(IdEmpresa, IdBodega, IdSucursal, IdProducto, Fecha);

                    foreach (var item in result)
                    {
                        det             = new in_movi_inve_detalle_Info();
                        det.IdProducto  = item.IdProducto;
                        det.dm_cantidad = Convert.ToDouble(item.Cantidad);
                    }
                }
                return(det);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }