public void AddWithPurchase(skPurchase Purchase, int UserID) { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (Validate()) { if (Purchase.Validate()) { DataClient.Open(); DataClient.AddNewStock(this, Purchase, UserID); OnStockCreated(); } else { throw new InvalidObjectException(Purchase.PropertyList); } } else { throw new InvalidObjectException(base.PropertyList); } } finally { DataClient.Close(); } }
public void AddMultiWithPurchase(skPurchase Purchase, int UserID) { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { foreach (skStock s in StockList) { if (!s.IsObjectValid) { throw new InvalidObjectException(s.PropertyList); } } if (Purchase.IsObjectValid) { DataClient.Open(); DataClient.AddNewStock(StockList, Purchase, UserID); OnStockCreated(); } else { throw new InvalidObjectException(Purchase.PropertyList); } } finally { DataClient.Close(); } }
public static List <Stocky.Data.Interfaces.ITransaction> GetPurchases() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); List <Stocky.Data.Interfaces.ITransaction> templist = new List <Stocky.Data.Interfaces.ITransaction>(); try { DataClient.Open(); foreach (var item in DataClient.GetTransactionList(new SearchFilterObject { ExtraSearchObject1 = Stocky.Data.TransactionType.Purchase }).TransactionList) { templist.Add(item); } } catch (Exception) { throw; } finally { DataClient.Close(); } return(templist); }
public void AddNew(skAddresses AddressObject) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { if (AddressObject.IsObjectValid) { DataClient.Open(); DataClient.AddNewPerson(this, AddressObject); OnPersonCreated(); } else { throw new Stocky.Exceptions.InvalidObjectException(AddressObject.PropertyList); } } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }
public static List <skCategory> CategoryList(skCategory FilterObject) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); DataClient.Open(); List <skCategory> returnlist = DataClient.GetCategoryList(FilterObject).CategoryList; DataClient.Close(); return(returnlist); }
public void PopulateSaleObj() { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { SaleObject = DataClient.GetSalesObjectByStockID(Convert.ToInt32(Stockid)).SalesObject; } finally { DataClient.Close(); } }
public void RemoveFromSale(int UserID) { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); DataClient.RemoveStockFromSale(Convert.ToInt32(this.Stockid), UserID); } finally { DataClient.Close(); } }
public void LinktoTransaction(ITransaction TransactionObject, int UserID) { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); DataClient.LinkTranToStock(TransactionObject, this, UserID); } finally { DataClient.Close(); } }
public void PopulatePurchaseObj() { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); PurchaseObject = DataClient.GetPurchaseObjectByStockID(Convert.ToInt32(Stockid)).PurchaseObject; } finally { DataClient.Close(); } }
public void UpdateUser(bool IsPasswordReset) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); DataClient.UpdateUser(this, IsPasswordReset); OnUserUpdated(); } finally { DataClient.Close(); } }
public static skPerson GetPersonObject(int PersonID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); return(DataClient.GetPersonObject(PersonID).PersonObject); } finally { DataClient.Close(); } }
public List <ITransaction> GetTransactionList() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); List <ITransaction> returnlist = DataClient.GetTransactionList(this.SearchFilter).TransactionList; return(returnlist); } finally { DataClient.Close(); } }
public static List <skAddresses> GetAddressList() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); List <skAddresses> ReturnList = DataClient.GetAddressesList().AddressList; return(ReturnList); } finally { DataClient.Close(); } }
public List <skStockHistory> GetStockHistory(long StockID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); var Returnlist = DataClient.GetStockHistory(StockID).StockHistory; return(Returnlist); } finally { DataClient.Close(); } }
public static List <skPerson> GetPersonList() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); var returnlist = DataClient.GetPersonList().PersonList; return(returnlist); } finally { DataClient.Close(); } }
public List <skStock> LinkedStockList() { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); List <skStock> returnList = DataClient.GetStockListByTransaction(this).StockList; return(returnList); } finally { DataClient.Close(); } }
public bool Add() { if (IsObjectValid) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); DataClient.Open(); DataClient.AddNewVendor(this); DataClient.Close(); OnVendorCreated(); return(true); } else { return(false); } }
internal bool IsDirtyObject() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); bool Result; try { DataClient.Open(); Result = DataClient.IsRecordDirty(ValiationObject); return(Result); } finally { DataClient.Close(); } }
public void AddNew() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewCategory(this); OnCategoryCreated(); } } finally { DataClient.Close(); } }
public void AddnewRefund(int UserID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewRefund(this, UserID); OnRefundCreated(); } } finally { DataClient.Close(); } }
public void Update() { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { Validate(); if (IsObjectValid) { OnPurchaseUpdated(); } else { throw new InvalidObjectException(PropertyList); } } finally { DataClient.Close(); } }
public static skUser LoadUser(int UserID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { var Object = DataClient.GetUserObject(UserID).UserObject; if (Object != null) { return(Object); } else { throw new Exception("No user exists with this ID"); } } finally { DataClient.Close(); } }
public void Delete() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); //DataClient.update(this); } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }
public bool Update() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.UpdateVendor(this); return(true); } else { return(false); } } finally { DataClient.Close(); } }
public void LinkAddress(int AddressID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); if (this.pID != 0) { DataClient.LinkAddressToPerson(this.pID, AddressID); } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }
public void adduser() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (Password == ConfirmPassword) { DataClient.Open(); DataClient.AddNewUser(this); OnUserCreated(); } else { throw new Exception("Password's Do not match!"); } } finally { DataClient.Close(); } }
public void Add(int ObjectID, Type ObjectType) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewAddress(this, ObjectID, ObjectType); OnAddressCreated(); } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }
public List <skAddresses> GetAddressses() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); List <skAddresses> returnlist = DataClient.GetAddressesList().AddressList; if (returnlist.Count != 0) { return(returnlist); } else { throw new Exception("No Records Found"); } } finally { DataClient.Close(); } }
public static List <skvendors> VendorList() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); List <skvendors> returnlist = DataClient.GetVendorList().VendorList; if (returnlist.Count != 0) { return(returnlist); } else { throw new Exception("No Records Found"); } } finally { DataClient.Close(); } }
public void UpdateLinkedAddresses() { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { DataClient.Open(); if (LinkedAddresses.Count != 0) { LinkedAddresses.Clear(); foreach (var item in DataClient.GetAddressesListByPerson(this.pID).AddressList) { LinkedAddresses.Add(item); } } } finally { DataClient.Close(); } }