public void UpdateStoreOld(DBSite site, StockMovement store) { string qry = ""; int productLedgerNumber = util.GetAutoNumber(site, "ProductLedgerNumber"); foreach (ProductDetail pd in store.ProductDetails) { qry = " UPDATE tblProductLedger SET "; if (pd.bought_qty > 0) { qry = qry + " BoughtQty = " + pd.bought_qty + "DrCr = 'C'"; } else { qry = qry + " , SoldQty =" + pd.sold_qty + "DrCr = 'D'"; } qry = qry + ", productId = " + pd.ProductId + ", accountId = " + pd.AccountId + ", locationId " + pd.LocationId + ", SourceId = " + store.TransactionTypeId + ", BillDate = " + store.MovementDate + ", particulars = " + store.Narration + ", " + util.GetUserUpdateQry(Util_BLL.User); qry = qry + " WHERE productLedgerId = " + pd.ProductLedgerId; site.Execute(qry); } }