Exemplo n.º 1
0
 public Items GetItemsByID(int id)
 {
     ObjProditms = null;
     ObjProditms = DataRepository.ItemsProvider.GetById(id);
     return ObjProditms;
 }
Exemplo n.º 2
0
        public string UpdateProd(Items obitem, ItemPurchase objitmpurchase, ItemSell ObjitmSell, ProdTable objtable)
        {
            TransactionManager transaction = null;
            try
            {
                transaction = DataRepository.Provider.CreateTransaction();
                transaction.BeginTransaction();

                if ((DataRepository.ItemsProvider.Update(transaction, obitem)))
                {
                    // Show proper message
                    //objitmpurchase.ItemId = obitem.Id;
                    //ObjitmSell.ItemId = obitem.Id;
                    if ((DataRepository.ItemPurchaseProvider.Update(transaction, objitmpurchase)) && ((DataRepository.ItemSellProvider.Update(transaction, ObjitmSell))))
                    {
                        //objtable.ItemId = obitem.Id;
                        //objtable.SellId = ObjitmSell.Id;
                        //objtable.PurchaseId = objitmpurchase.Id;
                        if (DataRepository.ProdTableProvider.Update(transaction, objtable))
                        {

                        }
                        else
                        {
                            transaction.Rollback();
                            return "Information could not be saved.";
                        }
                    }
                    else
                    {
                        transaction.Rollback();
                        return "Information could not be saved.";
                    }
                }
                else
                {
                    return "Information could not be saved.";
                }
                transaction.Commit();
                return "Information Update successfully.";
            }
            catch (Exception e)
            {
                transaction.Rollback();
                return "Information could not be saved.Please contact Administrator.";
            }
        }