Exemplo n.º 1
0
    private void track(string storeNumber)
    {
        //
        //Flag search by method
        Session["TrackBy"] = "Store";

        //Track
        bool               byPickup     = this.cboSearchType.SelectedValue == "Pickup";
        ProfileCommon      profile      = new MembershipServices().MemberProfile;
        string             vendorNumber = (profile.Type.ToLower() == "vendor") ? profile.ClientVendorID : null;
        string             clientNumber = this.cboClient.SelectedValue;
        TrackingStoreItems items        = new TrackingGateway().TrackCartonsByStoreSummary(clientNumber, storeNumber, DateTime.Parse(this.txtFromDate.Text), DateTime.Parse(this.txtToDate.Text), vendorNumber, byPickup);

        Session["StoreSummary"] = items;
        items = new TrackingGateway().TrackCartonsByStoreDetail(clientNumber, storeNumber, DateTime.Parse(this.txtFromDate.Text), DateTime.Parse(this.txtToDate.Text), vendorNumber, byPickup, null);
        Session["StoreDetail"] = items;
        if (items != null && items.Count > 0)
        {
            Response.Redirect("StoreSummary.aspx", false);
        }
        else
        {
            Master.ShowMessageBox("No records found. Please try again.");
        }
    }
Exemplo n.º 2
0
    private void track(string storeNumber, bool isSubStoreSearch)
    {
        //
        //Flag search by method
        Session["TrackBy"]  = "Store";
        Session["SubStore"] = isSubStoreSearch ? this.txtStore.Text : null;

        //Track
        bool byPickup = this.cboDateType.SelectedValue == "Pickup";
        MembershipServices membership = new MembershipServices();
        ProfileCommon      profile    = membership.MemberProfile;
        string             vendorID   = (profile.Type.ToLower() == "vendor") ? profile.ClientVendorID : null;
        string             clientID   = this.cboClient.SelectedValue;

        TrackingServices svcs    = new TrackingServices();
        TrackingDS       cartons = new TrackingDS();

        cartons.Merge(svcs.GetCartonsForStore(clientID, storeNumber, this.dtpFromDate.SelectedDate, this.dtpToDate.SelectedDate, vendorID, byPickup));
        if (cartons.CartonDetailForStoreTable.Rows.Count > 0)
        {
            //Capture substore (if applicable); set search results into Session state; redirect
            //to the summary page
            TrackingDS summary = buildSummary(cartons);
            Session["StoreSummary"] = summary;
            Session["StoreDetail"]  = cartons;
            Page.Response.Redirect("StoreSummary.aspx", false);
        }
        else
        {
            //Notify user that there are no cartons for the specified store
            Master.ShowMsgBox("No records found. Please try again.");
        }
    }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        /// <param name="primarySubscriptionKey"></param>
        /// <param name="secondarySubscriptionKey"></param>
        public FantasySoccerClient(string primarySubscriptionKey, string secondarySubscriptionKey)
        {
            Uri statApiBaseUrl       = SoccerConfig.StateApiBaseUrl;
            Uri scoreApiBaseUrl      = SoccerConfig.ScoreApiBaseUrl;
            Uri ProjectionApiBaseUrl = SoccerConfig.ProjectionApiBaseUrl;

            AreaServices        = new AreaServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            SeasonServices      = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            BoxScoreServices    = new BoxScoreService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            GameServices        = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            MembershipServices  = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);

            PlayerGameStatServices   = new PlayerGameStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            PlayerSeasonStatServices = new PlayerSeasonStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            PlayerServices           = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            ScheduleServices         = new ScheduleServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            SeasonServices           = new SeasonServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            StandingServices         = new StandingServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamGameServices         = new TeamGameServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamSeasonService        = new TeamSeasonService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamServices             = new TeamServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            VenueServices            = new VenueServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);

            ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, SoccerConfig.ProjectionPrimarySubscriptionKey, SoccerConfig.ProjectionSecondarySubscriptionKey);
        }
Exemplo n.º 4
0
    public EnterpriseDS GetSecureClients()
    {
        //Get a list of clients
        EnterpriseDS clients = new EnterpriseDS();

        //If user is:
        // Vendor: get list of all it's clients
        // Client: no need to get client's list - fill the drop-down with client's name
        //  Argix: get list of all clients
        MembershipServices membership = new MembershipServices();
        ProfileCommon      profile    = membership.MemberProfile;

        if (profile.ClientVendorID == TrackingServices.ID_ARGIX || membership.IsAdmin)
        {
            clients.Merge(GetClients(null));
        }
        else
        {
            if (profile.Type.ToLower() == "vendor")
            {
                clients.Merge(GetClients(profile.ClientVendorID));
            }
            else
            {
                clients.ClientTable.AddClientTableRow(profile.ClientVendorID, "", profile.Company, "");
            }
        }
        return(clients);
    }
Exemplo n.º 5
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for form load event
        try {
            bool   hasStoreNumber = new MembershipServices().MemberProfile.StoreNumber.Trim().Length > 0;
            string url            = hasStoreNumber ? "~/Members/TrackByStore.aspx" : "~/Members/TrackByCarton.aspx";
            if (Session["TrackBy"] != null)
            {
                switch (Session["TrackBy"].ToString())
                {
                case TrackingGateway.SEARCHBY_CARTONNUMBER:
                case TrackingGateway.SEARCHBY_LABELNUMBER:
                case TrackingGateway.SEARCHBY_PLATENUMBER:
                    url = "~/Members/TrackByCarton.aspx";
                    break;

                case TrackingGateway.SEARCHBY_PO:
                case TrackingGateway.SEARCHBY_PRO:
                case TrackingGateway.SEARCHBY_BOL:
                    url = "~/Members/TrackByShipment.aspx";
                    break;

                case TrackingGateway.SEARCHBY_STORE:
                    url = "~/Members/TrackByStore.aspx";
                    break;
                }
            }
            Response.Redirect(url, false);
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 6
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        try {
            string tl  = Request.QueryString["TL"];
            string lbl = Request.QueryString["LBL"];
            string ctn = Request.QueryString["CTN"];
            if (!Page.IsPostBack)
            {
                //Page request
                if (tl != null && tl.Length > 0 && lbl == null && ctn == null)
                {
                    //Page request from StoreSummary.aspx (i.e. StoreDetail.aspx?TL=)
                    //Show TL detail
                    TrackingStoreItems items = null;
                    if (Session["StoreDetail"] is TrackingStoreItems)
                    {
                        items = (TrackingStoreItems)Session["StoreDetail"];
                    }
                    if (items != null && items.Count > 0)
                    {
                        TrackingStoreItems _items = new TrackingStoreItems();
                        foreach (Argix.Enterprise.TrackingStoreItem item in items)
                        {
                            if (item.TL == tl)
                            {
                                _items.Add(item);
                            }
                        }

                        this.lblTitle.Text          = "Store# " + _items[0].Store.PadLeft(5, '0') + "   TL# " + tl;
                        this.grdTLDetail.DataSource = _items;
                        this.grdTLDetail.DataBind();
                    }
                    else
                    {
                        Master.ReportError(new ApplicationException("Could not find detailed store information. Please return to the tracking page and try again."), 4);
                    }
                }
                else if (lbl != null && lbl.Length > 0 && ctn != null && ctn.Length > 0 && tl != null && tl.Length > 0)
                {
                    //Page request (NOT a postback) from this page (i.e. StoreDetail.aspx?CTN=&LBL=&TL=)
                    Session["TrackData"] = null;
                    ProfileCommon profile = new MembershipServices().MemberProfile;
                    TrackingItems items   = new TrackingGateway().TrackCartons(new string[] { lbl }, TrackingGateway.SEARCHBY_LABELNUMBER, profile.Type, profile.ClientVendorID);
                    if (items != null && items.Count > 0)
                    {
                        Session["TrackData"] = items;
                        Response.Redirect("CartonDetail.aspx?item=" + lbl + "&TL=" + tl, false);
                    }
                    else
                    {
                        Master.ReportError(new ApplicationException("Could not find store carton information. Please return to the tracking page and try again."), 4);
                    }
                }
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 7
0
    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        if (!Page.IsPostBack)
        {
            //Display tracking information for the specified carton
            this.mCartonNumber           = Request.QueryString["ID"] == null ? "" : Request.QueryString["ID"].ToString();
            ViewState["CartonNumber"]    = this.mCartonNumber;
            this.mSearchByStoreTL        = Request.QueryString["TL"] == null ? "" : Request.QueryString["TL"].ToString();
            ViewState["SearchByStoreTL"] = this.mSearchByStoreTL;

            if (this.mCartonNumber.Length > 0)
            {
                displayTrackingDetail(this.mCartonNumber);
            }
            else
            {
                Response.Redirect("~/Members/Default.aspx");
            }

            if (Session["TrackBy"].ToString() == TrackingServices.SEARCHBY_STORE)
            {
                this.lnkTracking.PostBackUrl = "~/Members/TrackByStore.aspx";
                this.lnkStoreSummary.Visible = true;
                this.lnkSummary.Text         = "Store Detail...";
                this.lnkSummary.PostBackUrl  = "~/Members/StoreDetail.aspx?TL=" + HttpUtility.UrlEncode(this.mSearchByStoreTL);
            }
            else if (Session["TrackBy"].ToString() == TrackingServices.SEARCHBY_PO || Session["TrackBy"].ToString() == TrackingServices.SEARCHBY_PRO)
            {
                this.lnkTracking.PostBackUrl = "~/Members/TrackByPOPRO.aspx";
                this.lnkStoreSummary.Visible = false;
                this.lnkSummary.Text         = "Carton Summary...";
                this.lnkSummary.PostBackUrl  = "~/Members/CartonSummary.aspx";
            }
            else
            {
                this.lnkTracking.PostBackUrl = "~/Members/TrackByCarton.aspx";
                this.lnkStoreSummary.Visible = false;
                this.lnkSummary.Text         = "Carton Summary...";
                this.lnkSummary.PostBackUrl  = "~/Members/CartonSummary.aspx";
            }
            this.lnkFileClaim.NavigateUrl = "~/Members/FileClaim.aspx?ID=" + this.mCartonNumber;
            this.lnkFileClaim.ToolTip     = "Submit a file claim";
            MembershipServices membership = new MembershipServices();
            this.lnkFileClaim.Visible = membership.IsAdmin || membership.IsArgix || membership.IsFileClaims;
            this.lnkPODReq.Visible    = true;
        }
        else
        {
            this.mCartonNumber    = ViewState["CartonNumber"].ToString();
            this.mSearchByStoreTL = ViewState["SearchByStoreTL"].ToString();
        }
    }
Exemplo n.º 8
0
    protected void OnTrack(object sender, EventArgs e)
    {
        //Track one or more cartons
        try {
            if (Page.IsValid)
            {
                //Flag search by method
                string trackBy = TrackingGateway.SEARCHBY_CARTONNUMBER;
                switch (this.cboTrackBy.SelectedValue)
                {
                case "CartonNumber": trackBy = TrackingGateway.SEARCHBY_CARTONNUMBER; break;

                case "LabelNumber": trackBy = TrackingGateway.SEARCHBY_LABELNUMBER; break;

                case "PlateNumber": trackBy = TrackingGateway.SEARCHBY_PLATENUMBER; break;
                }
                Session["TrackBy"] = trackBy;

                //Validate
                string input = encodeInput(this.txtNumbers.Text);
                if (input.Length == 0)
                {
                    Master.ShowMessageBox("Please enter valid tracking numbers."); return;
                }
                string[] numbers = input.Split(Convert.ToChar(13));
                if (numbers.Length > 25)
                {
                    Master.ShowMessageBox("Please limit your search to 25 items."); return;
                }

                //Track
                ProfileCommon profile = new MembershipServices().MemberProfile;
                TrackingItems items   = new TrackingGateway().TrackCartons(numbers, trackBy, profile.Type, profile.ClientVendorID);
                Session["TrackData"] = items;
                if (items != null && items.Count > 0)
                {
                    if (items.Count == 1 && items[0].LabelNumber.Trim().Length > 0)
                    {
                        Response.Redirect("CartonDetail.aspx?item=" + items[0].LabelNumber.Trim(), false);
                    }
                    else
                    {
                        Response.Redirect("CartonSummary.aspx", false);
                    }
                }
                else
                {
                    Master.ShowMessageBox("No records found. Please try again.");
                }
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 9
0
    private StoreDataset getArgixStores(string subStoreNumber)
    {
        //Get a list of Argix-numbered stores for the specified sub-store number
        MembershipServices membership   = new MembershipServices();
        ProfileCommon      profile      = membership.MemberProfile;
        string             vendorNumber = (profile.Type.ToLower() == "vendor") ? profile.ClientVendorID : null;
        string             clientNumber = this.cboClient.SelectedValue;

        StoreDataset stores = new TrackingGateway().GetStoresForSubStore(subStoreNumber, clientNumber, vendorNumber);

        return(stores);
    }
Exemplo n.º 10
0
 //
 protected void Page_Load(object sender, EventArgs e)
 {
     //Event handler for form load event
     try {
         if (!Page.IsPostBack)
         {
             MembershipServices membership = new MembershipServices();
             this.lnkTrackByShipment.Visible = membership.IsAdmin || membership.IsArgix || membership.IsPOMember;
         }
     }
     catch (Exception ex) { ReportError(ex, 3); }
 }
Exemplo n.º 11
0
    protected void OnCommand(object sender, CommandEventArgs e)
    {
        //Event handler for user requested to track one or more cartons
        try {
            switch (e.CommandName)
            {
            case "Track":
                if (Page.IsValid)
                {
                    //Track by store or substore depending upon user profile specification
                    MembershipServices membership = new MembershipServices();
                    ProfileCommon      profile    = membership.MemberProfile;
                    if (profile.StoreSearchType == "Sub" || this.chkSubSearch.Checked)
                    {
                        //Get list of Argix store selections for the requested substore
                        StoreDataset stores = getArgixStores(this.txtStore.Text);
                        if (stores.StoreTable.Rows.Count == 0)
                        {
                            //No stores; notify store not found
                            Master.ShowMessageBox("Could not find any stores for sub-store " + this.txtStore.Text + ".");
                        }
                        else if (stores.StoreTable.Rows.Count == 1)
                        {
                            //Single substore; process without prompting the user
                            track(stores.StoreTable[0].NUMBER.ToString());
                        }
                        else
                        {
                            //Ambiguous substore selections; prompt user to select the desired substore
                            this.lstStores.DataSource = stores;
                            this.lstStores.DataBind();
                            this.mvMain.SetActiveView(this.vwSelectStore);
                        }
                    }
                    else
                    {
                        track(this.txtStore.Text);
                    }
                }
                break;

            case "Continue":
                track(this.lstStores.SelectedValue);
                break;

            case "Cancel":
                this.mvMain.SetActiveView(this.vwSearchStore);
                break;
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 12
0
    private EnterpriseDS getArgixStores(string subStoreNumber)
    {
        //Get a list of Argix-numbered stores for the specified sub-store number
        MembershipServices membership = new MembershipServices();
        ProfileCommon      profile    = membership.MemberProfile;
        string             vendorID   = (profile.Type.ToLower() == "vendor") ? profile.ClientVendorID : null;
        string             clientID   = this.cboClient.SelectedValue;

        TrackingServices svcs   = new TrackingServices();
        EnterpriseDS     stores = svcs.GetStoresForSubStore(subStoreNumber, clientID, vendorID);

        return(stores);
    }
Exemplo n.º 13
0
    protected void OnCommand(object sender, CommandEventArgs e)
    {
        //Event handler for user requested to track one or more cartons
        switch (e.CommandName)
        {
        case "Track":
            if (Page.IsValid)
            {
                //Track by store or substore depending upon user profile specification
                MembershipServices membership = new MembershipServices();
                ProfileCommon      profile    = membership.MemberProfile;
                if (profile.StoreSearchType == "Sub" || this.chkSubSearch.Checked)
                {
                    //Get list of Argix store selections for the requested substore
                    EnterpriseDS stores = getArgixStores(this.txtStore.Text);
                    if (stores.StoreTable.Rows.Count == 0)
                    {
                        //No records; notify store not found
                        Master.ShowMsgBox("Store not found. Please try again.");
                    }
                    else if (stores.StoreTable.Rows.Count == 1)
                    {
                        //Single substore; process without prompting the user
                        track(stores.StoreTable[0].NUMBER.ToString(), true);
                    }
                    else
                    {
                        //Ambiguous substore selections; prompt user to select the desired substore
                        this.lstStores.DataSource     = stores;
                        this.lstStores.DataTextField  = "DESCRIPTION";
                        this.lstStores.DataValueField = "NUMBER";
                        this.lstStores.DataBind();
                        this.mvMain.SetActiveView(this.vwSelectStore);
                    }
                }
                else
                {
                    track(this.txtStore.Text, false);
                }
            }
            break;

        case "Continue":
            track(this.lstStores.SelectedValue, true);
            break;

        case "Cancel":
            this.mvMain.SetActiveView(this.vwSearchStore);
            break;
        }
    }
Exemplo n.º 14
0
    protected void OnCommand(object sender, CommandEventArgs e)
    {
        //Event handler for command button clicked
        string userID = "";

        switch (e.CommandName)
        {
        case "Refresh":
            this.grdUsers.DataBind();
            break;

        case "Welcome":
            //Send a welcome message to the selected user
            userID = this.grdUsers.SelectedValue.ToString();
            string userName = this.grdUsers.SelectedRow.Cells[2].Text;
            string email    = this.grdUsers.SelectedRow.Cells[3].Text;
            if (new EmailGateway().SendWelcomeMessage(userName, userID, email))
            {
                Master.ShowMessageBox("Welcome email has been sent to " + userID + ".");
            }
            else
            {
                Master.ShowMessageBox("System Error: Welcome email could NOT be sent to " + userID + ".");
            }
            break;

        case "Reset":
            //Reset the selected users password
            userID = this.grdUsers.SelectedValue.ToString();
            MembershipUser user = Membership.GetUser(userID);
            if (user.IsLockedOut)
            {
                //If user's account is locked out then unlock it first
                if (!user.UnlockUser())
                {
                    Master.ShowMessageBox("System could not unlock the user. Password was not reset.");
                    return;
                }
            }
            string pwd = new MembershipServices().GeneratePassword(8);
            user.ChangePassword(user.GetPassword(), pwd);
            ProfileCommon profile = new ProfileCommon().GetProfile(userID);
            profile.PasswordReset = true;
            profile.Save();

            new EmailGateway().SendPasswordResetMessage(user.UserName, user.Email, pwd);
            Master.ShowMessageBox("Password has been reset and emailed to the user.");
            break;
        }
    }
Exemplo n.º 15
0
    protected void OnLogin(object sender, EventArgs e)
    {
        //Event handler for login request
        string username = this.txtUserID.Text.Trim();
        string pwd      = this.txtPassword.Text;

        try {
            //Validate login
            MembershipUserCollection users = Membership.FindUsersByName(username);
            if (users.Count == 0)
            {
                rfvUserID.IsValid = false; rfvUserID.ErrorMessage = USER_LOGIN_NOACCOUNT; return;
            }
            if (users[username].IsLockedOut)
            {
                rfvUserID.IsValid = false; rfvUserID.ErrorMessage = USER_ACCOUNT_LOCKEDOUT; return;
            }
            if (!users[username].IsApproved)
            {
                rfvUserID.IsValid = false; rfvUserID.ErrorMessage = USER_ACCOUNT_INACTIVE; return;
            }
            if (Page.IsValid)
            {
                //Validate userid/password
                if (Membership.ValidateUser(username, this.txtPassword.Text))
                {
                    //?
                    FormsAuthentication.SetAuthCookie(username, false);

                    //Force user to change the password if required as per policy (i.e. password reset or expired)
                    MembershipServices membership = new MembershipServices(username);
                    if (membership.IsPasswordExpired)
                    {
                        Response.Redirect("~/ChangePassword.aspx", false);
                    }
                    else
                    {
                        string url = Request.QueryString["ReturnUrl"];
                        Response.Redirect((url != null? url : "~/Members/Default.aspx"), false);
                    }
                }
                else
                {
                    rfvUserID.IsValid = false; rfvUserID.ErrorMessage = USER_LOGIN_FAILED;
                }
            }
        }
        catch (Exception ex) { rfvUserID.IsValid = false; rfvUserID.ErrorMessage = ex.Message; }
    }
Exemplo n.º 16
0
    public void ReportError(Exception ex, int logLevel)
    {
        //Report an exception to the user
        try {
            string msg = ex.Message;
            if (ex.InnerException != null)
            {
                msg = ex.Message + "\n\n NOTE: " + ex.InnerException.Message;
            }

            string username = new MembershipServices().Username;
            new EnterpriseGateway().WriteLogEntry(logLevel, username, ex);
            ShowMessageBox(msg);
        }
        catch (Exception) { }
    }
Exemplo n.º 17
0
    protected void OnSendingMail(object sender, MailMessageEventArgs e)
    {
        //Event handler for event that occurs before the user is sent a password in e-mail
        MembershipUser user     = Membership.GetUser(this.RecoverUserPassword.UserName);
        string         password = new MembershipServices().GeneratePassword(8);

        user.ChangePassword(user.GetPassword(), password);

        //Set flag that forces user to change password on next login
        ProfileCommon profile = new ProfileCommon().GetProfile(user.UserName);

        profile.PasswordReset = true;
        profile.Save();

        //Send an email
        new EmailGateway().SendPasswordResetMessage(user.UserName, user.Email, password);
        e.Cancel = true;
    }
        /// <summary>
        ///
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        /// <param name="primarySubscriptionKey"></param>
        /// <param name="secondarySubscriptionKey"></param>

        public SportDataCSGOClient(string primarySubscriptionKey, string ProjectionPrimarySubscriptionKey)
        {
            Uri scoreApiBaseUrl      = CSGOConfig.ScoreApiBaseUrl;
            Uri statApiBaseUrl       = CSGOConfig.StateApiBaseUrl;
            Uri ProjectionApiBaseUrl = CSGOConfig.ProjectionApiBaseUrl;

            AreasServices       = new AreaServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            GameServices        = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            MembershipServices  = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            PlayerServices      = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            SeasonServices      = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            ScheduleServices    = new ScheduleServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            TeamServices        = new TeamServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            VenueServices       = new VenueServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            BoxScoreServices = new BoxScoreServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, ProjectionPrimarySubscriptionKey);
        }
Exemplo n.º 19
0
    //
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for form load event
        if (!Page.IsPostBack)
        {
            //Set reports:  Admin\Argix role get everything (00000.xml);
            //              Reports role gets custom file if exists or default file otherwise
            MembershipServices membership = new MembershipServices();
            if (membership.IsAdmin || membership.IsArgix)
            {
                this.xmlReports.DataFile = "~/App_Data/00000.xml";
            }
            else if (membership.IsRSMember)
            {
                if (membership.MemberProfile != null)
                {
                    string vfile = "~/App_Data/" + membership.MemberProfile.ClientVendorID.Trim().PadLeft(5, '0') + ".xml";
                    string file  = Server.MapPath(vfile);
                    if (System.IO.File.Exists(file))
                    {
                        this.xmlReports.DataFile = vfile;
                    }
                    else
                    {
                        this.xmlReports.DataFile = "~/App_Data/default.xml";
                    }
                }
            }
            else
            {
                this.xmlReports.DataFile = "~/App_Data/blank.xml";
            }

            //Set UI element states
            this.imgTrackByPOPRO.Visible     = this.lnkTrackByPOPRO.Visible = membership.IsAdmin || membership.IsArgix || membership.IsPOMember;
            this.imgManageGuests.Visible     = this.lnkManageGuests.Visible = membership.IsAdmin;
            this.imgManageUsers.Visible      = this.lnkManageUsers.Visible = membership.IsAdmin;
            this.imgSetup.Visible            = this.lnkSetup.Visible = membership.IsAdmin;
            this.imgManageMembership.Visible = this.lnkManageMembership.Visible = membership.IsAdmin;
        }
    }
Exemplo n.º 20
0
        public ClientDataset GetClients()
        {
            //Get a list of clients
            ClientDataset clients = new ClientDataset();

            //If user is:
            // Vendor: get list of all it's clients
            // Client: no need to get client's list - fill the drop-down with client's name
            //  Argix: get list of all clients
            MembershipServices membership = new MembershipServices();
            ProfileCommon      profile    = membership.MemberProfile;

            if (profile.ClientVendorID == TrackingGateway.ID_ARGIX || membership.IsAdmin)
            {
                clients.Merge(GetClients(null));
            }
            else
            {
                if (profile.Type.ToLower() == "vendor")
                {
                    clients.Merge(GetClients(profile.ClientVendorID));
                }
                else
                {
                    //Get the single client from login profile OR get all clients that have same ARNumber
                    ClientDataset _clients = GetClients(null);
                    ClientDataset.ClientTableRow _client = (ClientDataset.ClientTableRow)_clients.ClientTable.Select("ClientID='" + profile.ClientVendorID + "'")[0];
                    if (this.mMatchClientByARNumber.Contains(_client.ARNumber))
                    {
                        clients.Merge(_clients.ClientTable.Select("ARNumber='" + _client.ARNumber + "'"));
                    }
                    else
                    {
                        clients.ClientTable.AddClientTableRow(profile.ClientVendorID, "", profile.Company, "", "");
                    }
                }
            }
            return(clients);
        }
Exemplo n.º 21
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        if (!Page.IsPostBack)
        {
            //Init controls
            this.dtpFromDate.SelectedDate = DateTime.Today.AddDays(-((int)Application["DateDaysSpread"]));
            this.dtpToDate.SelectedDate   = DateTime.Today;
            this.cboClient.DataBind();

            MembershipServices membership = new MembershipServices();
            ProfileCommon      profile    = membership.MemberProfile;
            this.chkSubSearch.Checked = (profile.StoreSearchType == "Sub");
            this.chkSubSearch.Visible = (membership.IsAdmin || membership.IsArgix);

            this.msg2Label.Text      = "Delivery date can't be more than " + Application["DateDaysForward"].ToString() + " days in the future.";
            this.msg3Label.Text      = "From date can't be older than " + Application["DateDaysBack"].ToString() + " days and must be less than To date.";
            this.msg4Label.Text      = "Date range can't be more than " + Application["DateDaysSpread"].ToString() + " days.";
            this.msg1Label.ForeColor = this.msg2Label.ForeColor = this.msg3Label.ForeColor = this.msg4Label.ForeColor = System.Drawing.Color.Black;
        }
        OnValidateForm(null, EventArgs.Empty);
    }
Exemplo n.º 22
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        try {
            if (!Page.IsPostBack)
            {
                //Init controls
                this.txtFromDate.Text = DateTime.Today.AddDays(-7).ToString("MM/dd/yyyy");
                this.txtToDate.Text   = DateTime.Today.ToString("MM/dd/yyyy");
                this.cboClient.DataBind();

                MembershipServices membership = new MembershipServices();
                this.chkSubSearch.Checked = (membership.MemberProfile.StoreSearchType == "Sub");
                this.chkSubSearch.Visible = (membership.IsAdmin || membership.IsArgix);

                ProfileCommon profile = new MembershipServices().MemberProfile;
                this.txtStore.Text    = profile.StoreNumber.Trim().Length > 0 ? profile.StoreNumber : "";
                this.txtStore.Enabled = profile.StoreNumber.Trim().Length == 0;
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //Event handler for form load event
     try {
         if (!Page.IsPostBack)
         {
             //Set reports:  Admin\Argix role get everything (00000.xml);
             //              Reports role gets custom file if exists or default file otherwise
             MembershipServices membership = new MembershipServices();
             if (membership.IsAdmin || membership.IsArgix)
             {
                 this.xmlReports.DataFile = "~/App_Data/00000.xml";
             }
             else if (membership.IsRSMember)
             {
                 if (membership.MemberProfile != null)
                 {
                     string vfile = "~/App_Data/" + membership.MemberProfile.ClientVendorID.Trim().PadLeft(5, '0') + ".xml";
                     string file  = Server.MapPath(vfile);
                     if (System.IO.File.Exists(file))
                     {
                         this.xmlReports.DataFile = vfile;
                     }
                     else
                     {
                         this.xmlReports.DataFile = "~/App_Data/default.xml";
                     }
                 }
             }
             else
             {
                 this.xmlReports.DataFile = "~/App_Data/blank.xml";
             }
         }
     }
     catch (Exception ex) { ReportError(ex, 3); }
 }
Exemplo n.º 24
0
    protected void OnTrack(object sender, EventArgs e)
    {
        //Track one or more cartons
        string searchBy = TrackingServices.SEARCHBY_CARTONNUMBER;

        switch (this.cboSearchBy.SelectedValue)
        {
        case "CartonNumber": searchBy = TrackingServices.SEARCHBY_CARTONNUMBER; break;

        case "LabelNumber": searchBy = TrackingServices.SEARCHBY_LABELNUMBER; break;

        case "PlateNumber": searchBy = TrackingServices.SEARCHBY_PLATENUMBER; break;
        }
        Session["TrackBy"]  = searchBy;
        Session["SubStore"] = null;

        //Validate
        string input = encodeInput(this.txtNumbers.Text);

        if (input.Length == 0)
        {
            this.rfvTracking.IsValid      = false;
            this.rfvTracking.ErrorMessage = "No valid tracking numbers were entered.";
            return;
        }
        string[] numbers = input.Split(Convert.ToChar(13));
        if (numbers.Length > (int)Application["TrackingNumbersMax"])
        {
            this.rfvTracking.IsValid      = false;
            this.rfvTracking.ErrorMessage = "You can not search more than 10 items at a time.";
            return;
        }

        //Build search table and validate
        TrackingDS trackingSearch = new TrackingDS();

        for (int i = 0; i < numbers.Length; i++)
        {
            string number = numbers[i].Trim();
            if (trackingSearch.CartonSearchTable.FindBySearchID(number) == null)
            {
                //Not a duplicate- validate format
                if (searchBy == TrackingServices.SEARCHBY_CARTONNUMBER && number.Length >= (int)Application["CartonLenMin"] && number.Length <= (int)Application["CartonLenMax"])
                {
                    trackingSearch.CartonSearchTable.AddCartonSearchTableRow(number, false, i, 0, true);
                }
                else if (searchBy == TrackingServices.SEARCHBY_LABELNUMBER && number.Length > 0 && number.Length == (int)Application["ArgixLabelLen"] && isNumeric(number))
                {
                    trackingSearch.CartonSearchTable.AddCartonSearchTableRow(number, false, i, 0, true);
                }
                else if (searchBy == TrackingServices.SEARCHBY_PLATENUMBER && number.Length > 0 && number.Length <= (int)Application["CartonLenMax"])
                {
                    trackingSearch.CartonSearchTable.AddCartonSearchTableRow(number, false, i, 0, true);
                }
                else
                {
                    trackingSearch.CartonSearchTable.AddCartonSearchTableRow(number, false, i, 0, false);
                }
            }
        }
        DataRow[] valid = trackingSearch.CartonSearchTable.Select("Valid = true");
        if (valid.Length == 0)
        {
            //No valid numbers to track
            this.rfvTracking.IsValid      = false;
            this.rfvTracking.ErrorMessage = "No valid tracking numbers were entered.";
            return;
        }

        //Get carton detail data
        StringBuilder trackingNumbers = new StringBuilder();

        foreach (TrackingDS.CartonSearchTableRow row in trackingSearch.CartonSearchTable.Rows)
        {
            if (row.Valid)
            {
                trackingNumbers.Append(trackingNumbers.Length == 0 ? row.SearchID : "," + row.SearchID);
            }
        }
        ProfileCommon    profile = new MembershipServices().MemberProfile;
        TrackingServices svcs    = new TrackingServices();
        TrackingDS       cartons = new TrackingDS();

        cartons.Merge(svcs.GetCartons(trackingNumbers.ToString(), searchBy, profile.Type, profile.ClientVendorID));
        if (cartons.CartonDetailTable.Rows.Count > 0)
        {
            //Build a summary for the summary page
            TrackingDS summary = buildSummary(trackingSearch, cartons, searchBy);
            Session["TrackingSearch"]  = trackingSearch;
            Session["TrackingSummary"] = summary;
            Session["TrackingDetail"]  = cartons;
            Response.Redirect("CartonSummary.aspx");
        }
        else
        {
            Master.ShowMsgBox("No records found. Please try again.");
        }
    }
Exemplo n.º 25
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        string tl  = Request.QueryString["TL"];
        string lbl = Request.QueryString["LBL"];
        string ctn = Request.QueryString["CTN"];

        if (!Page.IsPostBack)
        {
            //Page request
            if (tl != null && tl.Length > 0 && lbl == null && ctn == null)
            {
                //Page request from StoreSummary.aspx (i.e. StoreDetail.aspx?TL=)
                //Show TL detail
                TrackingDS storeDetail = new TrackingDS();
                DataSet    ds          = (DataSet)Session["StoreDetail"];
                if (ds != null)
                {
                    storeDetail.Merge(ds.Tables["CartonDetailForStoreTable"].Select("TL='" + tl + "'"));
                }
                if (storeDetail.CartonDetailForStoreTable.Rows.Count > 0)
                {
                    //Display store\substore, and cartons for the requested TL
                    this.lblTitle.Text            = "Tracking Summary: Store#" + (Session["SubStore"] != null ? Session["SubStore"] : storeDetail.CartonDetailForStoreTable[0].Store.PadLeft(5, '0')) + "; TL#" + tl;
                    this.grdTLDetail.DataSourceID = "";
                    this.grdTLDetail.DataMember   = "CartonDetailForStoreTable";
                    this.grdTLDetail.DataSource   = storeDetail;
                    this.grdTLDetail.DataBind();
                }
                else
                {
                    this.lblTitle.Text = "Tracking Summary: Store#?????" + "; TL#" + tl;
                }
            }
            else if (lbl != null && lbl.Length > 0 && ctn != null && ctn.Length > 0 && tl != null && tl.Length > 0)
            {
                //Page request (NOT a postback) from this page (i.e. StoreDetail.aspx?CTN=&LBL=&TL=)
                //Build summary record for the specified carton (needed by CartonDetail.aspx)
                TrackingDS summary = new TrackingDS();
                summary.CartonSummaryTable.AddCartonSummaryTableRow(lbl, ctn, lbl, lbl, "", "", "", "");

                //Build detail for the specified carton (needed by CartonDetail.aspx)
                TrackingDS         cartons    = new TrackingDS();
                MembershipServices membership = new MembershipServices();
                ProfileCommon      profile    = membership.MemberProfile;
                TrackingServices   svcs       = new TrackingServices();
                DataSet            ds         = svcs.GetCartons(lbl, TrackingServices.SEARCHBY_LABELNUMBER, profile.Type, profile.ClientVendorID);
                cartons.Merge(ds);

                Session["TrackingSummary"] = Session["TrackingDetail"] = null;
                if (cartons.CartonDetailTable.Rows.Count > 0)
                {
                    Session["TrackingSummary"] = summary;
                    Session["TrackingDetail"]  = cartons;
                    Response.Redirect("CartonDetail.aspx?ID=" + lbl + "&TL=" + tl);
                }
                else
                {
                    this.errorLabel.Text = "An error occured. System is unable to show details.";
                }
            }
            else
            {
                //Something went wrong
                Response.Redirect("StoreSummary.aspx");
            }
        }
    }
Exemplo n.º 26
0
    protected void OnPODRequest(object sender, EventArgs e)
    {
        //Send request to Customer Service and confirmation to user
        TrackingDS.CartonDetailTableRow carton = null;
        string             cbol       = "";
        bool               imageFound = false;
        MembershipServices membership = new MembershipServices();
        TrackingDS         summary    = (TrackingDS)Session["TrackingSummary"];

        TrackingDS.CartonSummaryTableRow summaryRow = summary.CartonSummaryTable.FindByID(this.CartonNumberValue.Text);
        if (summaryRow == null)
        {
            summaryRow = summary.CartonSummaryTable.FindByID(this.LabelSeqValue.Text);
        }
        if (summaryRow != null)
        {
            //Get all detail rows for this carton
            string     filter     = "[LBL]=" + summaryRow.LBLNumber;
            TrackingDS cartons    = (TrackingDS)Session["TrackingDetail"];
            DataRow[]  detailRows = cartons.CartonDetailTable.Select(filter);
            if (detailRows != null && detailRows.Length > 0)
            {
                //Get carton data
                carton = (TrackingDS.CartonDetailTableRow)detailRows[0];
                if (membership.IsAdmin || membership.IsArgix || membership.IsPODMember)
                {
                    //Check for a POD image for this CBOL
                    cbol = carton.IsCBOLNull() ? "" : carton.CBOL.Trim();
                    if (cbol.Length > 0)
                    {
                        string cl  = carton.CL.Trim().PadLeft(3, '0');
                        string div = "%";
                        string st  = carton.S.ToString().PadLeft(5, '0');
                        Imaging.ImageService isvc = new Imaging.ImageService();
                        isvc.Url = Application["ImageService"].ToString();
                        isvc.UseDefaultCredentials = true;
                        DataSet ds = isvc.SearchSharePointImageStore("TBill", "TBBarCode", cbol + cl + div + st + "%");
                        imageFound = (ds != null && ds.Tables[0].Rows.Count > 0);
                    }
                }
            }
        }

        if (imageFound)
        {
            //Image available- open image into another browser instance
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script language=javascript>");
            sb.Append("window.open('PODImage.aspx?doc=TBill&prop=TBBarCode&search=" + cbol + "%', '_blank', 'width=480,height=576,menubar=yes,location=no,toolbar=no,status=yes,resizable=yes');");
            sb.Append("</script>");
            Page.ClientScript.RegisterStartupScript(typeof(Page), "POD Image", sb.ToString());
        }
        else
        {
            //No image; request a POD from Argix
            EmailServices  svcs     = new EmailServices();
            MembershipUser user     = Membership.GetUser();
            string         substore = Session["SubStore"] != null ? Session["SubStore"].ToString() : "";
            svcs.SendPODRequest(user, carton, substore);
            svcs.SendPODRequestConfirm(user, carton, substore);

            //Disply confirmation to user
            Response.Redirect("PODConfirmation.aspx");
        }
    }
Exemplo n.º 27
0
    private void showCarton(TrackingDS.CartonDetailTableRow carton)
    {
        //Display details for the specified carton
        this.CartonNumberValue.Text = carton.CTN.Trim();
        this.ClientNameValue.Text   = carton.CLNM.Trim();
        string storeAddLine = carton.SA1.Trim();

        if (!carton.IsSA2Null() && carton.SA2.Trim().Length > 0)
        {
            storeAddLine += ", " + carton.SA2.Trim() + ", ";
        }
        this.StoreNum.Text        = (Session["SubStore"] != null ? Session["SubStore"].ToString() : carton.S.ToString().PadLeft(5, '0'));
        this.StoreName.Text       = ": " + carton.SNM.Trim() + ", " + storeAddLine + carton.SCT.Trim() + ", " + carton.SST.Trim() + " " + carton.SZ.ToString();
        this.VendorNameValue.Text = carton.IsVNMNull() ? "" : carton.VNM.Trim();
        this.PickupDateValue.Text = carton.IsPUDNull() ? "" : carton.PUD.Trim();
        //this.CarrierValue.Text = carton["CarrierName"].ToString();
        this.BOLValue.Text       = carton.IsBLNull() ? "" : carton.BL.ToString();
        this.TLValue.Text        = carton.IsTLNull() ? "" : carton.TL.Trim();
        this.LabelSeqValue.Text  = carton.LBL.ToString();
        this.PONumberValue.Text  = carton.IsPONull() ? "" : carton.PO.Trim();
        this.WeightValue.Text    = carton.IsWTNull() ? "" : carton.WT.ToString();
        this.ShipmentNumber.Text = carton.IsShipmentNumberNull() ? "" : carton.ShipmentNumber.Trim();
        this.DeliveryValue.Text  = carton.IsACTSDDNull() ? "" : carton.ACTSDD.Trim();

        //Sort facility
        this.TDSDate.Text = this.TDSStatus.Text = this.TDSLocation.Text = "";
        if (!carton.IsASFDNull() && carton.ASFD.Trim().Length > 0)
        {
            this.TDSDate.Text     = carton.ASFD.Trim() + " " + carton.ASFT.Trim();
            this.TDSStatus.Text   = "Arrived At Sort Facility";
            this.TDSLocation.Text = carton.SRTLOC.Trim();
        }
        this.DepartureDate.Text = this.DepartureStatus.Text = this.DepartureLocation.Text = "";
        if (!carton.IsADPDNull() && carton.ADPD.Trim().Length > 0)
        {
            this.DepartureDate.Text     = carton.ADPD.Trim() + " " + carton.ADPT.Trim();
            this.DepartureStatus.Text   = "Departed Sort Facility";
            this.DepartureLocation.Text = carton.IsSHPRNull() ? "" : carton.SHPR.Trim();
        }

        //Delivery terminal
        //1. BOL confirmed (trailer arrived in AS400): SCNTP=0, AARD!=null;
        //2. Agent scan: SCNTP=1, AARD!=null, OM=Over(O)||Short(S)||MisRoute(A)||Match(M)
        this.ArrivalDate.Text = this.ArrivalStatus.Text = this.ArrivalLocation.Text = "";
        if (!carton.IsAARDNull() && carton.AARD.Trim().Length > 0)
        {
            this.ArrivalDate.Text = carton.AARD.Trim() + " " + carton.AART.Trim();
            if (carton.SCNTP == 1)
            {
                switch (carton.OM)
                {
                case "M": this.ArrivalStatus.Text = "Scanned At Delivery Terminal"; break;

                case "S": this.ArrivalStatus.Text = "Short At Delivery Terminal"; break;

                case "O": this.ArrivalStatus.Text = "Over At Delivery Terminal"; break;

                case "A": this.ArrivalStatus.Text = "MisRoute At Delivery Terminal"; break;
                }
            }
            else
            {
                this.ArrivalStatus.Text = "Arrived At Delivery Terminal";
            }
            if (!carton.IsSAGCTNull() && carton.SAGCT.Trim().Length > 0)
            {
                this.ArrivalLocation.Text = carton.SAGCT.Trim() + "/" + carton.SAGST.Trim();
            }
            else
            {
                this.ArrivalLocation.Text = carton.IsAGCTNull() ? "" : carton.AGCT.Trim() + "/" + carton.AGST.Trim();
            }
        }

        //Store delivery
        this.StoreDeliveryDate.Text = this.StoreDeliveryStatus.Text = this.StoreDeliveryLocation.Text = "";
        if (carton.SCNTP == 3 && !carton.IsACTSDDNull() && carton.ACTSDD.Trim().Length > 0)
        {
            this.StoreDeliveryDate.Text     = carton.ACTSDD.Trim();;
            this.StoreDeliveryStatus.Text   = "Out For Delivery";
            this.StoreDeliveryLocation.Text = carton.SCT.Trim() + "/" + carton.SST.Trim();
        }

        //POD
        this.PODDate.Text      = this.PODStatus.Text = this.PODLocation.Text = "";
        this.lnkPODReq.Enabled = false;
        this.lnkPODReq.ToolTip = "POD only available after carton delivery";
        if (carton.SCNTP == 3 && !carton.IsSCDNull() && carton.SCD.Trim().Length > 0)
        {
            //Check for mis-routed carton- podScan is estimated by UPS (or other agent)
            this.PODDate.Text = carton.SCD.Trim() + " " + carton.SCTM.Trim();
            if (carton.T.Trim().Length == 18 && carton.T.Trim().Substring(0, 2).ToLower() == "1z")
            {
                this.PODStatus.Text = "Rerouted: Tracking # " + carton.T.Trim();
            }
            else
            {
                switch (carton.OM)
                {
                case "M": this.PODStatus.Text = carton.ISMN == 1 ? "Delivered (Scan N/A - Manual Entry)" : "Delivered"; break;

                case "S": this.PODStatus.Text = "Short At Delivery"; break;

                case "O": this.PODStatus.Text = "Over At Delivery"; break;

                case "A": this.PODStatus.Text = "MisRoute At Delivery"; break;
                }
            }
            this.PODLocation.Text = carton.SCT.Trim() + "/" + carton.SST.Trim();

            //POD Request link available if carton delivered
            this.lnkPODReq.Enabled = true;
            MembershipServices membership = new MembershipServices();
            if (membership.IsAdmin || membership.IsArgix || membership.IsPODMember)
            {
                this.lnkPODReq.ToolTip = "Display POD image (if available; otherwise POD request will be submitted)";
            }
            else
            {
                this.lnkPODReq.ToolTip = "Submit a POD request";
            }
        }
        this.cartonPanel.Visible = true;
    }