public PurchaseDetailsViewModel()
 {
     if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject()))
     {
         return;
     }
     Data         = new DataFunctions();
     _PurchaseObj = Data.GetPurchaseDetails(StaticDataReposityory.SelectedSaleID);
     if (_PurchaseObj.VendorId != null)
     {
         _VendorObj  = Data.GetVendorDetails(Convert.ToInt32(_PurchaseObj.VendorId));
         _Addressobj = Data.GetAddressObject(Convert.ToInt32(_VendorObj.AddresseID));
     }
 }
Example #2
0
        public static skPurchase GetPurchaseObject(int ID)
        {
            DataFunctions DB = new DataFunctions();

            skPurchase PurchaseOBJ = DB.GetPurchaseDetails(ID);

            if (PurchaseOBJ != null)
            {
                return(PurchaseOBJ);
            }
            else
            {
                throw new Exception("No purchase found !");
            }
        }