Exemplo n.º 1
0
        private string GetXWebTranTypeByStatus(XWebTransactionStatus status)
        {
            string tranStatusStr;

            switch (status)
            {
            case XWebTransactionStatus.DtgPaymentApproved:
            case XWebTransactionStatus.HpfCompletePaymentApproved:
            case XWebTransactionStatus.HpfCompletePaymentApprovedPartial:
            case XWebTransactionStatus.EdgeExpressCompletePaymentApproved:
            case XWebTransactionStatus.EdgeExpressCompletePaymentApprovedPartial:
                tranStatusStr = "Sale";
                break;

            case XWebTransactionStatus.DtgPaymentReturned:
                tranStatusStr = "Return";
                break;

            case XWebTransactionStatus.DtgPaymentVoided:
                tranStatusStr = "Void";
                break;

            default:                    //These other values should not be returned from the query.
                tranStatusStr = status.ToString();
                break;
            }
            return(tranStatusStr);
        }
Exemplo n.º 2
0
        private void FillGrid()
        {
            List <long> listClinicNums = new List <long>();

            if (PrefC.HasClinicsEnabled && comboClinic.SelectedIndex != 0)           //Not 'All' selected
            {
                if (Security.CurUser.ClinicIsRestricted)
                {
                    listClinicNums.Add(_listClinics[comboClinic.SelectedIndex - 1].ClinicNum);                  //Minus 1 for 'All'
                }
                else
                {
                    if (comboClinic.SelectedIndex == 1)                   //'Unassigned' selected
                    {
                        listClinicNums.Add(0);
                    }
                    else if (comboClinic.SelectedIndex > 1)
                    {
                        listClinicNums.Add(_listClinics[comboClinic.SelectedIndex - 2].ClinicNum);                      //Minus 2 for 'All' and 'Unassigned'
                    }
                }
            }
            else
            {
                //Send an empty list of clinics to get all transactions
            }
            DateTime dateFrom = PIn.Date(textDateFrom.Text);
            DateTime dateTo   = PIn.Date(textDateTo.Text);

            _tableTrans = XWebResponses.GetApprovedTransactions(listClinicNums, dateFrom, dateTo);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g(this, "Patient"), 120);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Amount"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Date"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Tran Type"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Card Number"), 140);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Expiration"), 70);
            gridMain.Columns.Add(col);
            if (PrefC.HasClinicsEnabled)
            {
                col = new ODGridColumn(Lan.g(this, "Clinic"), 100);
                gridMain.Columns.Add(col);
            }
            col = new ODGridColumn(Lan.g(this, "Transaction ID"), 110);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _tableTrans.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_tableTrans.Rows[i]["Patient"].ToString());
                row.Cells.Add(PIn.Double(_tableTrans.Rows[i]["Amount"].ToString()).ToString("f"));
                row.Cells.Add(PIn.Date(_tableTrans.Rows[i]["DateTUpdate"].ToString()).ToShortDateString());
                XWebTransactionStatus tranStatus = (XWebTransactionStatus)PIn.Int(_tableTrans.Rows[i]["TransactionStatus"].ToString());
                string tranStatusStr;
                switch (tranStatus)
                {
                case XWebTransactionStatus.DtgPaymentApproved:
                case XWebTransactionStatus.HpfCompletePaymentApproved:
                case XWebTransactionStatus.HpfCompletePaymentApprovedPartial:
                    tranStatusStr = "Sale";
                    break;

                case XWebTransactionStatus.DtgPaymentReturned:
                    tranStatusStr = "Return";
                    break;

                case XWebTransactionStatus.DtgPaymentVoided:
                    tranStatusStr = "Void";
                    break;

                default:                        //These other values should not be returned from the query.
                    tranStatusStr = tranStatus.ToString();
                    break;
                }
                row.Cells.Add(tranStatusStr);
                row.Cells.Add(_tableTrans.Rows[i]["MaskedAcctNum"].ToString());
                string expiration = _tableTrans.Rows[i]["ExpDate"].ToString();
                if (expiration.Length > 2)
                {
                    expiration = expiration.Substring(0, 2) + "/" + expiration.Substring(2);
                }
                row.Cells.Add(expiration);
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(_tableTrans.Rows[i]["Clinic"].ToString());
                }
                row.Cells.Add(_tableTrans.Rows[i]["TransactionID"].ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }