Ejemplo n.º 1
0
        public List <tHistory> getInvoices(int UserID)
        {
            List <tHistory> transactionHistories = new List <tHistory>();

            dynamic tings = (from th in db.TransactionHistories
                             select th);

            foreach (TransactionHistory t in tings)
            {
                bDetails details = getBillDetail(t.Order_ID);

                if (details.User_ID.Equals(UserID))
                {
                    tHistory thi = new tHistory
                    {
                        Order_ID    = t.Order_ID,
                        Prod_ID     = t.Prod_ID,
                        purchase_ID = t.Purchase_ID,
                        Quantity    = Convert.ToInt32(t.Quantity),
                        Date        = Convert.ToDateTime(t.Date)
                    };

                    transactionHistories.Add(thi);
                }
            }

            return(transactionHistories);
        }
Ejemplo n.º 2
0
        public bool AddTransaction(tHistory transaction)
        {
            TransactionHistory entry = new TransactionHistory
            {
                Prod_ID  = transaction.Prod_ID,
                Order_ID = transaction.Order_ID,
                Date     = transaction.Date,
                Quantity = transaction.Quantity
            };

            db.TransactionHistories.InsertOnSubmit(entry);
            try
            {
                db.SubmitChanges();
                return(true);
            }
            catch (Exception e)
            {
                e.GetBaseException();
                return(false);
            }
        }
Ejemplo n.º 3
0
        public List <tHistory> getInvoice(int order)
        {
            List <tHistory> transactionHistories = new List <tHistory>();

            dynamic tings = (from th in db.TransactionHistories
                             where th.Order_ID.Equals(order)
                             select th);

            foreach (TransactionHistory t in tings)
            {
                tHistory thi = new tHistory
                {
                    Order_ID    = t.Order_ID,
                    Prod_ID     = t.Prod_ID,
                    purchase_ID = t.Purchase_ID,
                    Quantity    = Convert.ToInt32(t.Quantity),
                    Date        = Convert.ToDateTime(t.Date)
                };

                transactionHistories.Add(thi);
            }

            return(transactionHistories);
        }