Пример #1
0
        private string getDeliveryDays(CRMDataset.StoreTableRow store)
        {
            //Return delivery days from the dataset
            string ddays = "";

            //Check for overrides
            if (!store.IsIsDeliveryDayMondayNull())
            {
                ddays += (store.IsDeliveryDayMonday.Trim() == "Y" ? "M" : "");
            }
            if (!store.IsIsDeliveryDayTuesdayNull())
            {
                ddays += (store.IsDeliveryDayTuesday.Trim() == "Y" ? "T" : "");
            }
            if (!store.IsIsDeliveryDayWednesdayNull())
            {
                ddays += (store.IsDeliveryDayWednesday.Trim() == "Y" ? "W" : "");
            }
            if (!store.IsIsDeliveryDayThursdayNull())
            {
                ddays += (store.IsDeliveryDayThursday.Trim() == "Y" ? "R" : "");
            }
            if (!store.IsIsDeliveryDayFridayNull())
            {
                ddays += (store.IsDeliveryDayFriday.Trim() == "Y" ? "F" : "");
            }

            //If no overrides, then all days are valid
            if (ddays.Trim().Length == 0)
            {
                ddays = "MTWRF";
            }
            return(ddays);
        }
Пример #2
0
        private string getStoreDetailString(CRMDataset.StoreTableRow store)
        {
            //Return a string of store detail
            StringBuilder detail = new StringBuilder();

            detail.AppendLine(store.StoreName.Trim() + " (store #" + store.StoreNumber.ToString() + "; substore #" + store.SubStoreNumber.Trim() + ")");
            detail.AppendLine((!store.IsStoreAddressline1Null() ? store.StoreAddressline1.Trim() : ""));
            detail.AppendLine((!store.IsStoreAddressline2Null() ? store.StoreAddressline2.Trim() : ""));
            detail.AppendLine((!store.IsStoreCityNull() ? store.StoreCity.Trim() : "") + ", " +
                              (!store.IsStoreStateNull() ? store.StoreState.Trim() : "") + " " +
                              (!store.IsStoreZipNull() ? store.StoreZip.Trim() : ""));
            detail.AppendLine((!store.IsContactNameNull() ? store.ContactName.Trim() : "") + ", " + (!store.IsPhoneNumberNull() ? store.PhoneNumber.Trim() : ""));
            detail.AppendLine((!store.IsRegionDescriptionNull() ? store.RegionDescription.Trim() : "") +
                              " (" + (!store.IsRegionNull() ? store.Region.Trim() : "") + "), " +
                              (!store.IsDistrictNameNull() ? store.DistrictName.Trim() : "") +
                              " (" + (!store.IsDistrictNull() ? store.District.Trim() : "") + ")");
            detail.AppendLine("Zone " + (!store.IsZoneNull() ? store.Zone.Trim() : "") + ", " +
                              "Agent " + (!store.IsAgentNumberNull() ? store.AgentNumber.Trim() : "") + " " +
                              (!store.IsAgentNameNull() ? store.AgentName.Trim() : ""));
            detail.AppendLine("Window " + (!store.IsWindowTimeStartNull() ? store.WindowTimeStart.ToString("HH:mm") : "") + " - " +
                              (!store.IsWindowTimeEndNull() ? store.WindowTimeEnd.ToString("HH:mm") : "") + ", " +
                              "Del Days " + getDeliveryDays(store) + ", " +
                              (!store.IsScanStatusDescrptionNull() ? store.ScanStatusDescrption.Trim() : ""));
            detail.AppendLine("JA Transit " + (!store.IsStandardTransitNull() ? store.StandardTransit.ToString() : "") + ", " + "OFD " + getOFD(store));
            //detail.AppendLine("Special Inst: " + (!store.IsSpecialInstructionsNull() ? store.SpecialInstructions.Trim() : ""));
            return(detail.ToString());
        }
Пример #3
0
        private void OnStoreKeyUp(object sender, KeyEventArgs e)
        {
            //Event handler for store textbox key up event
            try {
                if (e.KeyCode == Keys.Enter)
                {
                    this.txtStoreName.Text = this.txtStoreAddress.Text = this.txtStoreDetail.Text = "";
                    if (this.cboClient.SelectedValue != null && this.mskStore.Text.Trim().Length > 0)
                    {
                        CRMDataset ds = new CRMDataset();
                        ds.Merge(CRMGateway.GetStoreDetail(int.Parse(this.cboClient.SelectedValue.ToString()), int.Parse(this.mskStore.Text)));
                        if (ds.StoreTable.Rows.Count > 0)
                        {
                            CRMDataset.StoreTableRow store = ds.StoreTable[0];
                            this.txtStoreName.Text = store.StoreName.Trim() + " (store #" + store.StoreNumber.ToString() + "; substore #" + store.SubStoreNumber.Trim() + ")";

                            StringBuilder address = new StringBuilder();
                            address.AppendLine((!store.IsStoreAddressline1Null() ? store.StoreAddressline1.Trim() : ""));
                            address.AppendLine((!store.IsStoreAddressline2Null() ? store.StoreAddressline2.Trim() : ""));
                            address.AppendLine((!store.IsStoreCityNull() ? store.StoreCity.Trim() : "") + ", " +
                                               (!store.IsStoreStateNull() ? store.StoreState.Trim() : "") + " " +
                                               (!store.IsStoreZipNull() ? store.StoreZip.Trim() : ""));
                            this.txtStoreAddress.Text = address.ToString();

                            StringBuilder detail = new StringBuilder();
                            detail.AppendLine((!store.IsRegionDescriptionNull() ? store.RegionDescription.Trim() : "") +
                                              " (" + (!store.IsRegionNull() ? store.Region.Trim() : "") + "), " +
                                              (!store.IsDistrictNameNull() ? store.DistrictName.Trim() : "") +
                                              " (" + (!store.IsDistrictNull() ? store.District.Trim() : "") + ")");
                            detail.AppendLine("Zone " + (!store.IsZoneNull() ? store.Zone.Trim() : "") + ", " +
                                              "Agent " + (!store.IsAgentNumberNull() ? store.AgentNumber.Trim() : "") + " " +
                                              (!store.IsAgentNameNull() ? store.AgentName.Trim() : ""));
                            detail.AppendLine("Window " + (!store.IsWindowTimeStartNull() ? store.WindowTimeStart.ToString("HH:mm") : "") + " - " +
                                              (!store.IsWindowTimeEndNull() ? store.WindowTimeEnd.ToString("HH:mm") : "") + ", " +
                                              "Del Days " + getDeliveryDays(store) + ", " +
                                              (!store.IsScanStatusDescrptionNull() ? store.ScanStatusDescrption.Trim() : ""));
                            detail.AppendLine("JA Transit " + (!store.IsStandardTransitNull() ? store.StandardTransit.ToString() : "") + ", " + "OFD " + getOFD(store));
                            detail.AppendLine("Special Inst: " + (!store.IsSpecialInstructionsNull() ? store.SpecialInstructions.Trim() : ""));
                            this.txtStoreDetail.Text = detail.ToString();
                        }
                    }
                    refreshReports();
                }
            }
            catch (Exception ex) { App.ReportError(new ApplicationException("Unexpected error when store keyed in.", ex)); }
        }
Пример #4
0
        private string getOFD(CRMDataset.StoreTableRow store)
        {
            //Return delivery days from the dataset
            string ofd = "";

            //OFD1, OFD2, or NONE
            if (!store.IsIsOutforDeliveryDay1Null())
            {
                ofd += (store.IsOutforDeliveryDay1.Trim() == "Y" ? "DAY1" : "");
            }
            else if (!store.IsIsOutforDeliveryDay2Null())
            {
                ofd += (store.IsOutforDeliveryDay2.Trim() == "Y" ? "DAY2" : "");
            }
            else
            {
                ofd += "";
            }
            return(ofd);
        }