/// <summary> /// The various form actions for describe item form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void describeItemFormAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Describe Item form navigation action handler received invalid data"); } NavBox descItemNavBox = (NavBox)sender; NavBox.NavAction action = descItemNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { AuditDesktopSession.Instance.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: if (AuditDesktopSession.Instance.ActivePawnLoan != null) { if (AuditDesktopSession.Instance.ActivePawnLoan.Items != null && AuditDesktopSession.Instance.ActivePawnLoan.Items.Count > 0 && AuditDesktopSession.Instance.DescribeItemPawnItemIndex > -1) { Item rItem = AuditDesktopSession.Instance.ActivePawnLoan.Items[AuditDesktopSession.Instance.DescribeItemPawnItemIndex]; rItem.TempStatus = StateStatus.CON; rItem.ItemStatus = ProductStatus.CON; rItem.mStore = Utilities.GetIntegerValue(AuditDesktopSession.Instance.ActiveAudit.StoreNumber); rItem.Icn = RetailProcedures.GenerateTempICN(AuditDesktopSession.Instance, AuditDesktopSession.Instance.ActiveAudit.StoreNumber, rItem.mStore, rItem.mYear); rItem.mDocNumber = Utilities.GetIntegerValue(rItem.Icn.Substring(6, 6), 0); rItem.mDocType = "8"; rItem.PfiTags = 1; AuditDesktopSession.Instance.ActivePawnLoan.Items.RemoveAt(AuditDesktopSession.Instance.DescribeItemPawnItemIndex); AuditDesktopSession.Instance.ActivePawnLoan.Items.Add(rItem); } } if (AuditDesktopSession.Instance.ActivePawnLoan != null) { AuditProcedures.ProcessChargeonNewItems(AuditDesktopSession.Instance, AuditDesktopSession.Instance.ActivePawnLoan.Items, AuditDesktopSession.Instance.ActiveAudit.StoreNumber); } AuditDesktopSession.Instance.PawnLoans.Clear(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; break; case NavBox.NavAction.CANCEL: AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; break; case NavBox.NavAction.BACK: AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ChargeOn; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Describe Item"); } this.executeNextState(); }
private void customButtonClose_Click(object sender, EventArgs e) { string errorCode; string errorText; RetailProcedures.LockItem(CashlinxPawnSupportSession.Instance, icn.Text, out errorCode, out errorText, "N"); NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }
private void LockUnlockRetailItem(RetailItem item, bool lockItem) { string errorText = null; string errorCode = null; if (item.mDocType != "7") { RetailProcedures.LockItem(DesktopSession, item.Icn, out errorCode, out errorText, lockItem ? "Y" : "N"); } }
private void submitButton_Click(object sender, EventArgs e) { string errorCode; string errorText; CustomerVO customerObj = null; LayawayVO layawayObj = null; bool retVal = RetailProcedures.GetLayawayData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(txtLayawayNumber.Text, 0), "0", StateStatus.BLNK, "LAY", true, out layawayObj, out customerObj, out errorCode, out errorText); if (!retVal || layawayObj == null) { MessageBox.Show("No records found or not the originating shop of the number entered."); txtLayawayNumber.Focus(); return; } //Check if the layaway has a status of PAID in which case only the sale can be refunded and not the layaway payment if (layawayObj.LoanStatus == ProductStatus.PAID) { MessageBox.Show("Layaway has been paid out. Can only refund sale at this point."); txtLayawayNumber.Focus(); return; } //SR 07/01/2011 Check if the layaway has a status of LAY. Any other status cannot be refunded. if (layawayObj.LoanStatus != ProductStatus.ACT) { MessageBox.Show("Layaway is in " + layawayObj.LoanStatus.ToString() + " status. Cannot be refunded."); txtLayawayNumber.Focus(); return; } /*int maxDaysForRefundEligibility = BusinessRulesProcedures.GetMaxDaysForRefundEligibility(CDS.CurrentSiteId); * if (ShopDateTime.Instance.FullShopDateTime > layawayObj.DateMade.AddDays(maxDaysForRefundEligibility)) * { * MessageBox.Show("The number of days eligible for refund has expired for the MSR number entered"); * return; * }?*/ GlobalDataAccessor.Instance.DesktopSession.Layaways = new List <LayawayVO>(); GlobalDataAccessor.Instance.DesktopSession.Layaways.Add(layawayObj); GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = customerObj; NavControlBox.IsCustom = true; NavControlBox.CustomDetail = "SHOWITEMS"; NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }
private void txtComments_Leave(object sender, EventArgs e) { //also check for bad language here string errorText = null; string errorCode = null; if (RetailProcedures.FilterBadLanguage(txtComments.Text, out errorCode, out errorText)) { MessageBox.Show("No bad language allowed."); //txtComments.Focus(); return; } if (txtComments.Text != Item.UserItemComments) { Item.TempUserItemComments = txtComments.Text.Replace("\r\n", " "); } }
void workerLoadRetail_DoWork(object sender, DoWorkEventArgs e) { string errorCode; string errorText; CustomerVO customerObj = null; SaleVO saleObj = null; int ticketNumber = (int)e.Argument; RetailProcedures.GetSaleData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Utilities.GetIntegerValue(CDS.CurrentSiteId.StoreNumber, 0), ticketNumber, "3", StateStatus.BLNK, "SALE", true, out saleObj, out customerObj, out errorCode, out errorText); Action <string> actionShowMessageBox = s => MessageBox.Show(s); Action <Control> setFocus = c => c.Focus(); if (saleObj == null || saleObj.RetailItems.Count == 0) { this.Invoke(actionShowMessageBox, new object[] { "No records found or not the originating shop of the number entered." }); this.Invoke(setFocus, new object[] { txtReceiptNumber }); e.Result = false; return; } else { int maxDaysForRefundEligibility = new BusinessRulesProcedures(GlobalDataAccessor.Instance.DesktopSession).GetMaxDaysForRefundEligibility(CDS.CurrentSiteId); if (ShopDateTime.Instance.FullShopDateTime.Date > saleObj.DateMade.AddDays(maxDaysForRefundEligibility)) { this.Invoke(actionShowMessageBox, new object[] { "The number of days eligible for refund has expired for the MSR number entered." }); this.Invoke(setFocus, new object[] { txtReceiptNumber }); e.Result = false; return; } this.Invoke(new Action(() => { GlobalDataAccessor.Instance.DesktopSession.Sales = new List <SaleVO>(); GlobalDataAccessor.Instance.DesktopSession.Sales.Add(saleObj); GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = customerObj; })); } }
private void FindItem(List <string> searchFor, List <string> searchValues) { string errorText = null; string errorCode = null; List <RetailItem> searchItems; string searchFlag = "NORMAL"; RetailProcedures.SearchForItem(searchFor, searchValues, DesktopSession, searchFlag, false, out searchItems, out errorCode, out errorText); RetailItem item = null; ItemSearchResults searchResults = new ItemSearchResults(DesktopSession, ItemSearchResultsMode.CHANGE_RETAIL_PRICE); if (searchItems.Count == 0) { searchResults.ShowDialog(); return; } if (searchItems.Count == 1) { item = searchItems[0]; if (Item.ItemLocked(item)) { MessageBox.Show(Item.ItemLockedMessage); return; } if (Commons.CheckICNSubItem(item.Icn)) { MessageBox.Show("Invalid ICN"); return; } } if (searchItems.Count == 1 && searchItems[0].ItemStatus != ProductStatus.PFI) { searchResults.ShowDialog(); return; } if (searchItems.Count == 1) { item = searchItems[0]; } else if (searchItems.Count > 1) { var distinctItems = (from sItem in searchItems where ((sItem.IsJewelry && sItem.Jewelry.Any(j => j.SubItemNumber == 0)) || !sItem.IsJewelry) select sItem).ToList(); if (distinctItems.Count == 0) { //item = selectItems.SelectedItem; item = searchItems.First(); if (Item.ItemLocked(item)) { MessageBox.Show(Item.ItemLockedMessage); return; } //item = selectItems.SelectedItem; if (Commons.CheckICNSubItem(item.Icn)) { MessageBox.Show("Invalid ICN"); return; } } else { SelectItems selectItems = new SelectItems(searchItems, ItemSearchResultsMode.CHANGE_RETAIL_PRICE); selectItems.ErrorMessage = "The Short code entered is a duplicate. Please make your selection from the list"; if (selectItems.ShowDialog() == DialogResult.OK) { item = selectItems.SelectedItem; if (Item.ItemLocked(item)) { MessageBox.Show(Item.ItemLockedMessage); return; } if (Commons.CheckICNSubItem(item.Icn)) { MessageBox.Show("Invalid ICN"); return; } } else { return; } } } LockUnlockRetailItem(item, true); DesktopSession.ActiveRetail = new SaleVO(); DesktopSession.ActiveRetail.RetailItems.Add(item); //BZ: 899 - Allow the submit, form changes are handled in the flow executor NavControlBox.Action = NavBox.NavAction.SUBMIT; }
private void FindItem(List <string> searchFor, List <string> searchValues) { string errorText = null; string errorCode = null; List <RetailItem> searchItems; string searchFlag = "NORMAL"; var dSession = GlobalDataAccessor.Instance.DesktopSession; RetailProcedures.SearchForItemPUR(searchFor, searchValues, dSession, searchFlag, out searchItems, out errorCode, out errorText); RetailItem item = null; ItemSearchResults searchResults = new ItemSearchResults(dSession, ItemSearchResultsMode.REPRINT_TAG); if (searchItems.Count == 0) { searchResults.Message = "No valid records found. Please enter another number."; searchResults.ShowDialog(); return; } if (searchItems.Count == 1) { item = searchItems[0]; if (Item.ItemLocked(item)) { searchResults.Message = Item.ItemLockedMessage; searchResults.ShowDialog(); return; } if (Commons.CheckICNSubItem(item.Icn)) { MessageBox.Show("Invalid ICN"); return; } } else if (searchItems.Count > 1) { //here remove items with ICNSubItem true SelectItems selectItems = new SelectItems(searchItems, ItemSearchResultsMode.REPRINT_TAG); selectItems.ErrorMessage = "The Short code entered is a duplicate. Please make your selection from the list"; if (selectItems.ShowDialog() == DialogResult.OK) { item = selectItems.SelectedItem; if (Item.ItemLocked(item)) { searchResults.Message = Item.ItemLockedMessage; searchResults.ShowDialog(); return; } if (Commons.CheckICNSubItem(item.Icn)) { MessageBox.Show("Invalid ICN"); DialogResult = DialogResult.None; return; } } else { txtICN.Text = string.Empty; txtICN.Focus(); return; } } if (item != null) { if (item.ItemStatus == ProductStatus.IP || item.ItemStatus == ProductStatus.PS || item.ItemStatus == ProductStatus.SOLD) { MessageBox.Show("The ICN# entered is not a valid number. Please try again."); return; } ReprintTagVerify tagVerify = new ReprintTagVerify(dSession, item, ReprintVerifySender.ReprintTag); tagVerify.ShowDialog(this); } //BZ: 899 - After the reprint tag verify has finished, do not allow this form to close //- this form should only close when the user hits cancel //this.Close(); }
private void customButtonOK_Click(object sender, EventArgs e) { labelErrorMessage.Visible = false; noDataFound = false; PurchaseVO purchaseObj = null; CustomerVO customerObj = null; SaleVO saleObj = null; LayawayVO layawayObj = null; CashTransferVO bankTransferObj = null; CashTransferVO shopCashTransferObj = null; DataSet mdseInfo = null; string errorCode; string errorText; getCustomerInfo = true; string tenderType; GlobalDataAccessor.Instance.DesktopSession.Purchases = new List <PurchaseVO>(); GlobalDataAccessor.Instance.DesktopSession.Sales = new List <SaleVO>(); GlobalDataAccessor.Instance.DesktopSession.Layaways = new List <LayawayVO>(); ReleaseFingerprintsInfo releaseFingerprintsequest = null; bool retValue = false; if (voidBuyReturn) { retValue = PurchaseProcedures.GetPurchaseData(Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), "2", StateStatus.BLNK, "RET", true, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText); } else if (voidBuy) { retValue = PurchaseProcedures.GetPurchaseData(Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), "2", StateStatus.BLNK, "", true, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText); } else if (voidSale) { retValue = RetailProcedures.GetSaleData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), "3", StateStatus.BLNK, "SALE", false, out saleObj, out customerObj, out errorCode, out errorText); } else if (voidLayaway) { retValue = RetailProcedures.GetLayawayData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), "4", StateStatus.BLNK, "ALL", false, out layawayObj, out customerObj, out errorCode, out errorText); } else if (voidSaleRefund) { retValue = RetailProcedures.GetSaleData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Utilities.GetIntegerValue(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, 0), Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), "3", StateStatus.BLNK, "REFUND", false, out saleObj, out customerObj, out errorCode, out errorText); } //BZ # 419 else if (voidBanktoShopCashTransfer) { retValue = ShopCashProcedures.GetBankTransferDetails(customTextBoxTranNo.Text, "BANKTOSHOP", GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, GlobalDataAccessor.Instance.DesktopSession, out bankTransferObj, out errorCode, out errorText); } else if (voidShopToBankCashTransfer) { retValue = ShopCashProcedures.GetBankTransferDetails(customTextBoxTranNo.Text, "SHOPTOBANK", GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, GlobalDataAccessor.Instance.DesktopSession, out bankTransferObj, out errorCode, out errorText); }//BZ # 419 end else if (voidStoreCashTransfer) { string storeNumber = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; retValue = ShopCashProcedures.GetShopCashTransferData(customTextBoxTranNo.Text, "", storeNumber, GlobalDataAccessor.Instance.DesktopSession, out shopCashTransferObj, out errorCode, out errorText); } else if (voidMerchandiseTransfer) { string storeNumber = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; string tranNo = customTextBoxTranNo.Text; if (customTextBoxTranNo.Text.Length > 6) { tranNo = tranNo.Substring(5); } retValue = VoidProcedures.getTransferToVoid(Utilities.GetIntegerValue(tranNo, 0), storeNumber, out mdseInfo, out errorCode, out errorText); // retValue = VoidProcedures.GetEligibleToScrapItems(Utilities.GetIntegerValue(customTextBoxTranNo.Text, 0), // storeNumber, out mdse , out errorCode, out errorText); } else if (voidReleaseFingerprints) { string storeNumber = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber; string tranNo = customTextBoxTranNo.Text; if (tranNo.Length > 6) { tranNo = tranNo.Substring(5); } // Add procedure to VoidsProcedurees to Locate the Release Fingerprint Authorization GlobalDataAccessor.Instance.FingerPrintRelaseAuthorizationInfo = HoldsProcedures.GetReleaseFingerprintAuthorization(tranNo, storeNumber, out errorCode, out errorText); } if (voidBuy || voidBuyReturn) { if (retValue && purchaseObj != null) { GlobalDataAccessor.Instance.DesktopSession.Purchases.Add(purchaseObj); if (purchaseObj.EntityType != "V" && customerObj != null) { GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = customerObj; } GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { noDataFound = true; } } else if (voidSale || voidSaleRefund) { if (retValue && saleObj != null) { if (saleObj.RefType == "4") { MessageBox.Show("This sale originated from a layaway. You have to void the last layaway payment and not the sale"); return; } GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = customerObj; GlobalDataAccessor.Instance.DesktopSession.Sales.Add(saleObj); GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { noDataFound = true; } } else if (voidLayaway) { if (retValue && layawayObj != null) { GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = customerObj; GlobalDataAccessor.Instance.DesktopSession.Layaways.Add(layawayObj); GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { noDataFound = true; } } //BZ # 419 //else if (voidCashTransfer) else if (voidBanktoShopCashTransfer || voidShopToBankCashTransfer) { //BZ # 419 end if (retValue && bankTransferObj != null) { GlobalDataAccessor.Instance.DesktopSession.CashTransferData = bankTransferObj; GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { noDataFound = true; } } else if (voidStoreCashTransfer) { if (retValue && shopCashTransferObj != null) { GlobalDataAccessor.Instance.DesktopSession.CashTransferData = shopCashTransferObj; GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { noDataFound = true; } } else if (voidMerchandiseTransfer) { if (retValue && mdseInfo != null && mdseInfo.Tables.Count > 0) { if (isFaultyTransferINOUT(mdseInfo)) { noDataFound = true; } else { GlobalDataAccessor.Instance.DesktopSession.MdseTransferData = mdseInfo; GlobalDataAccessor.Instance.DesktopSession.SelectedTransferNumber = customTextBoxTranNo.Text; GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } } else { noDataFound = true; } } else if (voidReleaseFingerprints && GlobalDataAccessor.Instance.FingerPrintRelaseAuthorizationInfo != null) { this.DialogResult = DialogResult.OK; //GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } if (noDataFound) { labelErrorMessage.Text = "The number entered is not valid. Please enter another number"; labelErrorMessage.Visible = true; return; } }
private bool FindItem(List <string> searchFor, List <string> searchValues) { bool retval = false; string errorText = null; string errorCode = null; List <RetailItem> searchItems; string searchFlag = "NORMAL"; this.customLabelError.Visible = false; this.customLabelError.Text = string.Empty; bool loadQty = this.txtQty.Visible; RetailProcedures.SearchForItem(searchFor, searchValues, CDS, searchFlag, loadQty, out searchItems, out errorCode, out errorText); RetailItem item = null; ItemSearchResults searchResults = new ItemSearchResults(GlobalDataAccessor.Instance.DesktopSession, ItemSearchResultsMode.CHARGEOFF); if (searchItems.Count == 0) { this.customLabelError.Visible = true; this.customLabelError.Text = " This ICN number was not found in the current shop. Please check the number and try again."; return(retval); } if (searchItems.Count == 1 && searchItems[0].ItemStatus != ProductStatus.PFI) { searchResults.ShowDialog(); return(retval); } if (searchItems.Count == 1) { item = searchItems[0]; if (Item.ItemLocked(item)) { MessageBox.Show(Item.ItemLockedMessage); return(retval); } } else if (searchItems.Count > 1) { var distinctItems = from sItem in searchItems where ((sItem.IsJewelry && sItem.Jewelry.Any(j => j.SubItemNumber == 0)) || !sItem.IsJewelry) select sItem; if (distinctItems.Any()) { SelectItems selectItems = new SelectItems(searchItems, ItemSearchResultsMode.CHARGEOFF); selectItems.ErrorMessage = "The Short code entered is a duplicate. Please make your selection from the list"; if (selectItems.ShowDialog() == DialogResult.OK) { item = selectItems.SelectedItem; if (Item.ItemLocked(item)) { this.customLabelError.Text = Item.ItemLockedMessage; this.customLabelError.Visible = true; return(retval); } if (item.mDocType == "9") { this.customLabelError.Text = "Item is not eligible for Charge off."; this.customLabelError.Visible = true; return(retval); } else if (item.Icn.Substring(Icn.ICN_LENGTH - 1) != "0") { this.customLabelError.Text = "Item is not eligible for Charge off."; this.customLabelError.Visible = true; return(retval); } if (item.HoldType == HoldTypes.POLICEHOLD.ToString()) { this.customLabelError.Visible = true; this.customLabelError.Text = "This merchandise is on Police Hold. The Police Hold must be released before the item can be charged off."; return(retval); } } else { return(retval); } } else { item = searchItems[0]; if (Item.ItemLocked(item)) { MessageBox.Show(Item.ItemLockedMessage); return(retval); } } } if (item != null) { if (item.HoldType == HoldTypes.POLICEHOLD.ToString()) { this.customLabelError.Text = "This merchandise is on Police Hold. The Police Hold must be released before the item can be charged off."; this.customLabelError.Visible = true; return(retval); } else if (item.mDocType == "9") { this.customLabelError.Text = "Cannot charge off NXT items."; this.customLabelError.Visible = true; return(retval); } else if (item.Icn.Substring(Icn.ICN_LENGTH - 1) != "0") { this.customLabelError.Text = "Cannot charge off sub items."; this.customLabelError.Visible = true; return(retval); } else if (int.Parse(this.txtQty.Text) > item.Quantity) { this.customLabelError.Text = item.Quantity + " items were found for this CACC category. Please revise the charge off quantity."; this.customLabelError.Visible = true; this.continueButton.Enabled = false; return(retval); } else { //if (txtQty.Visible) if (isCACC(this.txtICN.Text)) { decimal qtyText = 0; if (decimal.TryParse(txtQty.Text, out qtyText) && (item.Quantity > 0)) { //do we need to check to make sure DB didn't give us 0 or null decimal qtyRatio = (qtyText / Convert.ToDecimal(item.Quantity)); item.ItemAmount = item.PfiAmount * qtyRatio; } item.Quantity = int.Parse(this.txtQty.Text); } ChargeOffDetails detailsForm = new ChargeOffDetails { ChargeOffItem = item }; detailsForm.ShowDialog(); retval = (detailsForm.DialogResult == DialogResult.OK); txtICN.Text = string.Empty; } } return(retval); }
/*__________________________________________________________________________________________*/ private void IH_ProductComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (_Setup[0]) { Cursor = Cursors.WaitCursor; string filter = string.Empty; string docType = null; IH_ItemHistoryDataGridView.ClearSelection(); IH_ItemHistoryDataGridView.CurrentCell = null; var test = GlobalDataAccessor.Instance.DesktopSession.CustomerHistoryPurchases; SetButtonState(false); switch (IH_ProductComboBox.SelectedItem.ToString()) { case "Pawn": docType = "1"; filter = IH_History_DocType.Name + "=" + 1; break; case "Buy": docType = "2"; filter = IH_History_DocType.Name + "=" + 2; procMsgForm = new ProcessingMessage("Retrieving Customer Purchase History"); procMsgForm.Show(this); //async_populateGrid(1, "Retrieving Customer Purchase History", CashlinxDesktopSession.Instance.CustomerHistoryPurchases); if (!_Setup[2]) { PurchaseProcedures.GetCustomerPurchases(custNumber); sync_populateGrid <PurchaseVO>(2, GlobalDataAccessor.Instance.DesktopSession.CustomerHistoryPurchases, o => o.Items.Count); } break; case "Sale": docType = null; //CashlinxDesktopSession.Instance.CustomerHistorySales procMsgForm = new ProcessingMessage("Retrieving Customer Sales History"); procMsgForm.Show(this); filter = IH_History_ItemStatusColumn.Name + "= 'SOLD'"; //async_populateGrid(0, "Retrieving Customer Sales History", CashlinxDesktopSession.Instance.CustomerHistorySales); if (!_Setup[1]) { RetailProcedures.GetCustomerSales(GlobalDataAccessor.Instance.DesktopSession, custNumber); sync_populateGrid <SaleVO>(1, GlobalDataAccessor.Instance.DesktopSession.CustomerHistorySales, o => ((SaleVO)o).RetailItems.Count); } break; case "Layaway": docType = null; filter = IH_History_ItemStatusColumn.Name + "= 'On Layaway'"; procMsgForm = new ProcessingMessage("Retrieving Customer Layaway History"); procMsgForm.Show(this); //async_populateGrid(2, "Retrieving Customer Layaway History", CashlinxDesktopSession.Instance.CustomerHistoryLayaways); if (!_Setup[3]) { RetailProcedures.GetCustomerLayaways(GlobalDataAccessor.Instance.DesktopSession, custNumber); sync_populateGrid <LayawayVO>(3, GlobalDataAccessor.Instance.DesktopSession.CustomerHistoryLayaways, o => ((LayawayVO)o).RetailItems.Count); } break; case "Refund": docType = null; filter = IH_History_ItemStatusColumn.Name + "= 'REF'"; break; case "All": procMsgForm = new ProcessingMessage("Retrieving Customer Item History"); procMsgForm.Show(this); if (!_Setup[1]) { RetailProcedures.GetCustomerSales(GlobalDataAccessor.Instance.DesktopSession, custNumber); sync_populateGrid <SaleVO>(1, GlobalDataAccessor.Instance.DesktopSession.CustomerHistorySales, o => ((SaleVO)o).RetailItems.Count); } if (!_Setup[2]) { PurchaseProcedures.GetCustomerPurchases(custNumber); sync_populateGrid <PurchaseVO>(2, GlobalDataAccessor.Instance.DesktopSession.CustomerHistoryPurchases, o => o.Items.Count); } if (!_Setup[3]) { RetailProcedures.GetCustomerLayaways(GlobalDataAccessor.Instance.DesktopSession, custNumber); sync_populateGrid <LayawayVO>(3, GlobalDataAccessor.Instance.DesktopSession.CustomerHistoryLayaways, o => ((LayawayVO)o).RetailItems.Count); } //async_populateGrid(0, "Retrieving Customer Sales History", CashlinxDesktopSession.Instance.CustomerHistorySales); //async_populateGrid(1, "Retrieving Customer Purchase History", CashlinxDesktopSession.Instance.CustomerHistoryPurchases); //async_populateGrid(2, "Retrieving Customer Layaway History", CashlinxDesktopSession.Instance.CustomerHistoryLayaways); break; } //-- The filter doesn't seem to handle the very last row ((DataView)IH_ItemHistoryDataGridView.DataSource).RowFilter = filter; IH_ItemHistoryDataGridView.ClearSelection(); IH_ItemHistoryDataGridView.CurrentCell = null; if (IH_ItemHistoryDataGridView.Rows.Count > 0 && docType != null && IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Cells[IH_History_DocType.Name].Value != null) { if ((string)IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Cells[IH_History_DocType.Name].Value != docType) { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = false; } else { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = true; } } else if (IH_ItemHistoryDataGridView.Rows.Count > 0) { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = true; switch (IH_ProductComboBox.SelectedItem.ToString()) { case "Sale": if ((string)IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Cells[this.IH_History_ItemStatusColumn.Name].Value != "SOLD") { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = false; } break; case "Layaway": if ((string)IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Cells[this.IH_History_ItemStatusColumn.Name].Value != "On Layaway") { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = false; } break; case "Refund": if ((string)IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Cells[this.IH_History_ItemStatusColumn.Name].Value != "REF") { IH_ItemHistoryDataGridView.Rows[IH_ItemHistoryDataGridView.Rows.Count - 1].Visible = false; } break; } } sortHistoryData(); if (procMsgForm != null) { procMsgForm.Close(); } Cursor = Cursors.Default; SetButtonState(true); } }
void bwLookupLayawayTicket_DoWork(object sender, DoWorkEventArgs e) { _retValue = RetailProcedures.GetLayawayData(GlobalDataAccessor.Instance.DesktopSession, GlobalDataAccessor.Instance.OracleDA, Convert.ToInt32(_storeNumber), _ticketNumber, "0", StateStatus.BLNK, "LAY", true, out _layaway, out _custObject, out _errorCode, out _errorText); }