Beispiel #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);
        }
Beispiel #2
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);
            }
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public void UpdateTag(TicketTag T)
        {
            TicketCount _ticketCount = new TicketCount();

            _ticketCount = Tag2Entity(T);
            _Response    = _ticketCountLogic.Update(_ticketCount);
        }
Beispiel #6
0
        public TicketCount Tag2TicketCount(TicketTag T)
        {
            TicketCount _ticket = new TicketCount();

            _ticket = Tag2Entity(T);
            _ticket = (TicketCount)_ticketCountLogic.ReadbyId(_ticket).Result;
            return(_ticket);
        }
Beispiel #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);
        }
Beispiel #8
0
        public DataTable LoadTags_Table(TicketCount T)
        {
            List <TicketCount> L      = new List <TicketCount>();
            DataTable          _table = new DataTable();
            Ticket             t      = new Ticket();

            t.InventoryEventKey = ActiveEventId;
            T.Ticket            = t;

            #region Table Setup
            _table.Columns.Add("Tag Counter", typeof(int));
            _table.Columns.Add("Item Number", typeof(string));
            _table.Columns.Add("Item Description", typeof(string));
            _table.Columns.Add("Class", typeof(string));
            _table.Columns.Add("UM", typeof(string));
            _table.Columns.Add("STK", typeof(string));
            _table.Columns.Add("Bin", typeof(string));
            _table.Columns.Add("IC", typeof(string));
            _table.Columns.Add("LotNumber", typeof(string));
            _table.Columns.Add("Verified", typeof(bool));
            _table.Columns.Add("Void", typeof(bool));
            _table.Columns.Add("Counted Qty", typeof(float));
            _table.Columns.Add("Re-Counted Qty", typeof(float));
            _table.Columns.Add("TicketKey", typeof(int));
            _table.Columns.Add("TicketCountKey", typeof(int));
            #endregion

            L = _ticketCountLogic.ReadByProp("Verified", T);

            foreach (TicketCount _t in L)
            {
                t = (Ticket)_ticketLogic.ReadbyId(_t.TicketKey).Result;
                _table.Rows.Add(
                    t.TicketCounter
                    , _t.ItemNumber
                    , _t.ItemDescription
                    , _t.ItemRef
                    , _t.UM
                    , _t.STK
                    , _t.BIN
                    , _t.IC
                    , _t.LotNumber
                    , _t.Verified
                    , _t.VoidTag
                    , _t.CountQty
                    , _t.ReCountQty
                    , t.TicketKey
                    , _t.TagCountKey
                    );
            }

            return(_table);
        }
Beispiel #9
0
        public List <TicketCount> LoadTags_List(TicketCount T)
        {
            List <TicketCount> L = new List <TicketCount>();
            Ticket             t = new Ticket();

            t.InventoryEventKey = ActiveEventId;
            T.Ticket            = t;

            L = _ticketCountLogic.ReadByProp("Verified", T);
            //for (int i = 0; i < L.Count; i++)
            //{
            //    L[i].Ticket = (Ticket) _ticketLogic.ReadbyId(L[i].TicketKey).Result;
            //}
            return(L);
        }
Beispiel #10
0
        public void CreateBlankBatch(int BlankQty)
        {
            if (ActiveEventId != 0)
            {
                int            counter = 0; Ticket _ticket = new Ticket();
                cat_TicketType cat = (cat_TicketType)_cat_TicketTypeLogic.ReadbyName(new cat_TicketType("TicketCount")).Result;

                TicketCount _tag = new TicketCount();

                Ticket LastTag = new Ticket();
                LastTag.InventoryEventKey = ActiveEventId;
                LastTag = (Ticket)_ticketLogic.GetLastTagID(LastTag).Result;
                if (LastTag != null)
                {
                    counter = LastTag.TicketCounter;
                }
                else
                {
                    counter = 0;
                }
                for (int i = 1; i <= BlankQty; i++)
                {
                    _ticket.cat_TicketTypeKey = cat.id;
                    _ticket.InventoryEventKey = ActiveEventId;
                    //_ticket.TicketCounter = T.Counter;
                    _ticket.TicketCounter = counter + i;

                    _tag.ItemNumber      = "";
                    _tag.ItemDescription = "";
                    _tag.ItemRef         = "";
                    _tag.UM           = "";
                    _tag.STK          = "";
                    _tag.BIN          = "";
                    _tag.IC           = "";
                    _tag.InventoryQty = 0;
                    _tag.LotNumber    = "";
                    _tag.BlankTag     = true;

                    _ticket.TicketCounts.Add(_tag);

                    //_cat_TicketTypeLogic.AddCountTicket(_ticket);
                    _ticketLogic.Create(_ticket);
                }
            }
        }
        public void Attach_FSTI_Transacion(TicketCount e, string DocNum, string InvAccount, string ReasonCode, string Remark)
        {
            FSTI_Transactions T = new FSTI_Transactions();

            T.TransactionType = "INVA";
            T.TagCountKey     = e.TagCountKey;
            #region FSTI String Field

            //Item, Stk, Bin, Ic, DocNum, AC, Adj_Qty, RC, InvOffAcc, UM, LotNo, Remark
            //   0,   1,   2,  3,      4,  5,       6,  7,         8,  9,    10,     11

            //float balanceQty = 0;
            string ActionCode = "";

            if (e.Balance > 0)
            {
                ActionCode = "+";
            }
            else
            {
                ActionCode = "-";
            }

            string Fields = "";

            Fields += e.ItemNumber + ",";
            Fields += e.STK + ",";
            Fields += e.BIN + ",";
            Fields += e.IC + ",";
            Fields += DocNum + ",";
            Fields += ActionCode + ",";
            Fields += Math.Abs(e.Balance).ToString() + ",";
            Fields += ReasonCode + ",";
            Fields += InvAccount + ",";
            Fields += e.UM + ",";
            Fields += e.LotNumber + ",";
            Fields += Remark;
            #endregion

            T.TagCountKey             = e.TagCountKey;
            T.FS_PartNo               = e.ItemNumber;
            T.TransactionStringFields = Fields;

            _FSTI_TransactionLogic.Create(T);
        }
Beispiel #12
0
        public void CreateBlankCountTiket()
        {
            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 LastTag = new Ticket();
                LastTag.InventoryEventKey = ActiveEventId;
                LastTag = (Ticket)_ticketLogic.GetLastTagID(LastTag).Result;
                //LastTag.InventoryEventKey = ActiveEventId;
                //LastTag = (Ticket)_ticketLogic.ReadbyId(LastTag).Result;

                _ticket.cat_TicketTypeKey = cat.id;
                _ticket.InventoryEventKey = ActiveEventId;
                //_ticket.TicketCounter = T.Counter;
                _ticket.TicketCounter = LastTag.TicketCounter + 1;

                _tag.ItemNumber      = "";
                _tag.ItemDescription = "";
                _tag.ItemRef         = "";
                _tag.UM           = "";
                _tag.STK          = "";
                _tag.BIN          = "";
                _tag.IC           = "";
                _tag.InventoryQty = 0;
                _tag.LotNumber    = "";
                _tag.BlankTag     = true;

                _ticket.TicketCounts.Add(_tag);

                //_cat_TicketTypeLogic.AddCountTicket(_ticket);
                _ticketLogic.Create(_ticket);
            }
        }
Beispiel #13
0
 public void UpdateTag(TicketCount T)
 {
     _Response = _ticketCountLogic.Update(T);
 }