Example #1
0
        /// <summary>
        /// Converts a TicketTag to a EF TicketCount Enttity
        /// </summary>
        /// <param name="_tag"></param>
        /// <returns></returns>
        private TicketCount Tag2Entity(TicketTag _tag)
        {
            TicketCount T  = new TicketCount();
            Ticket      _T = new Ticket();

            T.Ticket = _T;

            T.Ticket.TicketCounter = _tag.Counter;
            T.ItemNumber           = _tag.ItemNumber;
            T.ItemDescription      = _tag.ItemDescription;
            T.ItemRef      = _tag.ItemReference1;
            T.UM           = _tag.ItemUM;
            T.BIN          = _tag.Bin;
            T.STK          = _tag.Stockroom;
            T.IC           = _tag.InventoryCategory;
            T.InventoryQty = _tag.InventoryQuantity;
            T.LotNumber    = _tag.LotNumber;

            T.CountQty        = _tag.CountQTY;
            T.ReCountQty      = _tag.ReCountQTY;
            T.Verified        = _tag.Verified;
            T.BlankTag        = _tag.BlankTag;
            T.VoidTag         = _tag.VoidTag;
            T.CounterInitials = _tag.CounterInitials;
            T.CountedDate     = _tag.CountedDate;

            T.ItemNumber_FSKey         = _tag.ItemNumber_FSKey;
            T.TicketKey                = _tag.TicketID;
            T.Ticket.TicketKey         = _tag.TicketID;
            T.TagCountKey              = _tag.TicketCountID;
            T.Ticket.InventoryEventKey = _tag.EventID;
            T.CapturedBy               = _tag.CapturedBy;

            return(T);
        }
Example #2
0
        /// <summary>
        /// Converts a TicketCount enttity from EF to a TicketTag
        /// </summary>
        /// <param name="T"></param>
        /// <returns></returns>
        private TicketTag Entity2Tag(TicketCount T)
        {
            TicketTag _tag = new TicketTag();

            _tag.Counter           = T.Ticket.TicketCounter;
            _tag.ItemNumber        = T.ItemNumber;
            _tag.ItemDescription   = T.ItemDescription;
            _tag.ItemReference1    = T.ItemRef;
            _tag.ItemUM            = T.UM;
            _tag.Bin               = T.BIN;
            _tag.Stockroom         = T.STK;
            _tag.InventoryCategory = T.IC;
            _tag.InventoryQuantity = T.InventoryQty;
            _tag.LotNumber         = T.LotNumber;

            _tag.CountQTY        = T.CountQty;
            _tag.ReCountQTY      = T.ReCountQty;
            _tag.Verified        = T.Verified;
            _tag.BlankTag        = T.BlankTag;
            _tag.VoidTag         = T.VoidTag;
            _tag.CounterInitials = T.CounterInitials;
            _tag.CountedDate     = T.CountedDate;

            _tag.TicketID      = T.Ticket.TicketKey;
            _tag.TicketCountID = T.TagCountKey;
            _tag.EventID       = T.Ticket.InventoryEventKey;

            return(_tag);
        }
Example #3
0
        public void CreateCountTiket(TicketTag T)
        {
            if (ActiveEventId != 0)
            {
                Ticket         _ticket = new Ticket();
                cat_TicketType cat     = (cat_TicketType)_cat_TicketTypeLogic.ReadbyName(new cat_TicketType("TicketCount")).Result;
                TicketCount    _tag    = new TicketCount();

                _ticket.cat_TicketTypeKey = cat.id;
                _ticket.InventoryEventKey = ActiveEventId;
                _ticket.TicketCounter     = T.Counter;

                _tag.ItemNumber      = T.ItemNumber;
                _tag.ItemDescription = T.ItemDescription;
                _tag.ItemRef         = T.ItemReference1;
                _tag.UM               = T.ItemUM;
                _tag.STK              = T.Stockroom;
                _tag.BIN              = T.Bin;
                _tag.IC               = T.InventoryCategory;
                _tag.InventoryQty     = T.InventoryQuantity;
                _tag.LotNumber        = T.LotNumber;
                _tag.ItemNumber_FSKey = T.ItemNumber_FSKey;

                _ticket.TicketCounts.Add(_tag);

                //_cat_TicketTypeLogic.AddCountTicket(_ticket);
                _ticketLogic.Create(_ticket);
            }
        }
Example #4
0
        public void UpdateTag(TicketTag T)
        {
            TicketCount _ticketCount = new TicketCount();

            _ticketCount = Tag2Entity(T);
            _Response    = _ticketCountLogic.Update(_ticketCount);
        }
Example #5
0
        public TicketTag LoadTag(int Counter)
        {
            TicketTag   _ticketTag   = new TicketTag();
            TicketCount _ticketCount = new TicketCount();
            Ticket      _ticket      = new Ticket();

            _ticket.InventoryEventKey = ActiveEventId;
            _ticket.TicketCounter     = Counter;

            _ticket = (Ticket)_ticketLogic.ReadbyName(_ticket).Result;

            //_ticketCount.Ticket = _ticket;
            if (_ticket != null)
            {
                if (_ticket.cat_TicketTypeKey == 1)
                {
                    if (_ticketCountLogic.ReadAll(_ticket.TicketKey).Count > 0)
                    {
                        _ticketCount        = _ticketCountLogic.ReadAll(_ticket.TicketKey)[0];
                        _ticketCount.Ticket = _ticket;

                        //if (_ticket.TicketCounts.Count > 0)
                        //{
                        //    _ticketCount = (TicketCount)_ticket.TicketCounts;
                        //}

                        //_ticketCount = _ticketCountLogic.ReadAll(_ticket.TicketKey)[0];

                        _ticketTag = Entity2Tag(_ticketCount);
                        return(_ticketTag);
                    }
                }
            }
            return(null);
        }
Example #6
0
        public TicketCount Tag2TicketCount(TicketTag T)
        {
            TicketCount _ticket = new TicketCount();

            _ticket = Tag2Entity(T);
            _ticket = (TicketCount)_ticketCountLogic.ReadbyId(_ticket).Result;
            return(_ticket);
        }
Example #7
0
        public static TicketCount Tag2TicketCount(TicketTag T)
        {
            TicketCount _ticket = new TicketCount();

            _ticket.TagCountKey = T.TicketID;
            TicketCountLogic _ticketLogic = new Logic.TicketCountLogic();

            _ticket = (TicketCount)_ticketLogic.ReadbyId(_ticket).Result;
            return(_ticket);
        }
Example #8
0
        public static TicketTag TicketTag_DataRow2Tag(DataRow r)
        {
            TicketTag _tag = new TicketTag();

            _tag.Counter           = Convert.ToInt32(r["Counter"].ToString());
            _tag.ItemNumber        = r["ItemNumber"].ToString();
            _tag.ItemDescription   = r["ItemDescription"].ToString();
            _tag.ItemReference1    = r["ItemReference1"].ToString();
            _tag.ItemUM            = r["ItemUM"].ToString();
            _tag.Stockroom         = r["Stockroom"].ToString();
            _tag.Bin               = r["Bin"].ToString();
            _tag.InventoryCategory = r["InventoryCategory"].ToString();
            _tag.InventoryQuantity = float.Parse(r["InventoryQuantity"].ToString());
            _tag.LotNumber         = r["LotNumber"].ToString();

            return(_tag);
        }