private void onMouseDownCmdEvent(object param) { try { string _id = ShellOut[SelectedIndex].PaymentId.ToString(); Int32 _tempCustomerGiftIndex = 0; string _strRef = string.Empty; if (_id.Length >= 3) { _tempCustomerGiftIndex = Convert.ToInt32(_id.Remove(0, 2)); _id = _id.Remove(2); _strRef = _lstIndex[_tempCustomerGiftIndex]; } else if (Convert.ToInt32(_id) == 11) { _strRef = _lstIndex[0]; } if (Convert.ToInt32(_id) == 11 && !_isDeleting) { string _strComp = ShellOut[0].PaymentBalance + ":" + txtTotal; Views.PaymentScan scanPage = new Views.PaymentScan(_tempCustomerGiftIndex, _strRef, _strComp); scanPage.ShowDialog(); } if (Convert.ToInt32(_id) != 11) { decimal _decTmp = 0; foreach (var _shell in ShellOut) { if (_shell.PaymentId != ShellOut[SelectedIndex].PaymentId) { _decTmp += StaticClass.GeneralClass.ConverStringToDecimal(_shell.PaymentBalance.ToString()); } } _decTmp = _decTmp - _total; if (_decTmp < 0) { _decTmp = _decTmp * -1; } else if (_decTmp > 0 && _decTmp < StaticClass.GeneralClass.ConverStringToDecimal(ShellOut[0].PaymentBalance)) { _decTmp = StaticClass.GeneralClass.ConverStringToDecimal(ShellOut[0].PaymentBalance.ToString()) - _decTmp; } else { _decTmp = 0; } GetTotalTxt = StaticClass.GeneralClass.GetNumFormatDisplay(_decTmp); } } catch { } }
private void onMouseDoubleClickExec(object param) { string _strId = ShellOut[SelectedIndex].PaymentId.ToString(); string _strRef = string.Empty; Int32 _tempCustomerGiftIndex = 0; if (_strId.Length >= 3) { _tempCustomerGiftIndex = Convert.ToInt32(_strId.Remove(0, 2)); _strId = _strId.Remove(2); _strRef = _lstIndex[_tempCustomerGiftIndex]; } else if (Convert.ToInt32(_strId) == 11) { _strRef = _lstIndex[0]; } if (Convert.ToInt32(_strId) == 11 && !_isDeleting) { string _strComp = ShellOut[0].PaymentBalance + ":" + txtTotal; Views.PaymentScan scanPage = new Views.PaymentScan(_tempCustomerGiftIndex, _strRef, _strComp); scanPage.ShowDialog(); } }