Exemplo n.º 1
0
 CuttingItem AssignCuttingItem() {
     try {
         CuttingItem _cuttingItem = new CuttingItem();
         _cuttingItem.PoNo = txtPoNo.Text;
         _cuttingItem.CuttingHeaderID = _cuttingHeader.CuttingHeaderID;
         _cuttingItem.MarkerNo = txtMarkerNo.Text;
         _cuttingItem.Color = txtColorCode.Text;
         _cuttingItem.Size = txtSize.Text;
         _cuttingItem.Length = txtLength.Text;
         _cuttingItem.NoOfItem =Convert.ToInt16( txtnoOfItem.Text);
         _cuttingItem.NoOfLayer =Convert.ToInt16( txtnoOfLayers.Text);
       
         _cuttingItem.FabricType = txtfabricType.Text;
      
         _cuttingItem.LineNo = txtlineNo.Text;
         _cuttingItem.Date = Convert.ToDateTime(DateTime.Now.ToShortDateString());
         _cuttingItem.isGenaratedTags = false;
         _cuttingItem.GenaratedTime = "None";
         _cuttingItem.isPrinted = false;
         _cuttingItem.PrinteTime = "None";
         return _cuttingItem;
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
         return null;
     }
 }
Exemplo n.º 2
0
        private int GetLastCutNo() {
            try {
                GenaricRepository<CuttingItem> _CuttingItemRepository = new GenaricRepository<CuttingItem>(new ItrackContext());
             _cuttingItem =   _CuttingItemRepository.GetAll().ToList().Last();

             return _cuttingItem.CuttingItemID;
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
                return 0;
            }
        
        }
Exemplo n.º 3
0
        /// <summary>
        /// edit marker details selecting by griud view.get id form grid view by user selection
        /// </summary>
        /// <param name="id"></param>
        private void EditCuttingItem(int id) {
            try {

                GenaricRepository<CuttingItem> _CuttingItemrRepo = new GenaricRepository<CuttingItem>(new ItrackContext());
            
                   
                 /*
                    _cuttingItem.CuttingHeaderID = item.CuttingHeaderID;
                    _cuttingItem.CuttingItemID = item.CuttingItemID;
                    _cuttingItem.MarkerNo = item.MarkerNo;
                    _cuttingItem.MarkerWidth = item.MarkerWidth;
                    _cuttingItem.MarkerLenth = item.MarkerLenth;
                    _cuttingItem.LineNo = item.LineNo;
                    _cuttingItem.Color = item.Color;
                    _cuttingItem.Size = item.Size;
                    _cuttingItem.Length = item.Length;
                    _cuttingItem.NoOfItem = item.NoOfItem;
                    _cuttingItem.NoOfLayer = item.NoOfLayer;
                    _cuttingItem.NoOfPlysLayed = item.NoOfPlysLayed;
                    _cuttingItem.NoOfPlysPlaned = item.NoOfPlysPlaned;
                    _cuttingItem.FabricType = item.FabricType;
                    */

                    _cuttingItem = AssignCuttingItem();
                    _cuttingItem.CuttingItemID = this.CItem;

                    _CuttingItemrRepo.Edit(_cuttingItem);

               
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// check if cutting item fegures alight to add item . reuturn true or false 
        /// </summary>
        /// <param name="_item"> cutting item </param>
        /// <returns></returns>
        private bool isEligbleCuttingItem(CuttingItem _item) {
            try {

                GenaricRepository<CuttingItem> _CuttingItemRepository = new GenaricRepository<CuttingItem>(new ItrackContext());

                var result = from item in _CuttingItemRepository.GetAll() where (item.MarkerNo == item.MarkerNo  && item.Size == _item.Size && item.Color == _item.Color && item.Length   == _item.Length && _item.Date == item.Date && _item.MarkerNo == item.MarkerNo) select item;
                if (result.Count() <= 0)
                {
                    return true;
                }
                else { 
                    return false;
                }
            }catch(Exception ex){

                Debug.WriteLine(ex.Message);
                return false;
            }
        
        }