Exemplo n.º 1
0
        private List <StockList> GenerateList(DataTable dt)
        {
            List <StockList> StockList = new List <StockList>();

            foreach (DataRow DataRow in dt.Select("QtyBalance > 0"))
            {
                StockList Stock = new StockList();
                Stock.MovementID = Convert.ToInt32(DataRow["MovementID"]);
                Stock.TranDate   = Convert.ToDateTime(DataRow["TransDate"]);
                Stock.QtyBalance = Convert.ToDecimal(DataRow["QtyBalance"]);
                Stock.Cost       = Convert.ToDecimal(DataRow["Cost"]);

                StockList.Add(Stock);
            }
            return(StockList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Why is this here???
        /// </summary>
        /// <param name="id_transfer_detail"></param>
        /// <param name="id_item_product"></param>
        /// <returns></returns>
        public List <StockList> MovementForTransfer(int id_transfer_detail, int id_item_product)
        {
            List <StockList> StockList = new List <StockList>();

            using (db db = new db())
            {
                List <item_movement> Items_InStockLIST = db.item_movement.Where(x => x.id_transfer_detail == id_transfer_detail && x.id_item_product == id_item_product && x.debit > 0).ToList();
                foreach (item_movement item_movement in Items_InStockLIST)
                {
                    StockList Stock = new StockList();
                    Stock.MovementID = (int)item_movement.id_movement;
                    Stock.TranDate   = item_movement.trans_date;
                    Stock.QtyBalance = item_movement.debit;
                    Stock.Cost       = item_movement.item_movement_value.Sum(x => x.unit_value);

                    StockList.Add(Stock);
                }
            }
            return(StockList);
        }