Ejemplo n.º 1
0
        public override string ToString()
        {
            var retval = string.Empty;

            //int len = 0;

            if (byDate)
            {
                retval = string.Format("Extension Date: {0} to {1}\n", startDate, endDate);
            }
            else
            {
                retval = string.Format("Ticket Number: {0} to {1}\n", lowTicketNumber, highTicketNumber);
            }

            if (lowAmount > 0 || highAmount > 0)
            {
                retval += string.Format("Extension Amount between {0:c} and {1:c}\n", lowAmount, highAmount);
            }

            if (userID.Length > 0)
            {
                retval += string.Format("User ID: {0}\n", userID);
            }

            retval += string.Format("Sorted By: {0},  {1}\n",
                                    StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                    StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));

            return(retval);
        }
        public override string ToString()
        {
            string retval = string.Empty;

            // startDate, endDate
            if (this.startDate.Length != 0 || this.endDate.Length != 0)
            {
                if (this.startDate.Length != 0 && this.endDate.Length != 0)
                {
                    retval += string.Format("Partial Payments Made: {0:C} to {1:C} \n", this.startDate, this.endDate);
                }
                else if (this.startDate.Length != 0)
                {
                    retval += string.Format("Partial Payments on: {0:C}\n", this.startDate);
                }
                else
                {
                    retval += string.Format("Partial Payments on or before: {0:C}\n", this.endDate);
                }
            }

            // lowAmount, highAmount
            if (this.lowAmount >= 0 || this.highAmount >= 0)
            {
                if (this.lowAmount >= 0 || this.highAmount >= 0)
                {
                    retval += string.Format("Partial Payments Amount: {0:C} to {1:C} \n", this.lowAmount, this.highAmount);
                }
                else if (this.lowAmount >= 0)
                {
                    retval += string.Format("Partial Payments Exactly: {0:C}\n", this.lowAmount);
                }
                else
                {
                    retval += string.Format("Partial Payments less than or equal to: {0:C}\n", this.highAmount);
                }
            }

            // lastName, firstName
            if (this.lastName.Length != 0 && this.firstName.Length != 0)
            {
                retval += string.Format("Name: {0}, {1}\n", lastName, firstName);
            }
            else if (this.lastName.Length != 0)
            {
                retval += string.Format("Name: {0}\n", lastName);
            }
            else if (this.firstName.Length != 0)
            {
                retval += string.Format("Name: {0}\n", firstName);
            }

            // DOB
            if (this.dob.Length != 0)
            {
                retval += string.Format("Date of Birth: {0}\n", this.dob);
            }

            // customerNumber
            if (this.customerNumber.Length != 0)
            {
                retval += string.Format("Customer Number: {0}\n", this.customerNumber);
            }

            // loanTicketNumber
            if (this.loanTicketNumber > 0)
            {
                retval += string.Format("Loan Ticket Number: {0}\n", this.loanTicketNumber);
            }

            // Sort By, Asc, Dsc
            retval += string.Format("\nSorted By: {0},  {1}\n",
                                    StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                    StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));

            return(retval);
        }
Ejemplo n.º 3
0
        public LoanSearchResults(DataSet s, PawnInquiry criteria, string dataTableName)
            : base(s, criteria, dataTableName)
        {
            #region Data Grid Initialization

            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();

            //Display grid with current principal if partial payments are allowed.
            if (new BusinessRulesProcedures(GlobalDataAccessor.Instance.DesktopSession).IsPartialPaymentAllowed(GlobalDataAccessor.Instance.CurrentSiteId))
            {
                this.Shop             = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.ticket           = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.cust_name        = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.DateTime         = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.LnAmount         = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.PrinicipalAmount = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.Status           = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.UserID           = new System.Windows.Forms.DataGridViewTextBoxColumn();

                this.resultsGrid_dg.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[]
                {
                    this.Shop,
                    this.ticket,
                    this.cust_name,
                    this.DateTime,
                    this.LnAmount,
                    this.PrinicipalAmount,
                    this.Status,
                    this.UserID
                });
            }
            else
            {
                this.Shop      = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.ticket    = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.cust_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.DateTime  = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.LnAmount  = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.Status    = new System.Windows.Forms.DataGridViewTextBoxColumn();
                this.UserID    = new System.Windows.Forms.DataGridViewTextBoxColumn();

                this.resultsGrid_dg.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[]
                {
                    this.Shop,
                    this.ticket,
                    this.cust_name,
                    this.DateTime,
                    this.LnAmount,
                    this.Status,
                    this.UserID
                });
            }

            //
            // Shop
            //
            this.Shop.DataPropertyName = "STORENUMBER";
            this.Shop.HeaderText       = "Shop";
            this.Shop.Name             = "Shop";
            this.Shop.ReadOnly         = true;
            this.Shop.Width            = 50;
            //
            // ticket
            //
            this.ticket.DataPropertyName = "TICKET_NUMBER";
            this.ticket.HeaderText       = "Current Tkt #";
            this.ticket.Name             = "ticket";
            this.ticket.ReadOnly         = true;
            this.ticket.Width            = 83;
            //
            // cust_name
            //
            this.cust_name.DataPropertyName = "CUST_NAME";
            this.cust_name.HeaderText       = "Name";
            this.cust_name.Name             = "cust_name";
            this.cust_name.ReadOnly         = true;
            this.cust_name.Width            = 170;
            //
            // DateTime
            //
            this.DateTime.DataPropertyName   = "DATE_MADE";
            dataGridViewCellStyle3.Format    = "g";
            dataGridViewCellStyle3.NullValue = null;
            this.DateTime.DefaultCellStyle   = dataGridViewCellStyle3;
            this.DateTime.HeaderText         = "Made Date/Time";
            this.DateTime.Name     = "DateTime";
            this.DateTime.ReadOnly = true;
            this.DateTime.Width    = 115;
            //
            // LnAmount
            //
            this.LnAmount.DataPropertyName   = "PRIN_AMOUNT";
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            dataGridViewCellStyle4.Format    = "C2";
            dataGridViewCellStyle4.NullValue = null;
            this.LnAmount.DefaultCellStyle   = dataGridViewCellStyle4;
            this.LnAmount.HeaderText         = "Loan Amount";
            this.LnAmount.Name     = "LnAmount";
            this.LnAmount.ReadOnly = true;
            this.LnAmount.Width    = 90;
            //
            // Current Prin. Amount
            //
            //Only show current principal column if partial payments are allowed.
            if (new BusinessRulesProcedures(GlobalDataAccessor.Instance.DesktopSession).IsPartialPaymentAllowed(GlobalDataAccessor.Instance.CurrentSiteId))
            {
                this.PrinicipalAmount.DataPropertyName = "PartPymtPrinAmt";
                dataGridViewCellStyle5.Alignment       = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
                dataGridViewCellStyle5.Format          = "C2";
                dataGridViewCellStyle5.NullValue       = null;
                this.PrinicipalAmount.DefaultCellStyle = dataGridViewCellStyle5;
                this.PrinicipalAmount.HeaderText       = "Current Prin. Amt";
                this.PrinicipalAmount.Name             = "PrinAmt";
                this.PrinicipalAmount.ReadOnly         = true;
                this.PrinicipalAmount.Width            = 100;
            }
            //
            // Status
            //
            this.Status.DataPropertyName = "STATUS_CD";
            this.Status.HeaderText       = "Status";
            this.Status.Name             = "Status";
            this.Status.ReadOnly         = true;
            this.Status.Width            = 65;
            //
            // UserID
            //
            this.UserID.DataPropertyName = "ENT_ID";
            this.UserID.HeaderText       = "UserID";
            this.UserID.Name             = "UserID";
            this.UserID.ReadOnly         = true;
            this.UserID.Width            = 65;

            this.resultsGrid_dg.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.resultsGrid_dg_CellContentClick);
            #endregion

            if (criteria.byDate)
            {
                resultsGrid_dg.Columns[4].HeaderText =
                    StringDBMap_Enum <PawnInquiry.searchDateType_enum> .displayValue(criteria.dateType) +
                    " Date / Time";

                resultsGrid_dg.Columns[4].DataPropertyName =
                    StringDBMap_Enum <PawnInquiry.searchDateType_enum> .toDBValue(criteria.dateType);
            }
            else
            {
                resultsGrid_dg.Columns[2].HeaderText =
                    StringDBMap_Enum <PawnInquiry.searchTicketType_enum> .displayValue(criteria.ticketType) +
                    " Tkt #";

                resultsGrid_dg.Columns[2].DataPropertyName =
                    StringDBMap_Enum <PawnInquiry.searchTicketType_enum> .toDBValue(criteria.ticketType);
            }

            this.Print_btn.Enabled = true;
            this.Print_btn.Click  += new System.EventHandler(this.Print_btn_Click);
        }
Ejemplo n.º 4
0
        public override string ToString()
        {
            string retval = "";
            int    len    = 0;

            if (byDate)
            {
                retval += string.Format("{0} Date: {1} to {2} \n",
                                        StringDBMap_Enum <searchDateType_enum> .displayValue(dateType), startDate, endDate);
                len = StringDBMap_Enum <searchDateType_enum> .displayValue(dateType).Length;
            }
            else
            {
                if (lowTicketNumber >= 0 || highTicketNumber >= 0)
                {
                    retval += string.Format("{0} Ticket:", StringDBMap_Enum <searchTicketType_enum> .displayValue(ticketType));


                    if (lowTicketNumber >= 0 && highTicketNumber >= 0)
                    {
                        retval += string.Format("{0} to {1} \n", lowTicketNumber, highTicketNumber);
                    }

                    else if (lowTicketNumber >= 0)
                    {
                        retval += string.Format("{0}\n", lowTicketNumber);
                    }

                    else
                    {
                        retval += string.Format("{0}\n", highTicketNumber);
                    }

                    len = StringDBMap_Enum <searchDateType_enum> .displayValue(dateType).Length;
                }
            }

            if (status != searchStatus_enum.ALL)
            {
                retval += string.Format("Status: {0}\n",
                                        StringDBMap_Enum <searchStatus_enum> .displayValue(status));
            }
            //-------
            if (byDate)
            {
                if (sortBy == sortField_enum.DATE)
                {
                    retval += string.Format("Sorted By: {0} DATE, {1}\n",
                                            StringDBMap_Enum <searchDateType_enum> .displayValue(dateType),
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
                else if (sortBy == sortField_enum.TICKET)
                {
                    retval += string.Format("Sorted By: Current Ticket #,  {0}\n",
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
                else
                {
                    retval += string.Format("Sorted By: {0},  {1}\n",
                                            StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
            }
            else
            {
                if (sortBy == sortField_enum.DATE)
                {
                    retval += string.Format("Sorted By: MADE DATE,  {0}\n",
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
                else if (sortBy == sortField_enum.TICKET)
                {
                    retval += string.Format("Sorted By: {0} Ticket #,  {1}\n",
                                            StringDBMap_Enum <searchTicketType_enum> .displayValue(ticketType),
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
                else
                {
                    retval += string.Format("Sorted By: {0},  {1}\n",
                                            StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                            StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));
                }
            }


            return(retval);
        }
        public override string ToString()
        {
            string retval = "";

            if (byDate)
            {
                // Transfer Date
                retval += string.Format("Date: {0} to {1} \n", startDate, endDate);
            }
            else
            {
                // Transfer Numbers
                if (lowTransferNumber >= 0 || highTransferNumber >= 0)
                {
                    if (lowTransferNumber >= 0 && highTransferNumber >= 0)
                    {
                        retval += string.Format("Transfer Number: {0} to {1} \n", lowTransferNumber, highTransferNumber);
                    }
                    else if (lowTransferNumber >= 0)
                    {
                        retval += string.Format("Transfer Number: {0}\n", lowTransferNumber);
                    }
                    else
                    {
                        retval += string.Format("Transfer Number: {0}\n", highTransferNumber);
                    }
                }
            }

            // Transfer Type
            retval += string.Format("Transfer Type: {0}\n", transferType);

            // Amount
            if (this.lowAmount >= 0 || this.highAmount >= 0)
            {
                if (lowAmount >= 0 && highAmount >= 0)
                {
                    retval += string.Format("Amount: {0:C} to {1:C} \n", lowAmount, highAmount);
                }
                else if (lowAmount >= 0)
                {
                    retval += string.Format("Amount: {0:C}\n", lowAmount);
                }
                else
                {
                    retval += string.Format("Amount: {0:C}\n", highAmount);
                }
            }

            // Sources
            if (this.sourcePrimary.Length != 0 && this.sourceSecondary.Length != 0)
            {
                retval += string.Format("Source: {0}, {1}\n", sourcePrimary, sourceSecondary);
            }
            else if (this.sourcePrimary.Length != 0)
            {
                retval += string.Format("Source: {0}\n", sourcePrimary);
            }

            // Destinations
            if (this.destinationPrimary.Length != 0 && this.destinationSecondary.Length != 0)
            {
                retval += string.Format("Destination: {0}, {1}\n", destinationPrimary, destinationSecondary);
            }
            else if (this.destinationPrimary.Length != 0)
            {
                retval += string.Format("Destination: {0}\n", destinationPrimary);
            }

            // Status
            if (this.status.Length != 0)
            {
                retval += string.Format("Current Status: {0}\n", this.status);
            }

            // User Id
            if (this.userID.Length != 0)
            {
                retval += string.Format("User Id: {0}\n", this.userID);
            }

            // Sort By, Asc, Dsc
            retval += string.Format("\nSorted By: {0},  {1}\n",
                                    StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                    StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));

            return(retval);
        }
Ejemplo n.º 6
0
        public override string ToString()
        {
            string retval = "";

            if (byDate)
            {
                retval += string.Format("Date: {0} to {1} \n", startDate, endDate);
            }
            else if (lowMSR >= 0 || highMSR >= 0)
            {
                retval += "Ticket:";

                if (lowMSR >= 0 && highMSR >= 0)
                {
                    retval += string.Format("{0} to {1} \n", lowMSR, highMSR);
                }

                else if (lowMSR >= 0)
                {
                    retval += string.Format("{0}\n", lowMSR);
                }

                else
                {
                    retval += string.Format("{0}\n", highMSR);
                }
            }

            if (lowSaleAmount >= 0 || highSaleAmount >= 0)
            {
                retval += "Sale Amount:";

                if (lowSaleAmount >= 0 && highSaleAmount >= 0)
                {
                    retval += string.Format("{0} to {1} \n", lowSaleAmount, highSaleAmount);
                }

                else if (lowSaleAmount >= 0)
                {
                    retval += string.Format("{0}\n", lowSaleAmount);
                }

                else
                {
                    retval += string.Format("{0}\n", highSaleAmount);
                }
            }

            if (lowCostAmount >= 0 || highCostAmount >= 0)
            {
                retval += "Cost Amount:";

                if (lowCostAmount >= 0 && highCostAmount >= 0)
                {
                    retval += string.Format("{0} to {1} \n", lowCostAmount, highCostAmount);
                }

                else if (lowCostAmount >= 0)
                {
                    retval += string.Format("{0}\n", lowCostAmount);
                }

                else
                {
                    retval += string.Format("{0}\n", highCostAmount);
                }
            }

            if (!string.IsNullOrEmpty(layawayOriginated))
            {
                retval += string.Format("Originated from Layaway: {0}\n", layawayOriginated);
            }

            if (status != searchStatus_enum.ALL)
            {
                retval += string.Format("Status: {0}\n", StringDBMap_Enum <searchStatus_enum> .displayValue(status));
            }

            if (!string.IsNullOrEmpty(userID))
            {
                retval += string.Format("User ID: {0}\n", userID);
            }

            if (!string.IsNullOrEmpty(includeVoids))
            {
                retval += string.Format("Include Voids: {0}\n", includeVoids);
            }

            //-------
            retval += string.Format("Sorted By: {0},  {1}\n",
                                    StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                    StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));

            return(retval);
        }
 public override string sortByName()
 {
     return(StringDBMap_Enum <sortField_enum> .displayValue(sortBy));
 }
        public override string ToString()
        {
            string retval = string.Empty;

            if (Mdse.Icn.ShopNumber != -1 || !icnYear_IsNull || Mdse.Icn.DocumentNumber != -1 ||
                !icnDocType_IsNull || Mdse.Icn.ItemNumber != -1 || Mdse.Icn.SubItemNumber != -1)
            {
                retval += string.Format("ICN: {0} {1} {2} {3} {4} {5}\n",
                                        (Mdse.Icn.ShopNumber == -1) ? "*" : Mdse.Icn.ShopNumber.ToString(),
                                        (icnYear_IsNull) ? "*" : Mdse.Icn.LastDigitOfYear.ToString(),
                                        (Mdse.Icn.DocumentNumber == -1) ? "*" : Mdse.Icn.DocumentNumber.ToString(),
                                        (icnDocType_IsNull) ? "*" : ((int)Mdse.Icn.DocumentType).ToString(),
                                        (Mdse.Icn.ItemNumber == -1) ? "*" : Mdse.Icn.ItemNumber.ToString(),
                                        (Mdse.Icn.SubItemNumber == -1) ? "*" : Mdse.Icn.SubItemNumber.ToString());
            }

            if (RfbNr > 0)
            {
                retval += string.Format("RFB: {0}\n", RfbNr);
            }

            if (GunNumber > 0)
            {
                retval += string.Format("Gun Number: {0}\n", GunNumber);
            }

            if (cat_code.Count > 0)
            {
                if (!(cat_code.Count == 1 && cat_code[0] == "-1"))
                {
                    retval += "Categories:  ";
                    bool first     = true;
                    int  catLength = 14;

                    foreach (string s in cat_names)
                    {
                        if (!first)
                        {
                            retval += ", ";
                        }
                        else
                        {
                            first = false;
                        }

                        if (catLength > _wrapWidth)
                        {
                            retval   += "\n                   ";
                            catLength = 14;
                        }

                        retval    += s;
                        catLength += s.Length + 2;
                    }

                    retval += "\n";
                }
            }


            if (status != statusField_enum.ALL)
            {
                retval += string.Format("Status:   {0}\n", StringDBMap_Enum <statusField_enum> .displayValue(status));
            }

            if (highStatusDate != DateTime.MaxValue && lowStatusDate != DateTime.MinValue)
            {
                retval += string.Format("Status updated between {0:d} and {1:d}\n", lowStatusDate, highStatusDate);
            }

            if (age >= 0)
            {
                retval += string.Format("Inventory Age: {0}\n", age);
            }

            if (lowRetail > 0 || highRetail > 0)
            {
                if (highRetail > 0)
                {
                    retval += string.Format("Retail Price between {0:c} and {1:c}\n",
                                            (lowRetail > 0) ? lowRetail : 0, highRetail);
                }
                else if (lowRetail > 0)
                {
                    retval += string.Format("Retail Price >= {0:c}\n", lowRetail);
                }
            }

            if (lowCost > 0 || highCost > 0)
            {
                if (highCost > 0)
                {
                    retval += string.Format("Item Price between {0:c} and {1:c}\n",
                                            (lowCost > 0) ? lowCost : 0, highCost);
                }
                else if (lowCost > 0)
                {
                    retval += string.Format("Item Price >= {0:c}\n", lowCost);
                }
            }

            if (descr.Length > 0)
            {
                retval += string.Format("Description is like *{0}*\n", descr);
            }

            if (manufacturer.Length > 0)
            {
                retval += string.Format("Manufacturer:  {0}\n", manufacturer);
            }

            if (model.Length > 0)
            {
                retval += string.Format("Model:  {0}\n", model);
            }

            if (serialNr.Length > 0)
            {
                retval += string.Format("Serial Nr:  {0}\n", serialNr);
            }

            if (aisle.Length > 0 || shelf.Length > 0 || location.Length > 0)
            {
                retval += string.Format("Location (aisle / shelf / other):  {0} / {1} / {2}\n", aisle, shelf, location);
            }

            retval += string.Format("\nSorted By: {0} {1}",
                                    StringDBMap_Enum <sortField_enum> .displayValue(sortBy),
                                    StringDBMap_Enum <sortDir_enum> .displayValue(sortDir));

            return(retval);
        }