private void ShowRec() { string sql = "ProductId = '" + this.ProductId.ToString() + "'"; ProductCurrentSummary oCurrentSummary = ProductCurrentSummary.LoadWhere(sql); if (oCurrentSummary != null) { this.txtOnHandQty.Text = oCurrentSummary.CDQTY.ToString("n0"); txtAverageCost.Text = oCurrentSummary.AverageCost.ToString("n2"); txtLastReceivingCost.Text = oCurrentSummary.LastCost.ToString("n2"); txtLastPurDate.Text = oCurrentSummary.LastPurchasedOn.ToString(DateTimeHelper.GetDateFormat()); txtLastSoldDate.Text = oCurrentSummary.LastSoldOn.ToString(DateTimeHelper.GetDateFormat()); } }
private void SaveProductCurrentSummary(Guid productId) { string where = "ProductId = '" + productId.ToString() + "'"; ProductCurrentSummary oCurrSummary = ProductCurrentSummary.LoadWhere(where); if (oCurrSummary == null) { oCurrSummary = new ProductCurrentSummary(); oCurrSummary.ProductId = productId; oCurrSummary.CDQTY = 0; oCurrSummary.LastPurchasedOn = new DateTime(1900, 1, 1); oCurrSummary.LastSoldOn = new DateTime(1900, 1, 1); oCurrSummary.Save(); } }