Пример #1
0
 private void RecordActivity(string orderNo)
 {
     ac.SaveUserActivity(new UserActivity
     {
         AppSystem     = (int)ActivityLogEnum.AppSystem.IHF,
         ApplicationId = (int)ActivityLogEnum.ApplicationID.Pack,
         EventDateTime = DateTime.Now,
         EventType     = (int)EventType.OpenforPackOrderSelection,
         ModuleId      = (int)ActivityLogEnum.ModuleID.OpenForPack,
         OrderNumber   = Convert.ToInt32(orderNo),
         UserId        = Shared.CurrentUser,
         TerminalId    = Shared.UserHostName
     });
 }
Пример #2
0
        public static string GetMessageAndLogException(Exception ex, UserActivity userActivity)
        {
            try
            {
                // Code for logging the Exception. In the Database.
                ErrorDetails errorDetails = ErrorAndMessage(ex.Message);

                ActivityLogDAO activityLog = new ActivityLogDAO();
                userActivity            = SetUserActivityObject(errorDetails, userActivity);
                userActivity.TerminalId = Shared.UserHostName;
                userActivity.UserId     = Shared.CurrentUser;
                activityLog.SaveUserActivity(userActivity);
            }
            catch (Exception e)
            {
            }

            return(GetExceptionMessage(ex));
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            if (!IsPostBack)
            {
                {
                    // on page load display this message
                    ShowMessage("Scan Chute", MessageType.NormalMessage);
                    this.step.Value = RemoveForPackClearupStep.Initial.ToString();
                }
            }
            else
            {
                _barcode = (this.Master.BarcodeValue.Length > 50) ?  this.Master.BarcodeValue.Substring(0, 50) : this.Master.BarcodeValue;

                _barcode = _barcode.ToUpper();

                if (_barcode != string.Empty)
                {
                    switch (this.step.Value)
                    {
                    // Initial - scan chute to attach to chute
                    case "Initial":
                    {
                        /* Scan Chute and attach to chute for session */
                        try
                        {
                            validatechute(_barcode);

                            //
                            // display tote service if moving on to a new order,
                            //     e.g. "STD in tote."
                            // get the next order info and display,
                            //     e.g. "Remove 5 items(s) from 107A to a small tote",
                            //     or "Remove 1 item(s) from 110C to PS1819"
                            // display "Scan Location Barcode" message
                            //
                            // if there is no order to move for this chute then return to Scan Chute message
                            //

                            decimal?ordNumber = null;

                            if (this.ordernumber.Value != string.Empty)
                            {
                                ordNumber = decimal.Parse(this.ordernumber.Value);
                            }

                            // get next order info
                            _removepackdao.nextorderandloc(decimal.Parse(this.chuteid.Value), ordNumber, ref _nextordernumber, ref _toteservice, ref _nextlocid, ref _nextlocbarcode, ref _nextloclabel, ref _nextlocitemcount, ref _totebarcodeprefix, ref _totetypename, ref _failedtoteid, ref _failedtotelabel, ref _failedtotebarcode);

                            if (_nextordernumber == 0)
                            {
                                // no order for this location - invite user to scan another chute
                                ShowMessage("No orders in this chute. Scan another chute", MessageType.NormalMessage);
                            }
                            else
                            {
                                _msgstring = string.Empty;

                                // if order has changed display the "STD in tote." message
                                if (this.ordernumber.Value != String.Empty && decimal.Parse(this.ordernumber.Value) != _nextordernumber)
                                {
                                    _msgstring = this.toteservice.Value + " in tote. ";
                                }

                                // display the remove X items from loc to tote/tote type message
                                _msgstring += "Remove " + _nextlocitemcount.ToString() + " item(s) from " + _nextloclabel + " to ";
                                if (_failedtoteid != 0)
                                {
                                    _msgstring += _failedtotelabel;
                                }
                                else
                                {
                                    _msgstring += " a " + _totetypename;
                                }

                                // new line and Scan location barcode message
                                _msgstring += "<br> Scan location barcode";

                                // assembled the string, now display it
                                this.Master.MessageBoard = _msgstring;

                                // save values we will need later -
                                this.ordernumber.Value       = _nextordernumber.ToString();
                                this.toteservice.Value       = _toteservice;
                                this.nextlocbarcode.Value    = _nextlocbarcode;
                                this.nextloclabel.Value      = _nextloclabel;
                                this.failedtotelabel.Value   = _failedtotelabel;
                                this.failedtotebarcode.Value = _failedtotebarcode;
                                this.totetypename.Value      = _totetypename;

                                // save next step
                                this.step.Value = RemoveForPackClearupStep.ScanLocation.ToString();
                            }
                        }
                        catch (Exception ex)
                        {
                            string exceptionMessage = ex.Message;
                            if (isErrorMessage(ref exceptionMessage))
                            {
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                // There aren't really messages passed back for non error conditions in this back end proc
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                        }

                        break;
                    }

                    //
                    // Validate the location - if valid invite user to scan the tote
                    //
                    case "ScanLocation":
                    {
                        try
                        {
                            if (_barcode != this.nextlocbarcode.Value)
                            {
                                // log the failure
                                _useract.AppSystem     = (int)ActivityLogEnum.AppSystem.IHF;
                                _useract.ApplicationId = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                                _useract.ModuleId      = (int)ActivityLogEnum.ModuleID.RemoveForPackClrup;
                                _useract.EventType     = (int)EventType.ScanLocation;
                                _useract.UserId        = Shared.CurrentUser;
                                _useract.OrderNumber   = int.Parse(this.ordernumber.Value);
                                _useract.Barcode       = _barcode;
                                _useract.Value1        = this.nextlocbarcode.Value;
                                _useract.ResultCode    = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;

                                _uadao.SaveUserActivity(_useract);


                                ShowMessage("Please scan correct barcode for location " + this.nextloclabel.Value, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                // log the successful scan
                                _useract.AppSystem     = (int)ActivityLogEnum.AppSystem.IHF;
                                _useract.ApplicationId = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                                _useract.ModuleId      = (int)ActivityLogEnum.ModuleID.RemoveForPackClrup;
                                _useract.EventType     = (int)EventType.ScanLocation;
                                _useract.UserId        = Shared.CurrentUser;
                                _useract.OrderNumber   = int.Parse(this.ordernumber.Value);
                                _useract.Barcode       = _barcode;
                                _useract.Value1        = this.nextlocbarcode.Value;
                                _useract.ResultCode    = (Int32)ActivityLogEnum.ResultCd.Success;

                                _uadao.SaveUserActivity(_useract);


                                String msgStr = "Scan " + this.toteservice.Value + " to ";
                                if (this.failedtotelabel.Value == string.Empty)
                                {
                                    msgStr += "a " + this.totetypename.Value + ".";
                                }
                                else
                                {
                                    msgStr += "tote " + this.failedtotelabel.Value + ".";
                                }

                                ShowMessage(msgStr, MessageType.NormalMessage);
                                // ShowMessage("Scan tote", MessageType.NormalMessage);

                                // save next step
                                this.step.Value = RemoveForPackClearupStep.ScanTote.ToString();
                            }
                        }
                        catch (Exception ex)
                        {
                            string exceptionMessage = ex.Message;
                            if (isErrorMessage(ref exceptionMessage))
                            {
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                // There aren't really messages passed back for non error conditions in this back end proc
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                        }

                        break;
                    }


                    // Scan tote - three possibilities -
                    //
                    //     1) more locations for the same order
                    //
                    //     2) a new order
                    //
                    //     3) no more orders for this chute
                    //
                    case "ScanTote":
                    {
                        try
                        {
                            // if order has already been partially moved ensure the tote entered
                            // is the same as the one it has been partially moved to
                            if (this.failedtotebarcode.Value != string.Empty && _barcode != this.failedtotebarcode.Value)
                            {
                                ShowMessage("Please scan correct barcode for tote " + this.failedtotelabel.Value, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                _removepackdao.moveincompletetotote(decimal.Parse(this.chuteid.Value), decimal.Parse(this.ordernumber.Value), this.nextlocbarcode.Value, _barcode, User.Identity.Name, string.Empty, ref _nextordernumber);

                                // no more orders - scan a new chute
                                if (_nextordernumber == 0)
                                {
                                    ShowMessage(this.toteservice.Value + " in tote. Scan chute", MessageType.NormalMessage);

                                    // save next step
                                    this.step.Value = RemoveForPackClearupStep.Initial.ToString();

                                    // clear out saved values
                                    this.chuteid.Value           = string.Empty;
                                    this.ordernumber.Value       = string.Empty;
                                    this.toteservice.Value       = string.Empty;
                                    this.nextlocbarcode.Value    = string.Empty;
                                    this.failedtotelabel.Value   = string.Empty;
                                    this.failedtotebarcode.Value = string.Empty;
                                    this.totetypename.Value      = string.Empty;
                                }
                                else
                                {
                                    _msgstring = string.Empty;

                                    // if order has changed tell user which toteservice
                                    if (decimal.Parse(this.ordernumber.Value) == _nextordernumber)
                                    {
                                        _msgstring = this.toteservice.Value + " in tote. ";
                                    }

                                    // get next location, etc. and display details
                                    // get next order info
                                    _removepackdao.nextorderandloc(decimal.Parse(this.chuteid.Value), _nextordernumber, ref _nextordernumber, ref _toteservice, ref _nextlocid, ref _nextlocbarcode, ref _nextloclabel, ref _nextlocitemcount, ref _totebarcodeprefix, ref _totetypename, ref _failedtoteid, ref _failedtotelabel, ref _failedtotebarcode);

                                    // display the remove X items from loc to tote/tote type message
                                    _msgstring += "Remove " + _nextlocitemcount.ToString() + " item(s) from " + _nextloclabel + " to ";
                                    if (_failedtoteid != 0)
                                    {
                                        _msgstring += _failedtotelabel;
                                    }
                                    else
                                    {
                                        _msgstring += " a " + _totetypename;
                                    }

                                    // new line and Scan location barcode message
                                    _msgstring += "<br> Scan location barcode";

                                    // assembled the string, now display it
                                    this.Master.MessageBoard = _msgstring;

                                    // save values we will need later -
                                    this.ordernumber.Value       = _nextordernumber.ToString();
                                    this.toteservice.Value       = _toteservice;
                                    this.nextlocbarcode.Value    = _nextlocbarcode;
                                    this.nextloclabel.Value      = _nextloclabel;
                                    this.failedtotelabel.Value   = _failedtotelabel;
                                    this.failedtotebarcode.Value = _failedtotebarcode;
                                    this.totetypename.Value      = _totetypename;

                                    // save next step
                                    this.step.Value = RemoveForPackClearupStep.ScanLocation.ToString();
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            string exceptionMessage = ex.Message;
                            if (isErrorMessage(ref exceptionMessage))
                            {
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                // There aren't really messages passed back for non error conditions in this back end proc
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                        }

                        break;
                    }
                    }
                }
            }

            this.Master.BarcodeValue = string.Empty;
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            decimal I_chute_id      = decimal.Parse(Request.QueryString["chuteID"].ToString());
            string  I_chute_barcode = Request.QueryString["chutebarcode"].ToString();
            string  I_user          = Request.QueryString["userlogon"].ToString();
            decimal I_trolley_id    = decimal.Parse(Request.QueryString["trolleyid"].ToString());
            decimal I_chute_type    = decimal.Parse(Request.QueryString["chutetype"].ToString());
            decimal I_item          = decimal.Parse(Request.QueryString["itemid"].ToString());
            string  I_sku_barcode   = Request.QueryString["skubarcode"].ToString();
            string  I_label         = Request.QueryString["locationname"].ToString();
            decimal I_chute_area    = decimal.Parse(Request.QueryString["chutearea"] == null ? "0" : Request.QueryString["chutearea"].ToString());

            //string I_terminal = this.Master.HostName;
            string I_terminal = null;


            //this.Master.MessageBoard = "location is " + I_label;

            // on page load display this message

            // split the label string

            UserActivity   setclass = new UserActivity();
            ActivityLogDAO actlog   = new ActivityLogDAO();

            string barcodetype_sku = "SKU";

            try
            {
                string[] labels = I_label.Split('.');

                List <string> labelname = new List <string>();

                foreach (string label in labels)
                {
                    labelname.Add(label);
                }



                StringBuilder sb = new StringBuilder();

                if (!String.IsNullOrEmpty(labelname[0]))
                {
                    if (!String.IsNullOrEmpty(labelname[1]))
                    {
                        sb.Append("<div>");
                        sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>");
                        sb.Append("<tr>");
                        sb.Append("<td style='font-size:20px;padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>" + labelname[0] + "</td>");
                        sb.Append("</tr>");
                        sb.Append("<tr>");
                        sb.Append("<td style='padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>" + labelname[1] + "</td>");
                        sb.Append("</tr>");
                        sb.Append("</table>");
                        sb.Append("</div>");
                    }

                    else
                    {
                        sb.Append("<div>");
                        sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>");
                        sb.Append("<tr>");
                        sb.Append("<td style='font-size:24px;padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>" + labelname[0] + "</td>");
                        sb.Append("</tr>");
                        sb.Append("</table>");
                        sb.Append("</div>");
                    }
                }


                this.Master.MessageBoard = sb.ToString();
            }
            catch (Exception ex)
            {
                // activity logging
                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                setclass.EventType           = (Int32)EventType.ScanItemForLocate;
                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.ItemvalidationFailed;
                setclass.ExpectedBarcodeType = barcodetype_sku;
                setclass.Barcode             = I_sku_barcode;
                setclass.TerminalId          = I_terminal;
                setclass.UserId     = I_user;
                setclass.ChuteId    = decimal.ToInt32(I_chute_id);
                setclass.TrolleyId  = decimal.ToInt32(I_trolley_id);
                setclass.ItemNumber = decimal.ToInt32(I_item);


                actlog.SaveUserActivity(setclass);



                this.Master.ErrorMessage   = "Error: Retrieving location name failed";
                this.Master.DisplayMessage = true;

                // redirect to scan sku ???????????
                Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&chutearea=" + I_chute_area);
            }


            if (IsPostBack)
            {
                string loc_barcode = this.Master.BarcodeValue;

                if (loc_barcode == string.Empty)
                {
                    this.Master.ErrorMessage   = "Invalid Scan. Please scan again";
                    this.Master.DisplayMessage = true;
                    this.Master.BarcodeValue   = string.Empty;
                }
                else
                {
                    if (loc_barcode.Length > 50)
                    {
                        loc_barcode = loc_barcode.Substring(0, 50);
                    }

                    LocateDAO locdao = new LocateDAO();

                    // user scans trolley location or overflow tote
                    // validate if it is a trolley location or overflow tote
                    // prevalidate the location barcode
                    string  loc_chk     = loc_barcode.Substring(0, 2).ToString();
                    string  barcode_loc = "Location";
                    decimal loc_id      = 0;

                    try
                    {
                        loc_id = locdao.PreValidateLocation(loc_barcode);
                    }
                    catch (Exception ex3)
                    {
                        // activity logging
                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.ScanLocation;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;
                        setclass.ExpectedBarcodeType = barcode_loc;
                        setclass.Barcode             = loc_barcode;
                        setclass.TerminalId          = I_terminal;
                        setclass.UserId            = I_user;
                        setclass.ChuteId           = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId         = decimal.ToInt32(I_trolley_id);
                        setclass.TrolleyLocationId = decimal.ToInt32(loc_id);
                        setclass.ItemNumber        = decimal.ToInt32(I_item);



                        actlog.SaveUserActivity(setclass);


                        this.Master.ErrorMessage   = ex3.Message.Substring(ex3.Message.IndexOf(" ", 0), (ex3.Message.IndexOf("ORA", 1) - ex3.Message.IndexOf(" ", 0)));
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }



                    if (loc_chk.ToUpper() == "LC")
                    {
                        try
                        {
                            // if it is trolley location then validate using p_valid_location
                            decimal tr_loc = locdao.Validate_Location(loc_barcode, I_item, I_user, I_terminal);


                            if (tr_loc == 0)
                            {
                                // activity logging
                                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                setclass.EventType           = (Int32)EventType.ScanLocation;
                                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;
                                setclass.ExpectedBarcodeType = barcode_loc;
                                setclass.Barcode             = loc_barcode;
                                setclass.TerminalId          = I_terminal;
                                setclass.UserId            = I_user;
                                setclass.ChuteId           = decimal.ToInt32(I_chute_id);
                                setclass.TrolleyId         = decimal.ToInt32(I_trolley_id);
                                setclass.TrolleyLocationId = decimal.ToInt32(loc_id);
                                setclass.ItemNumber        = decimal.ToInt32(I_item);

                                actlog.SaveUserActivity(setclass);


                                // if location is invalid then error

                                this.Master.ErrorMessage   = "Error: Location Validation Failed";
                                this.Master.DisplayMessage = true;
                            }
                            else
                            {
                                // else locate item using p_locate_item



                                string detached_ind = locdao.Locate_item(I_item, tr_loc, I_user, I_terminal);


                                if (!String.IsNullOrEmpty(detached_ind))
                                {
                                    if (detached_ind == "F")
                                    {
                                        // redirect to scan sku for scanning another sku or chute
                                        Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&chutearea=" + I_chute_area);
                                    }
                                    else if (detached_ind == "T")
                                    {
                                        // log off user
                                        //locdao.Log_off_Chute(I_chute_id, I_user);


                                        // activity logging
                                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                        setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.Success;
                                        setclass.ExpectedBarcodeType = "Chute";
                                        setclass.Barcode             = I_chute_barcode;
                                        setclass.TerminalId          = I_terminal;
                                        setclass.UserId             = I_user;
                                        setclass.ChuteId            = decimal.ToInt32(I_chute_id);
                                        setclass.TrolleyId          = decimal.ToInt32(I_trolley_id);
                                        setclass.TrolleyLocationId  = decimal.ToInt32(loc_id);
                                        setclass.ItemNumber         = decimal.ToInt32(I_item);
                                        setclass.SessionEndDateTime = DateTime.Now;



                                        actlog.SaveUserActivity(setclass);

                                        // locate main screen
                                        Response.Redirect("Locate.aspx?message=" + "T");
                                        //this.Master.BarcodeValue = string.Empty;
                                        //this.Master.SuccessMessage = "Trolley is successfully located and detached";
                                        //this.Master.DisplayMessage = true;
                                    }
                                }
                            }
                        }
                        catch (Exception ex2)
                        {
                            // activity logging
                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.LocateItem;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.FailedToLocate;
                            setclass.ExpectedBarcodeType = barcode_loc;
                            setclass.Barcode             = loc_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId            = I_user;
                            setclass.ChuteId           = decimal.ToInt32(I_chute_id);
                            setclass.TrolleyId         = decimal.ToInt32(I_trolley_id);
                            setclass.TrolleyLocationId = decimal.ToInt32(loc_id);
                            setclass.ItemNumber        = decimal.ToInt32(I_item);


                            actlog.SaveUserActivity(setclass);

                            this.Master.ErrorMessage   = ex2.Message.Substring(ex2.Message.IndexOf(" ", 0), (ex2.Message.IndexOf("ORA", 1) - ex2.Message.IndexOf(" ", 0)));
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }
                    }
                    else if (loc_chk.ToUpper() == "OT")
                    {
                        string barcode_ot = "Overflow Tote";
                        try
                        {
                            // if it is OT location then validate using p_valid_location
                            decimal ot_loc = locdao.Validate_Tote(loc_barcode, I_item, I_user, I_terminal);

                            if (ot_loc == 0)
                            {
                                // activity logging
                                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                setclass.EventType           = (Int32)EventType.ScanOFTForAttach;
                                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.OFTValidationFailed;
                                setclass.ExpectedBarcodeType = barcode_ot;
                                setclass.Barcode             = loc_barcode;
                                setclass.TerminalId          = I_terminal;
                                setclass.UserId            = I_user;
                                setclass.ChuteId           = decimal.ToInt32(I_chute_id);
                                setclass.TrolleyId         = decimal.ToInt32(I_trolley_id);
                                setclass.TrolleyLocationId = decimal.ToInt32(loc_id);
                                setclass.ItemNumber        = decimal.ToInt32(I_item);



                                actlog.SaveUserActivity(setclass);

                                // if location is invalid then error

                                this.Master.ErrorMessage   = "Error: While validating Overflow Tote Location Location";
                                this.Master.DisplayMessage = true;
                            }
                            else
                            {
                                // else locate item using p_locate_item
                                // debug...........
                                //this.Master.MessageBoard = "item is:" + I_item + "ot loc is:" + ot_loc + "user is:" + I_user + "trolley id is" + I_trolley_id;

                                string detached_ind = locdao.Locate_tote_item(I_item, ot_loc, I_user, I_trolley_id, I_terminal);
                                if (!String.IsNullOrEmpty(detached_ind))
                                {
                                    if (detached_ind == "F")
                                    {
                                        // redirect to scan sku for scanning another sku or chute
                                        Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&chutearea=" + I_chute_area);
                                    }
                                    else if (detached_ind == "T")
                                    {
                                        // log off user
                                        //locdao.Log_off_Chute(I_chute_id, I_user);
                                        // activity logging
                                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                        setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.Success;
                                        setclass.ExpectedBarcodeType = "Chute";
                                        setclass.Barcode             = I_chute_barcode;
                                        setclass.TerminalId          = I_terminal;
                                        setclass.UserId             = I_user;
                                        setclass.ChuteId            = decimal.ToInt32(I_chute_id);
                                        setclass.TrolleyId          = decimal.ToInt32(I_trolley_id);
                                        setclass.TrolleyLocationId  = decimal.ToInt32(loc_id);
                                        setclass.ItemNumber         = decimal.ToInt32(I_item);
                                        setclass.SessionEndDateTime = DateTime.Now;



                                        actlog.SaveUserActivity(setclass);

                                        // end of log off



                                        // locate main screen
                                        Response.Redirect("Locate.aspx?message=" + "T");
                                        //this.Master.BarcodeValue = string.Empty;
                                        //this.Master.SuccessMessage = "Trolley is successfully located and detached";
                                        //this.Master.DisplayMessage = true;
                                    }
                                }
                            }
                        }
                        catch (Exception ex1)
                        {
                            // activity logging
                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.LocateItem;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.FailedToLocateInOT;
                            setclass.ExpectedBarcodeType = barcode_ot;
                            setclass.Barcode             = loc_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId            = I_user;
                            setclass.ChuteId           = decimal.ToInt32(I_chute_id);
                            setclass.TrolleyId         = decimal.ToInt32(I_trolley_id);
                            setclass.TrolleyLocationId = decimal.ToInt32(loc_id);
                            setclass.ItemNumber        = decimal.ToInt32(I_item);


                            actlog.SaveUserActivity(setclass);


                            this.Master.ErrorMessage   = ex1.Message.Substring(ex1.Message.IndexOf(" ", 0), (ex1.Message.IndexOf("ORA", 1) - ex1.Message.IndexOf(" ", 0)));
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }
                    }
                }
            }//end of postback
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string IsManualSingle = "F";
            string chute_label    = string.Empty;

            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            decimal I_chute_id      = decimal.Parse(Request.QueryString["chuteID"].ToString());
            string  I_chute_barcode = Request.QueryString["chutebarcode"].ToString();
            string  I_user          = Request.QueryString["userlogon"].ToString();
            decimal I_trolley_id    = decimal.Parse(Request.QueryString["trolleyid"].ToString());
            decimal I_chute_type    = decimal.Parse(Request.QueryString["chutetype"].ToString());
            decimal I_chute_area    = decimal.Parse(Request.QueryString["chutearea"] == null?"0":Request.QueryString["chutearea"].ToString());


            //string I_terminal = this.Master.HostName;
            string I_terminal = null;


            UserActivity   setclass = new UserActivity();
            ActivityLogDAO actlog   = new ActivityLogDAO();

            if (!IsPostBack)
            {
                // on page load display this message
                this.Master.MessageBoard = "Scan SKU Barcode";
            }
            else
            {
                string sku_barcode = this.Master.BarcodeValue;
                if (sku_barcode == string.Empty)
                {
                    this.Master.ErrorMessage   = "Invalid Scan. Please scan again";
                    this.Master.DisplayMessage = true;
                    this.Master.BarcodeValue   = string.Empty;
                }
                else
                {
                    if (sku_barcode.Length > 50)
                    {
                        sku_barcode = sku_barcode.Substring(0, 50);
                    }

                    LocateDAO locdao = new LocateDAO();

                    decimal item_id       = 0;
                    string  location_name = null;

                    // the user can either scan a sku or another chute


                    // check if it is a chute or sku barcode

                    if (sku_barcode.Length < 2)
                    {
                        this.Master.ErrorMessage   = "Invalid Barcode";
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }
                    else
                    {
                        string chk_barcode = sku_barcode.Substring(0, 2).ToUpper();


                        if (chk_barcode.ToUpper() == "CH")
                        {
                            // user has scanned the chute

                            decimal   chute_id      = 0;
                            decimal   chute_type    = 0;
                            LocateDAO locdaoch      = new LocateDAO();
                            string    chute_barcode = sku_barcode;

                            string barcodetype_ch = "Chute";
                            try
                            {
                                // logoff user from previous session


                                /************ commented out for time being ************/
                                //locdaoch.Log_off_Chute(I_chute_id, I_user);


                                // activity logging

                                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.Success;
                                setclass.ExpectedBarcodeType = barcodetype_ch;
                                setclass.Barcode             = chute_barcode;
                                setclass.TerminalId          = I_terminal;
                                setclass.UserId  = I_user;
                                setclass.ChuteId = decimal.ToInt32(chute_id);



                                actlog.SaveUserActivity(setclass);
                                /************ commented out for time being ************/



                                // validate chute using oms_attach_trolley.p_validate_chute

                                chute_id = locdaoch.Validate_Chute(chute_barcode, I_user, I_terminal);

                                // Log user to chute using p_log_on_to_chute


                                /************ commented out for time being ************/
                                //locdaoch.Log_on_to_Chute(chute_barcode, I_user);
                                /************ commented out for time being ************/


                                // find the chute type if it is singles = 1 or multi = 2

                                chute_type = locdaoch.Get_chute_type(chute_id);

                                if (chute_type == 2)
                                {
                                    I_chute_area = locdao.Get_Chute_Area(chute_id);
                                }


                                // find the trolley attached p_chute_trolley

                                decimal trolley_id_ch = locdaoch.Chute_Trolley(chute_barcode, I_user, I_terminal);

                                if (trolley_id_ch == 0)
                                {
                                    // if the trolley id is null then ask user to scan trolley
                                    // redirect to attach trolley

                                    // no trolley attached to chute
                                    if (chute_type == 1) // singles
                                    {
                                        // redirect to scan trolley page
                                        Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + I_user + "&chutetype=" + chute_type + "&chutearea =" + I_chute_area);
                                    }
                                    else if (chute_type == 2) // multi
                                    {
                                        // redirect to scan trolley page
                                        Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + I_user + "&chutetype=" + chute_type + "&chutearea =" + I_chute_area);
                                    }
                                }
                                else
                                {
                                    // trolley is already attached
                                    if (chute_type == 1) // singles
                                    {
                                        // redirect to scan trolley page
                                        Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + I_user + "&chutetype=" + chute_type + "&chutearea =" + I_chute_area);
                                    }
                                    else if (chute_type == 2) // multi
                                    {
                                        // redirect to scan sku

                                        Response.Redirect("LocateScanSku.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + trolley_id_ch + "&chutetype=" + chute_type + "&chutearea =" + I_chute_area);
                                    }
                                    else
                                    {
                                        this.Master.ErrorMessage   = "Wrong Chute Type";
                                        this.Master.DisplayMessage = true;
                                        this.Master.BarcodeValue   = string.Empty;
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                // activity logging


                                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                setclass.EventType           = (Int32)EventType.ScanChuteForAttach;
                                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.ChuteScanFailed;
                                setclass.ExpectedBarcodeType = barcodetype_ch;
                                setclass.Barcode             = chute_barcode;
                                setclass.TerminalId          = I_terminal;
                                setclass.UserId  = I_user;
                                setclass.ChuteId = decimal.ToInt32(chute_id);


                                actlog.SaveUserActivity(setclass);


                                this.Master.ErrorMessage   = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0)));
                                this.Master.DisplayMessage = true;
                                this.Master.BarcodeValue   = string.Empty;
                            }
                        }
                        else
                        {
                            // user has scanned a SKU
                            // Validate SKU
                            // find item using p_find_chute_item
                            string barcodetype = "SKU";
                            try
                            {
                                item_id = locdao.Find_item(I_chute_id, sku_barcode, I_user, I_terminal, I_chute_area);


                                if (item_id > 0)
                                {
                                    IsManualSingle = locdao.OrderForManualArea(I_chute_area, I_chute_id, item_id);

                                    if (IsManualSingle.ToUpper() != "F")
                                    {
                                        string[] T_chute_Val;


                                        T_chute_Val = IsManualSingle.Split('-');


                                        Response.Redirect("LocateManualAreaChute.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&itemid=" + item_id + "&skubarcode=" + sku_barcode + "&chutearea=" + I_chute_area + "&tchutelabel=" + T_chute_Val[1] + "&tchuteid=" + T_chute_Val[0]);
                                    }
                                }


                                if (item_id == 0)
                                {
                                    // if item not found
                                    this.Master.ErrorMessage   = "Item not for this chute";
                                    this.Master.DisplayMessage = true;
                                    this.Master.BarcodeValue   = string.Empty;
                                    this.Master.MessageBoard   = "Please Scan the SKU Barcode";
                                }
                                else
                                {
                                    // else display trolley location using p_location_name_for_item



                                    location_name = locdao.Find_location_name(item_id);
                                    if (location_name == null)
                                    {
                                        this.Master.ErrorMessage   = "Location not found for Item";
                                        this.Master.DisplayMessage = true;

                                        this.Master.MessageBoard = "Scan SKU Barcode";
                                    }
                                    else
                                    {
                                        // display location label

                                        // redirect to scan trolley location
                                        //this.Master.MessageBoard = "location is " + location_name;
                                        Response.Redirect("LocateScanLocation.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&itemid=" + item_id + "&skubarcode=" + sku_barcode + "&locationname=" + location_name + "&chutearea=" + I_chute_area);
                                    }
                                }
                            }
                            catch (Exception ex1)
                            {
                                // activity logging
                                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                                setclass.EventType           = (Int32)EventType.ScanItemForLocate;
                                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.ItemvalidationFailed;
                                setclass.ExpectedBarcodeType = barcodetype;
                                setclass.Barcode             = sku_barcode;
                                setclass.TerminalId          = I_terminal;
                                setclass.UserId     = I_user;
                                setclass.ChuteId    = decimal.ToInt32(I_chute_id);
                                setclass.TrolleyId  = decimal.ToInt32(I_trolley_id);
                                setclass.ItemNumber = decimal.ToInt32(item_id);



                                actlog.SaveUserActivity(setclass);

                                this.Master.ErrorMessage   = ex1.Message.Substring(ex1.Message.IndexOf(" ", 0), (ex1.Message.IndexOf("ORA", 1) - ex1.Message.IndexOf(" ", 0)));
                                this.Master.DisplayMessage = true;
                                this.Master.BarcodeValue   = string.Empty;
                            }
                        } // sku
                    }     // barcode length greater than 2
                }         // barcode not empty
            }             //end of else
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            if (!IsPostBack)
            {
                {
                    // on page load display this message
                    ShowMessage("Scan Chute", MessageType.NormalMessage);
                    this.step.Value = RemoveForPackStep.Initial.ToString();
                }
            }
            else
            {
                _barcode = (this.Master.BarcodeValue.Length > 50) ?  this.Master.BarcodeValue.Substring(0, 50) : this.Master.BarcodeValue;

                if (_barcode != string.Empty)
                {
                    _barcode = _barcode.ToUpper();

                    switch (this.step.Value)
                    {
                    // Initial - scan chute to attach to chute
                    case "Initial":
                    {
                        /* Scan Chute and attach to chute  for session */
                        try
                        {
                            validatechute(_barcode);

                            string itemsInChute = "F";

                            _removepackdao.itemsinchute(decimal.Parse(this.chuteid.Value), ref itemsInChute);

                            if (itemsInChute == "F")
                            {
                                ShowMessage("No orders for this chute, please scan another chute", MessageType.NormalMessage);
                                this.step.Value = RemoveForPackStep.Initial.ToString();
                            }
                            else
                            {
                                this.Master.MessageBoard = "Scan SKU barcode";
                                this.step.Value          = RemoveForPackStep.ScanSku.ToString();
                            }
                        }
                        catch (Exception ex)
                        {
                            string exceptionMessage = ex.Message;
                            if (isErrorMessage(ref exceptionMessage))
                            {
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                            else
                            {
                                // There aren't really messages passed back for non error conditions in this back end proc
                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                            }
                        }

                        break;
                    }

                    case "ScanSku":
                    {
                        // If a chute bacode has been scanned
                        if (_barcode.Substring(0, 2) == "CH")
                        {
                            this.step.Value = RemoveForPackStep.Initial.ToString();
                            validatechute(_barcode);
                            string itemsInChute = "F";

                            _removepackdao.itemsinchute(decimal.Parse(this.chuteid.Value), ref itemsInChute);

                            if (itemsInChute == "F")
                            {
                                ShowMessage("No orders for this chute, please scan another chute", MessageType.NormalMessage);
                                this.step.Value = RemoveForPackStep.Initial.ToString();
                            }
                            else
                            {
                                this.Master.MessageBoard = "Scan SKU barcode";
                                this.step.Value          = RemoveForPackStep.ScanSku.ToString();
                            }
                        }
                        else
                        {
                            try
                            {
                                itemid.Value = _locatedao.Find_item(decimal.Parse(this.chuteid.Value), _barcode, User.Identity.Name, string.Empty, decimal.Parse(this.areaid.Value)).ToString();

                                if (decimal.Parse(itemid.Value) > 0)
                                {
                                    this.singleschutelabel.Value = string.Empty;
                                    this.singleschuteid.Value    = string.Empty;

                                    string IsManualSingle = "F";
                                    IsManualSingle = _locatedao.OrderForManualArea(decimal.Parse(this.areaid.Value), decimal.Parse(this.chuteid.Value), decimal.Parse(itemid.Value));

                                    if (IsManualSingle.ToUpper() != "F")
                                    {
                                        string[] singleschuteval;

                                        singleschuteval = IsManualSingle.Split('-');

                                        this.singleschuteid.Value    = singleschuteval[0];
                                        this.singleschutelabel.Value = singleschuteval[1];
                                        this.step.Value = RemoveForPackStep.ScanSinglesChute.ToString();

                                        string msg = "Scan " + singleschuteval[1];
                                        ShowMessage(msg, MessageType.NormalMessage);
                                    }
                                    else
                                    {
                                        try
                                        {
                                            string location_name = _locatedao.Find_location_name(decimal.Parse(itemid.Value));
                                            if (location_name == null)
                                            {
                                                ShowMessage("Location not found for Item", MessageType.ErrorConfirm);
                                                this.Master.MessageBoard = "Scan SKU Barcode";
                                            }

                                            try
                                            {
                                                // if last item then pre-warn user to remove the order
                                                decimal itemCount = 0;
                                                _removepackdao.itemsnotlocated(decimal.Parse(itemid.Value), ref itemCount);

                                                string removeOrderStr = "";

                                                if (itemCount < 2)
                                                {
                                                    removeOrderStr = ", then remove order";
                                                }

                                                string locstr = LocationMessage(location_name, removeOrderStr);

                                                // if (itemCount < 2) locstr += ", then remove order";

                                                this.step.Value = RemoveForPackStep.ScanLocation.ToString();
                                                ShowMessage(locstr, MessageType.NormalMessage);
                                            }
                                            catch
                                            {
                                                ShowMessage("Error getting location details", MessageType.ErrorConfirm);
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            string exceptionMessage = ex.Message;
                                            if (isErrorMessage(ref exceptionMessage))
                                            {
                                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                            }
                                            else
                                            {
                                                // There aren't really messages passed back for non error conditions in this back end proc
                                                ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    if (itemid.Value == "0")
                                    {
                                        // if item not found
                                        ShowMessage("Item not for this chute", MessageType.ErrorConfirm);
                                        this.Master.BarcodeValue = string.Empty;
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                string exceptionMessage = ex.Message;
                                if (isErrorMessage(ref exceptionMessage))
                                {
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                                else
                                {
                                    // There aren't really messages passed back for non error conditions in this back end proc
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                            }
                        }
                        break;
                    }

                    case "ScanLocation":
                    {
                        //This could be a overflow tote or a trolley location
                        if (_barcode.Substring(0, 2) == "LC")
                        {
                            try
                            {
                                _locationid = _locatedao.Validate_Location(_barcode, decimal.Parse(itemid.Value), User.Identity.Name, null);

                                if (_locationid == 0)
                                {
                                    ShowMessage("Location Validation Failed", MessageType.ErrorConfirm);
                                }
                            }
                            catch (Exception ex)
                            {
                                string exceptionMessage = ex.Message;
                                if (isErrorMessage(ref exceptionMessage))
                                {
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                                else
                                {
                                    // There aren't really messages passed back for non error conditions in this back end proc
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                            }
                        }
                        else if (_barcode.Substring(0, 2) == "OT")
                        {
                            try
                            {
                                _overflowtoteid = _locatedao.Validate_Tote(_barcode, decimal.Parse(itemid.Value), User.Identity.Name, null);

                                if (_overflowtoteid == 0)
                                {
                                    ShowMessage("Overflow Tote Validation Failed", MessageType.ErrorConfirm);
                                }
                            }
                            catch (Exception ex)
                            {
                                string exceptionMessage = ex.Message;
                                if (isErrorMessage(ref exceptionMessage))
                                {
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                                else
                                {
                                    // There aren't really messages passed back for non error conditions in this back end proc
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                            }
                        }
                        else
                        {
                            ShowMessage("Invalid location or overflow tote barcode", MessageType.ErrorConfirm);
                            this.Master.BarcodeValue = string.Empty;
                        }

                        if (_locationid > 0 || _overflowtoteid > 0)
                        {
                            string  fullyLocatedInd   = "F";
                            decimal ordernumber       = 0;
                            decimal ordervolume       = 0;
                            string  toteService       = string.Empty;
                            string  toteBarcodePrefix = string.Empty;
                            string  toteTypeName      = string.Empty;
                            decimal currLocId         = 0;
                            string  currLocBarcode    = string.Empty;
                            string  currLocLabel      = string.Empty;
                            decimal numItems          = 0;


                            try
                            {
                                _removepackdao.locateitem(decimal.Parse(itemid.Value),
                                                          _locationid, _overflowtoteid,
                                                          decimal.Parse(this.trolleyid.Value),
                                                          User.Identity.Name, null, ref ordernumber,
                                                          ref fullyLocatedInd, ref ordervolume, ref toteService,
                                                          ref toteBarcodePrefix, ref toteTypeName, ref currLocId,
                                                          ref currLocBarcode, ref currLocLabel, ref numItems);

                                if (fullyLocatedInd == "T")
                                {
                                    this.Master.MessageBoard = "<embed id='snd' src='" + ConfigurationManager.AppSettings["SuccessSound"] + "' autostart='true' hidden='true'></embed>" +
                                                               "Remove " + numItems.ToString() + " item(s) from " + currLocLabel + " to a " + toteTypeName +
                                                               "<br />Scan location barcode";
                                    this.step.Value = RemoveForPackStep.ReScanLocation.ToString();

                                    this.locationbarcode.Value = currLocBarcode;
                                    this.totetype.Value        = toteTypeName;
                                    this.toteservice.Value     = toteService;
                                }
                                else
                                {
                                    this.step.Value = RemoveForPackStep.ScanSku.ToString();
                                    ShowMessage("Scan SKU barcode", MessageType.NormalMessage);
                                }
                            }
                            catch (Exception ex)
                            {
                                string exceptionMessage = ex.Message;
                                if (isErrorMessage(ref exceptionMessage))
                                {
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                                else
                                {
                                    // There aren't really messages passed back for non error conditions in this back end proc
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                            }
                        }

                        break;
                    }

                    case "ReScanLocation":
                    {
                        if (_barcode == this.locationbarcode.Value)
                        {
                            // log the activity - success
                            _useract.AppSystem     = (int)ActivityLogEnum.AppSystem.IHF;
                            _useract.ApplicationId = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                            _useract.ModuleId      = (int)ActivityLogEnum.ModuleID.RemoveForPack;
                            _useract.EventType     = (int)EventType.RescanLocation;
                            _useract.UserId        = Shared.CurrentUser;
                            _useract.Barcode       = _barcode;
                            _useract.Value1        = this.locationbarcode.Value;
                            _useract.ResultCode    = (Int32)ActivityLogEnum.ResultCd.Success;

                            _uadao.SaveUserActivity(_useract);

                            // set step and show message
                            this.step.Value = RemoveForPackStep.ScanTote.ToString();

                            String msgStr = "Scan " + this.toteservice.Value + " to ";
                            if (this.totelabel.Value == string.Empty)
                            {
                                msgStr += "a " + this.totetype.Value + ".";
                            }
                            else
                            {
                                msgStr += "tote " + this.totelabel.Value + ".";
                            }

                            ShowMessage(msgStr, MessageType.NormalMessage);
                        }
                        else
                        {
                            // log the activity - failure
                            _useract.AppSystem     = (int)ActivityLogEnum.AppSystem.IHF;
                            _useract.ApplicationId = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                            _useract.ModuleId      = (int)ActivityLogEnum.ModuleID.RemoveForPack;
                            _useract.EventType     = (int)EventType.RescanLocation;
                            _useract.UserId        = Shared.CurrentUser;
                            _useract.Barcode       = _barcode;
                            _useract.Value1        = this.locationbarcode.Value;
                            _useract.ResultCode    = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;

                            _uadao.SaveUserActivity(_useract);


                            // show the error message
                            ShowMessage("Incorrect Location", MessageType.ErrorConfirm);
                        }
                        break;
                    }

                    case "ScanTote":
                    {
                        if (this.totebarcode.Value != string.Empty && this.totebarcode.Value != _barcode)
                        {
                            ShowMessage("Scan to tote: " + this.totelabel.Value, MessageType.ErrorConfirm);
                        }
                        else
                        {
                            decimal nextlocid      = 0;
                            string  nextlocbarcode = string.Empty;
                            string  nextloclabel   = string.Empty;
                            decimal itemcount      = 0;
                            string  totelabel      = string.Empty;

                            try
                            {
                                _removepackdao.movetotote(locationbarcode.Value, _barcode, User.Identity.Name, null, ref nextlocid, ref nextlocbarcode, ref nextloclabel, ref totelabel, ref itemcount);

                                if (nextlocid == 0)
                                {
                                    // no more items for this order
                                    // need to see if there are any more orders left in this chute

                                    string msg          = this.toteservice.Value + " in tote";
                                    string itemsInChute = "F";

                                    _removepackdao.itemsinchute(decimal.Parse(this.chuteid.Value), ref itemsInChute);

                                    if (itemsInChute == "F")
                                    {
                                        msg            += ". No more orders in this chute, please scan another chute";
                                        this.step.Value = RemoveForPackStep.Initial.ToString();
                                    }
                                    else
                                    {
                                        msg            += ", scan next item for locate";
                                        this.step.Value = RemoveForPackStep.ScanSku.ToString();
                                    }

                                    ShowMessage(msg, MessageType.NormalMessage);

                                    // ShowMessage(this.toteservice.Value + " in tote, scan next item for locate", MessageType.NormalMessage);
                                    this.totebarcode.Value = string.Empty;
                                    this.totelabel.Value   = string.Empty;
                                    // this.step.Value = RemoveForPackStep.ScanSku.ToString();
                                }
                                else
                                {
                                    ShowMessage("Remove " + itemcount.ToString() + " item(s) from " + nextloclabel + " to " + totelabel + "<br />Scan location barcode", MessageType.NormalMessage);
                                    this.totebarcode.Value     = _barcode;
                                    this.totelabel.Value       = totelabel;
                                    this.locationbarcode.Value = nextlocbarcode;
                                    this.step.Value            = RemoveForPackStep.ReScanLocation.ToString();
                                }
                            }
                            catch (Exception ex)
                            {
                                string exceptionMessage = ex.Message;
                                if (isErrorMessage(ref exceptionMessage))
                                {
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                                else
                                {
                                    // There aren't really messages passed back for non error conditions in this back end proc
                                    ShowMessage(exceptionMessage, MessageType.ErrorConfirm);
                                }
                            }
                        }
                        break;
                    }

                    case "ScanSinglesChute":
                    {
                        string  singleschutelabel = this.singleschutelabel.Value;
                        decimal singleschuteid    = decimal.Parse(this.singleschuteid.Value);

                        if (_barcode == string.Empty)
                        {
                            ShowMessage("Invalid scan. Please scan again.", MessageType.ErrorConfirm);
                            this.Master.MessageBoard = "Scan " + singleschutelabel;
                        }
                        else
                        {
                            LocateDAO locadao = new LocateDAO();

                            // check if scanned chute is the same as the one passed in

                            decimal scannedchuteid = 0;

                            try
                            {
                                scannedchuteid = locadao.PreValidateChute(_barcode);
                            }
                            catch (Exception ex)
                            {
                                // activity logging
                                _useract.AppSystem           = (int)ActivityLogEnum.AppSystem.IHF;
                                _useract.ApplicationId       = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                                _useract.ModuleId            = (int)ActivityLogEnum.ModuleID.RemoveForPack;
                                _useract.EventType           = (int)EventType.ScanLocation;
                                _useract.ResultCode          = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;
                                _useract.ExpectedBarcodeType = "Chute barcode";
                                _useract.Barcode             = _barcode;
                                _useract.UserId     = Shared.CurrentUser;
                                _useract.ChuteId    = (int)singleschuteid;
                                _useract.ItemNumber = Int32.Parse(this.itemid.Value);

                                _uadao.SaveUserActivity(_useract);


                                // display error
                                string msg = ex.Message.Substring(ex.Message.IndexOf(" ", 0), ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0));
                                ShowMessage(msg, MessageType.ErrorConfirm);
                                this.Master.BarcodeValue = string.Empty;
                            }

                            if (scannedchuteid != 0)
                            {
                                if (scannedchuteid == singleschuteid)
                                {
                                    // chute id is correct - move on to next SKU
                                    this.step.Value = RemoveForPackStep.ScanSku.ToString();
                                    ShowMessage("Scan SKU barcode", MessageType.NormalMessage);
                                    this.singleschutelabel.Value = string.Empty;
                                    this.singleschuteid.Value    = string.Empty;
                                }
                                else
                                {
                                    ShowMessage("Invalid scan. Please scan again.", MessageType.ErrorConfirm);

                                    // activity logging
                                    _useract.AppSystem           = (int)ActivityLogEnum.AppSystem.IHF;
                                    _useract.ApplicationId       = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                                    _useract.ModuleId            = (int)ActivityLogEnum.ModuleID.RemoveForPack;
                                    _useract.EventType           = (int)EventType.LogOffChuteForLocate;
                                    _useract.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                                    _useract.ExpectedBarcodeType = "Chute";
                                    _useract.Barcode             = _barcode;
                                    _useract.UserId             = Shared.CurrentUser;
                                    _useract.ChuteId            = (int)singleschuteid;
                                    _useract.ItemNumber         = Int32.Parse(this.itemid.Value);
                                    _useract.SessionEndDateTime = DateTime.Now;

                                    _uadao.SaveUserActivity(_useract);
                                }
                            }
                            else
                            {
                                ShowMessage("Invalid scan. Please scan again.", MessageType.ErrorConfirm);

                                // activity logging
                                _useract.AppSystem           = (int)ActivityLogEnum.AppSystem.IHF;
                                _useract.ApplicationId       = (int)ActivityLogEnum.ApplicationID.RemoveForPack;
                                _useract.ModuleId            = (int)ActivityLogEnum.ModuleID.RemoveForPack;
                                _useract.EventType           = (int)EventType.LogOffChuteForLocate;
                                _useract.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                                _useract.ExpectedBarcodeType = "Chute";
                                _useract.Barcode             = _barcode;
                                _useract.UserId             = Shared.CurrentUser;
                                _useract.ChuteId            = (int)singleschuteid;
                                _useract.ItemNumber         = Int32.Parse(this.itemid.Value);
                                _useract.SessionEndDateTime = DateTime.Now;

                                _uadao.SaveUserActivity(_useract);
                            }
                        }
                        break;
                    }
                    }
                }
            }
            this.Master.BarcodeValue = string.Empty;
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;
            string I_message = null;

            if (Request.QueryString["message"] != null)
            {
                I_message = Request.QueryString["message"].ToString();
            }



            string user_logon = User.Identity.Name;

            //string I_terminal = this.Master.HostName; //Shared.UserHostName;

            string I_terminal = null;

            string barcodetype = "Chute";

            UserActivity   setclass = new UserActivity();
            ActivityLogDAO actlog   = new ActivityLogDAO();

            if (!IsPostBack)
            {
                if (I_message == "T") // message exists
                {
                    this.Master.MessageBoard = "Trolley is successfully located and detached. Scan next Chute for Locate";
                }
                else
                {
                    // on page load display this message
                    this.Master.MessageBoard = "Scan Chute for Locate";
                }
            }
            else
            {
                string chute_barcode = this.Master.BarcodeValue;

                if (chute_barcode != string.Empty)
                {
                    if (chute_barcode.Length > 50)
                    {
                        chute_barcode = chute_barcode.Substring(0, 50);
                    }
                }

                decimal chute_id   = 0;
                decimal chute_type = 0;
                decimal chute_area = 0;

                LocateDAO locdao = new LocateDAO();


                try
                {
                    // validate chute using oms_attach_trolley.p_validate_chute

                    chute_id = locdao.Validate_Chute(chute_barcode, user_logon, I_terminal);


                    // find the chute type if it is singles = 1 or multi = 2

                    chute_type = locdao.Get_chute_type(chute_id);


                    if (chute_type == 2)
                    {
                        chute_area = locdao.Get_Chute_Area(chute_id);
                    }
                }
                catch (Exception ex)
                {
                    // activity logging


                    setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                    setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                    setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                    setclass.EventType           = (Int32)EventType.ScanChuteForAttach;
                    setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.ChuteScanFailed;
                    setclass.ExpectedBarcodeType = barcodetype;
                    setclass.Barcode             = chute_barcode;
                    setclass.TerminalId          = I_terminal;
                    setclass.UserId  = user_logon;
                    setclass.ChuteId = decimal.ToInt32(chute_id);



                    actlog.SaveUserActivity(setclass);



                    //this.Master.MessageBoard = chute_id.ToString();
                    this.Master.ErrorMessage   = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0)));
                    this.Master.DisplayMessage = true;
                    this.Master.BarcodeValue   = string.Empty;
                }


                try
                {
                    // find the trolley attached p_chute_trolley



                    decimal trolley_id = locdao.Chute_Trolley(chute_barcode, user_logon, I_terminal);
                    if (trolley_id == 0)
                    {
                        // if the trolley id is null then ask user to scan trolley
                        // redirect to attach trolley

                        // no trolley attached to chute
                        if (chute_type == 1) // singles
                        {
                            // redirect to scan trolley page
                            Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + user_logon + "&chutetype=" + chute_type + "&chutearea=" + chute_area);
                        }
                        else if (chute_type == 2) // multi
                        {
                            // redirect to scan trolley page
                            Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + user_logon + "&chutetype=" + chute_type + "&chutearea=" + chute_area);
                        }

                        else
                        {
                            // activity logging


                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.LogOnChuteForLocate;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                            setclass.ExpectedBarcodeType = barcodetype;
                            setclass.Barcode             = chute_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId  = user_logon;
                            setclass.ChuteId = decimal.ToInt32(chute_id);



                            actlog.SaveUserActivity(setclass);


                            // end of activity logging

                            this.Master.ErrorMessage   = "Please enter either Chute Type: Single or Chute Type: Multi";
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }
                    }
                    else
                    {
                        // trolley is already attached
                        if (chute_type == 1) // singles
                        {
                            // redirect to scan trolley page
                            Response.Redirect("LocateTrolleyAttach.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + user_logon + "&chutetype=" + chute_type + "&chutearea=" + chute_area);
                        }
                        else if (chute_type == 2) // multi
                        {
                            // redirect to scan sku
                            // Log user to chute using p_log_on_to_chute



                            // ************ commented out for time being ************ /
                            //locdao.Log_on_to_Chute(chute_barcode, user_logon);
                            // ************ commented out for time being ************ /


                            Response.Redirect("LocateScanSku.aspx?chuteID=" + chute_id + "&chutebarcode=" + chute_barcode + "&userlogon=" + user_logon + "&trolleyid=" + trolley_id + "&chutetype=" + chute_type + "&chutearea=" + chute_area);
                        }
                        else
                        {
                            // activity logging


                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.LogOnChuteForLocate;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                            setclass.ExpectedBarcodeType = barcodetype;
                            setclass.Barcode             = chute_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId  = user_logon;
                            setclass.ChuteId = decimal.ToInt32(chute_id);



                            actlog.SaveUserActivity(setclass);



                            // end of activity logging

                            this.Master.ErrorMessage   = "Please enter either Chute Type: Single or Chute Type: Multi";
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }
                    }
                }
                catch (Exception ex1)
                {
                    // activity logging


                    setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                    setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                    setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                    setclass.EventType           = (Int32)EventType.LogOnChuteForLocate;
                    setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.LogonFailed;
                    setclass.ExpectedBarcodeType = barcodetype;
                    setclass.Barcode             = chute_barcode;
                    setclass.TerminalId          = I_terminal;
                    setclass.UserId  = user_logon;
                    setclass.ChuteId = decimal.ToInt32(chute_id);



                    actlog.SaveUserActivity(setclass);



                    // end of activity logging

                    this.Master.ErrorMessage   = ex1.Message.Substring(ex1.Message.IndexOf(" ", 0), (ex1.Message.IndexOf("ORA", 1) - ex1.Message.IndexOf(" ", 0)));
                    this.Master.DisplayMessage = true;
                    this.Master.BarcodeValue   = string.Empty;
                }
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            decimal I_chute_id      = decimal.Parse(Request.QueryString["chuteID"].ToString());
            string  I_chute_barcode = Request.QueryString["chutebarcode"].ToString();
            string  I_user          = Request.QueryString["userlogon"].ToString();
            decimal I_trolley_id    = decimal.Parse(Request.QueryString["trolleyid"].ToString());
            decimal I_chute_type    = decimal.Parse(Request.QueryString["chutetype"].ToString());
            decimal I_item          = decimal.Parse(Request.QueryString["itemid"].ToString());
            string  I_sku_barcode   = Request.QueryString["skubarcode"].ToString();
            string  I_chute_area    = Request.QueryString["chutearea"].ToString();
            string  I_T_chute_label = Request.QueryString["tchutelabel"].ToString();
            decimal I_T_chute_id    = decimal.Parse(Request.QueryString["tchuteid"].ToString());


            UserActivity   setclass = new UserActivity();
            ActivityLogDAO actlog   = new ActivityLogDAO();

            string barcodetype_sku = "Chute";

            try
            {
                StringBuilder sb = new StringBuilder();

                if (!String.IsNullOrEmpty(I_T_chute_label))
                {
                    sb.Append("<div>");
                    sb.Append("<table width='100%' cellspacing='0px' cellpadding='0px' style='border-width:1px;border-collapse:collapse; border-style:solid;border-color:White;'>");
                    sb.Append("<tr>");
                    sb.Append("<td style='font-size:24px;padding-left:2px;border-width:2px;border-style:solid;border-color:White;'>" + I_T_chute_label + "</td>");
                    sb.Append("</tr>");
                    sb.Append("</table>");
                    sb.Append("</div>");
                }


                this.Master.MessageBoard = sb.ToString();
            }
            catch (Exception ex)
            {
                // activity logging
                setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                setclass.EventType           = (Int32)EventType.ScanItemForLocate;
                setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.ItemvalidationFailed;
                setclass.ExpectedBarcodeType = barcodetype_sku;
                setclass.Barcode             = I_sku_barcode;
                setclass.UserId     = I_user;
                setclass.ChuteId    = decimal.ToInt32(I_chute_id);
                setclass.TrolleyId  = decimal.ToInt32(I_trolley_id);
                setclass.ItemNumber = decimal.ToInt32(I_item);


                actlog.SaveUserActivity(setclass);



                this.Master.ErrorMessage   = "Error: Retrieving Chute label";
                this.Master.DisplayMessage = true;

                Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&chutearea=" + I_chute_area);
            }


            if (IsPostBack)
            {
                string loc_barcode = this.Master.BarcodeValue;

                if (loc_barcode == string.Empty)
                {
                    this.Master.ErrorMessage   = "Invalid Scan. Please scan again";
                    this.Master.DisplayMessage = true;
                    this.Master.BarcodeValue   = string.Empty;
                }
                else
                {
                    if (loc_barcode.Length > 50)
                    {
                        loc_barcode = loc_barcode.Substring(0, 50);
                    }

                    LocateDAO locdao = new LocateDAO();


                    //  Check if the scan chute id similar to target chute id.
                    decimal chute_id = 0;

                    try
                    {
                        chute_id = locdao.PreValidateChute(loc_barcode);
                    }
                    catch (Exception ex3)
                    {
                        // activity logging
                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.ScanLocation;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.LocationValidationFailed;
                        setclass.ExpectedBarcodeType = "Chute barcode";
                        setclass.Barcode             = loc_barcode;
                        setclass.UserId     = I_user;
                        setclass.ChuteId    = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId  = decimal.ToInt32(I_trolley_id);
                        setclass.ItemNumber = decimal.ToInt32(I_item);

                        actlog.SaveUserActivity(setclass);


                        this.Master.ErrorMessage   = ex3.Message.Substring(ex3.Message.IndexOf(" ", 0), (ex3.Message.IndexOf("ORA", 1) - ex3.Message.IndexOf(" ", 0)));
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }



                    if (chute_id != 0)
                    {
                        if (chute_id == I_T_chute_id)
                        {
                            // redirect to scan sku for scanning another sku or chute
                            Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + I_trolley_id + "&chutetype=" + I_chute_type + "&chutearea=" + I_chute_area);
                        }
                        else
                        {
                            this.Master.ErrorMessage   = "Invalid Chute. Please scan again";
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;

                            // activity logging
                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                            setclass.ExpectedBarcodeType = "Chute";
                            setclass.Barcode             = I_chute_barcode;
                            setclass.UserId             = I_user;
                            setclass.ChuteId            = decimal.ToInt32(I_chute_id);
                            setclass.TrolleyId          = decimal.ToInt32(I_trolley_id);
                            setclass.ItemNumber         = decimal.ToInt32(I_item);
                            setclass.SessionEndDateTime = DateTime.Now;



                            actlog.SaveUserActivity(setclass);
                        }
                    }

                    else
                    {
                        this.Master.ErrorMessage   = "Invalid Chute. Please scan again";
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;



                        // activity logging
                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.InvalidChuteType;
                        setclass.ExpectedBarcodeType = "Chute";
                        setclass.Barcode             = I_chute_barcode;
                        setclass.UserId             = I_user;
                        setclass.ChuteId            = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId          = decimal.ToInt32(I_trolley_id);
                        setclass.ItemNumber         = decimal.ToInt32(I_item);
                        setclass.SessionEndDateTime = DateTime.Now;



                        actlog.SaveUserActivity(setclass);
                    }
                }
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Reset();

            this.Master.RegisterStandardScript = true;

            decimal I_chute_id      = decimal.Parse(Request.QueryString["chuteID"].ToString());
            string  I_chute_barcode = Request.QueryString["chutebarcode"].ToString();
            string  I_user          = Request.QueryString["userlogon"].ToString();
            decimal I_chute_type    = decimal.Parse(Request.QueryString["chutetype"].ToString());
            //Default area to sorter when not passed.
            decimal I_chute_area = decimal.Parse(Request.QueryString["chutearea"] == null? "1" : Request.QueryString["chutearea"].ToString());

            //string I_terminal = this.Master.HostName;
            string I_terminal = null;

            string barcodetype = "Trolley";

            UserActivity   setclass = new UserActivity();
            ActivityLogDAO actlog   = new ActivityLogDAO();

            if (!IsPostBack)
            {
                // on page load display this message
                this.Master.MessageBoard = "Scan Trolley Barcode for Attach";
            }
            else
            {
                string trolley_barcode = this.Master.BarcodeValue;

                if (trolley_barcode != string.Empty)
                {
                    if (trolley_barcode.Length > 50)
                    {
                        trolley_barcode = trolley_barcode.Substring(0, 50);
                    }
                }

                LocateDAO locdao = new LocateDAO();

                //decimal trolley_id = 0;

                // check if the chute is singles or multi
                if (I_chute_type == 1) // singles
                {
                    decimal trolley_id_singles = 0;
                    // validate the trolley barcode using oms_attach_trolley.p_validate_trolley

                    try
                    {
                        trolley_id_singles = locdao.Validate_Trolley(I_chute_id, trolley_barcode, I_user, I_terminal);
                    }
                    catch (Exception ex1)
                    {
                        // activity logging
                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.ScanTrolleyForAttach;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.TrolleyScanFailed;
                        setclass.ExpectedBarcodeType = barcodetype;
                        setclass.Barcode             = trolley_barcode;
                        setclass.TerminalId          = I_terminal;
                        setclass.UserId    = I_user;
                        setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId = decimal.ToInt32(trolley_id_singles);


                        actlog.SaveUserActivity(setclass);

                        this.Master.ErrorMessage   = ex1.Message.Substring(ex1.Message.IndexOf(" ", 0), (ex1.Message.IndexOf("ORA", 1) - ex1.Message.IndexOf(" ", 0)));
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }
                    // attach the trolley
                    try
                    {
                        // if no errors then attach trolley to chute using oms_attach_trolley.p_attach_trolley_to_chute
                        locdao.Attach_Trolley(I_chute_id, trolley_id_singles, I_user, I_terminal);

                        // Log user to chute using p_log_on_to_chute

                        /************ commented out for time being ************/
                        //locdao.Log_on_to_Chute(I_chute_barcode, I_user);
                        /************ commented out for time being ************/



                        // trolley attach success for singles

                        // log off user from locating session


                        /************ commented out for time being ************/
                        //locdao.Log_off_Chute(I_chute_id, I_user);


                        // activity logging
                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.LogOffChuteForLocate;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.Success;
                        setclass.ExpectedBarcodeType = barcodetype;
                        setclass.Barcode             = trolley_barcode;
                        setclass.TerminalId          = I_terminal;
                        setclass.UserId    = I_user;
                        setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId = decimal.ToInt32(trolley_id_singles);


                        actlog.SaveUserActivity(setclass);

                        /************ commented out for time being ************/

                        // redirect to main page of locate to scan another chute

                        Response.Redirect("Locate.aspx");
                    }
                    catch (Exception ex)
                    {
                        // activity logging

                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.TrolleyAttachLocate;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.FailedToAttach;
                        setclass.ExpectedBarcodeType = barcodetype;
                        setclass.Barcode             = trolley_barcode;
                        setclass.TerminalId          = I_terminal;
                        setclass.UserId    = I_user;
                        setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId = decimal.ToInt32(trolley_id_singles);



                        actlog.SaveUserActivity(setclass);

                        this.Master.ErrorMessage   = ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0)));
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }
                }// chute type is 1

                else if (I_chute_type == 2) // multi
                {
                    // check if chute is attached to a trolley
                    decimal chutes_trolley_id = 0;
                    try
                    {
                        chutes_trolley_id = locdao.Chute_Trolley(I_chute_barcode, I_user, I_terminal);
                    }
                    catch (Exception xx1)
                    {
                        // activity logging

                        setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                        setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                        setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                        setclass.EventType           = (Int32)EventType.TrolleyAttachLocate;
                        setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.FailedToAttach;
                        setclass.ExpectedBarcodeType = barcodetype;
                        setclass.Barcode             = trolley_barcode;
                        setclass.TerminalId          = I_terminal;
                        setclass.UserId    = I_user;
                        setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                        setclass.TrolleyId = decimal.ToInt32(chutes_trolley_id);



                        actlog.SaveUserActivity(setclass);

                        this.Master.ErrorMessage   = xx1.Message.Substring(xx1.Message.IndexOf(" ", 0), (xx1.Message.IndexOf("ORA", 1) - xx1.Message.IndexOf(" ", 0)));
                        this.Master.DisplayMessage = true;
                        this.Master.BarcodeValue   = string.Empty;
                    }

                    // if no trolley is attached

                    if (chutes_trolley_id == 0)
                    {
                        // validate the trolley barcode using oms_attach_trolley.p_validate_trolley
                        decimal trolley_id_new = 0;

                        try
                        {
                            trolley_id_new = locdao.Validate_Trolley(I_chute_id, trolley_barcode, I_user, I_terminal);
                        }
                        catch (Exception xx2)
                        {
                            // activity logging
                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.ScanTrolleyForAttach;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.TrolleyScanFailed;
                            setclass.ExpectedBarcodeType = barcodetype;
                            setclass.Barcode             = trolley_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId    = I_user;
                            setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                            setclass.TrolleyId = decimal.ToInt32(trolley_id_new);


                            actlog.SaveUserActivity(setclass);

                            this.Master.ErrorMessage   = xx2.Message.Substring(xx2.Message.IndexOf(" ", 0), (xx2.Message.IndexOf("ORA", 1) - xx2.Message.IndexOf(" ", 0)));
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }

                        // attach trolley

                        try
                        {
                            // if no errors then attach trolley to chute using oms_attach_trolley.p_attach_trolley_to_chute
                            locdao.Attach_Trolley(I_chute_id, trolley_id_new, I_user, I_terminal);

                            // Log user to chute using p_log_on_to_chute

                            /************ commented out for time being ************/
                            //locdao.Log_on_to_Chute(I_chute_barcode, I_user);
                            /************ commented out for time being ************/

                            // redirect to scan sku

                            Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + trolley_id_new + "&chutetype=" + I_chute_type + "&chutearea =" + I_chute_area);
                        }

                        catch (Exception xx3)
                        {
                            // activity logging

                            setclass.AppSystem           = (Int32)ActivityLogEnum.AppSystem.IHF;
                            setclass.ApplicationId       = (Int32)ActivityLogEnum.ApplicationID.AttachAndLocate;
                            setclass.ModuleId            = (Int32)ActivityLogEnum.ModuleID.AttachAndlocate;
                            setclass.EventType           = (Int32)EventType.TrolleyAttachLocate;
                            setclass.ResultCode          = (Int32)ActivityLogEnum.ResultCd.FailedToAttach;
                            setclass.ExpectedBarcodeType = barcodetype;
                            setclass.Barcode             = trolley_barcode;
                            setclass.TerminalId          = I_terminal;
                            setclass.UserId    = I_user;
                            setclass.ChuteId   = decimal.ToInt32(I_chute_id);
                            setclass.TrolleyId = decimal.ToInt32(trolley_id_new);



                            actlog.SaveUserActivity(setclass);

                            this.Master.ErrorMessage   = xx3.Message.Substring(xx3.Message.IndexOf(" ", 0), (xx3.Message.IndexOf("ORA", 1) - xx3.Message.IndexOf(" ", 0)));
                            this.Master.DisplayMessage = true;
                            this.Master.BarcodeValue   = string.Empty;
                        }
                    }

                    else // another trolley is attached
                    {
                        // redirect to scan sku

                        Response.Redirect("LocateScanSku.aspx?chuteID=" + I_chute_id + "&chutebarcode=" + I_chute_barcode + "&userlogon=" + I_user + "&trolleyid=" + chutes_trolley_id + "&chutetype=" + I_chute_type + "&chutearea =" + I_chute_area);
                    }
                } // chute type is 2
            }     // end of post back
        }
Пример #10
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            LoadReleaseDAO loadmgr = new LoadReleaseDAO();

            string displayname = User.Identity.Name;
            Int32  area_id;
            Int32  action_ind;

            if (IsValidAreaSelected())
            {
                foreach (GridItem item in grdLoadRelease.MasterTableView.Items)
                {
                    if (item is GridEditableItem)
                    {
                        GridEditableItem editableItem = item as GridDataItem;
                        CheckBox         chlabel      = (CheckBox)editableItem.FindControl("SelectRow");
                        UserActivity     setclass     = new UserActivity();
                        ActivityLogDAO   actlog       = new ActivityLogDAO();

                        if (chlabel.Checked)
                        {
                            string loadid = editableItem.OwnerTableView.DataKeyValues[item.ItemIndex]["pick_load_num"].ToString();

                            string singleOrder = editableItem.OwnerTableView.DataKeyValues[item.ItemIndex]["tot_single_orders"].ToString();

                            string multiOrders = editableItem.OwnerTableView.DataKeyValues[item.ItemIndex]["tot_multi_orders"].ToString();


                            RadComboBox areaid    = (RadComboBox)editableItem.FindControl("releaseTo");
                            RadComboBox actionind = (RadComboBox)editableItem.FindControl("release_action");



                            area_id    = Int32.Parse(areaid.SelectedValue);
                            action_ind = Int32.Parse(actionind.SelectedValue);


                            try
                            {
                                decimal resultCode = loadmgr.Update_Load(
                                    loadid,
                                    area_id,
                                    action_ind,
                                    int.Parse(string.IsNullOrEmpty(singleOrder) ? "0" : singleOrder),
                                    int.Parse(string.IsNullOrEmpty(multiOrders) ? "0" : multiOrders),
                                    displayname);



                                if (resultCode == -1)
                                {
                                    HandleError("Load Release Failed for split load", 1);
                                }
                                else if (resultCode == -2)
                                {
                                    HandleError("Area selected for Load Release/Unrelease is disabled", 1);
                                }
                                else if (resultCode == -3)
                                {
                                    HandleError("Area does not accept store orders", 1);
                                }
                                else
                                {
                                    HandleError("Load(s) Updated", 0);
                                }
                            }
                            catch (Exception ex)
                            {
                                // activity logging
                                setclass.AppSystem     = (Int32)ActivityLogEnum.AppSystem.IHF;
                                setclass.ApplicationId = (Int32)ActivityLogEnum.ApplicationID.ManualSort;
                                setclass.ModuleId      = (Int32)ActivityLogEnum.ModuleID.MSLoadRelease;
                                setclass.EventType     = (Int32)EventType.ManualSortLoadRelease;
                                setclass.ResultCode    = (Int32)ActivityLogEnum.ResultCd.MSLoadReleaseFailed;
                                setclass.EventDateTime = DateTime.Now;
                                setclass.SortLoadId    = loadid;
                                setclass.Value1        = action_ind.ToString();
                                setclass.Value2        = area_id.ToString();
                                setclass.UserId        = displayname;


                                actlog.SaveUserActivity(setclass);


                                HandleError(CleanErrorMessage(ex.Message), 1);
                            }
                        }
                    }
                }
            }
            else
            {
                HandleError("Please select valid area to release the load.", 1);
            }

            //grdLoadRelease.Rebind();
            string load_status_cd = loadStatus.SelectedItem.Value;

            if (load_status_cd != string.Empty)
            {
                load_status = Int32.Parse(load_status_cd);
            }



            this.BindData(load_status);
            grdLoadRelease.Rebind();
        }