Example #1
0
        private void LinkExtraStock()
        {
            switch (TransactionObject.TransactionType)
            {
            case TransactionType.Purchase:
                try
                {
                    Stocky.UI.Enviroment.LoadDialog("StockLingView", TransactionObject, "TRANLEDGEROBJ");
                    PurchaseOBJ.UpdateCurrentObject();
                    StockList.Clear();

                    foreach (var item in PurchaseOBJ.LinkedStock)
                    {
                        StockList.Add(item);
                    }
                }
                catch (Exception E)
                {
                    ExepionLogger.Logger.LogException(E);
                    ExepionLogger.Logger.Show(E);
                }
                break;

            case TransactionType.Sale:
                try
                {
                    Stocky.UI.Enviroment.LoadDialog("StockLingView", TransactionObject, "TRANLEDGEROBJ");
                    SaleOBJ.UpdateCurrentObject();
                    StockList.Clear();

                    foreach (var item in SaleOBJ.StockList)
                    {
                        StockList.Add(item);
                    }
                }
                catch (Exception E)
                {
                    ExepionLogger.Logger.LogException(E);
                    ExepionLogger.Logger.Show(E);
                }
                break;
            }
        }
Example #2
0
 private void RemoveFromTransaction()
 {
     try
     {
         if (TransactionObject.TransactionType == TransactionType.Purchase)
         {
             SelectedStock.RemoveFromPurchase(CurrentSession.CurrentUserObject.UserID);
             StockList.Remove(SelectedStock);
             PurchaseOBJ.UpdateCurrentObject();
         }
         else
         {
             SelectedStock.RemoveFromSale(CurrentSession.CurrentUserObject.UserID);
             StockList.Remove(SelectedStock);
             SaleOBJ.UpdateCurrentObject();
         }
     }
     catch (Exception e)
     {
         ExepionLogger.Logger.LogException(e);
         ExepionLogger.Logger.Show(e);
     }
 }