Exemplo n.º 1
0
       /// <summary>
       /// 
       /// </summary>
       /// <returns></returns>
       public bool addBundleDetails(BundleDetails _bandle,Int64 _bundleHeaderID) {
           try {

               GenaricRepository<BundleDetails> _BundleDetails = new GenaricRepository<BundleDetails>(new ItrackContext());
               _bandle.BundleHeaderID = _bundleHeaderID;

               _bandle.BundleTagPrintedBy = "None";
               _bandle.BundleTagPrintedTime = "None";
               _bandle.isBundleTagsPrinted = false;
               _bandle.BundleStickerPrintedBy = "None";
               _bandle.BundleStickerPrintedTime = "None";
               _bandle.BundleTagPrintedBy = "None";
             


               _BundleDetails.Insert(_bandle);
               
               return true;
           }
           catch(Exception ex){
               Debug.WriteLine(ex.Message);
               return false;
           }
       }
Exemplo n.º 2
0
       /// <summary>
       /// 
       /// </summary>
       /// <param name="_bundleDetails"></param>
       /// <param name="_ditem"></param>
       /// <returns></returns>
       public bool OprationTags(BundleDetails _bundleDetails,string _style,string _LineNo,List<OprationBarcodes> barList) {
           try {

               if (barList.Count > 0)
               {
                   LastTagNo = Convert.ToInt64(barList.Last().OprationBarcodesID) + 1;
               }
               else {

                   LastTagNo = GetLastTagNo() + 1;
               }
               
            



                   GenaricRepository<DividingPlanHeader> _DividingPlanHeader = new GenaricRepository<DividingPlanHeader>(new ItrackContext());
                   GenaricRepository<DividingPlanItem> _DividingPlanItemRepo = new GenaricRepository<DividingPlanItem>(new ItrackContext());
                   

                   var dividingHeader = from item in _DividingPlanHeader.GetAll().ToList() where item.StyleID == _style && item.LineNo == _LineNo  select item;

                   if (dividingHeader.Count() > 0) 
                   {

                       int dividingheaderID = dividingHeader.Last().DividingPlanheaderID;

                       int count = _DividingPlanItemRepo.GetAll().Count();
                       int currentTagNo = 0;
                       bool needSave = false;

                       foreach (var item in _DividingPlanItemRepo.GetAll().Where(x => x.DividingPlanHeaderID == dividingheaderID).OrderBy(x => x.PartName).ToList())
                       {

                           GenaricRepository<OprationBarcodes> _OprationTagsRepo = new GenaricRepository<OprationBarcodes>(new ItrackContext());

                           _barcode.OprationBarcodesID = LastTagNo.ToString().PadLeft(6, '0');
                           _barcode.OprationNO = item.OprationNo;
                        //   _barcode.OprationRole =  GetOprationRole(_barcode.OprationNO);

                           _barcode.OprationRole = "None";
                           
                           _barcode.OprationGrade = "A";
                           _barcode.PartName = item.PartName;
                           _barcode.OparationName = item.OprationName;
                           _barcode.EmployeeID = "None";
                           _barcode.isOparationComplete = false;
                           _barcode.OprationComplteAt = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                           _barcode.BundleDetailsID = _bundleDetails.BundleDetailsID;
                           _barcode.StyleNo = _style;
                           _barcode.LineNo = _LineNo;
                           _barcode.OperationPoolID = item.OprationNo;
                           _barcode.WorkstationNo = item.WorkstationNo;
                           _barcode.OpNo = item.OpNo;

                           barList.Add( new OprationBarcodes(_barcode.OprationBarcodesID,_barcode.LineNo,_barcode.StyleNo, _barcode.OprationNO, _barcode.OparationName, _barcode.OprationGrade, _barcode.OprationRole, _barcode.PartName, _barcode.isOparationComplete, _barcode.OprationComplteAt, _barcode.EmployeeID, _barcode.BundleDetailsID,_barcode.OperationPoolID,"0", item.WorkstationNo,item.OpNo));
                        //   barList.Add(_barcode);


                            Debug.WriteLine(_barcode.OprationBarcodesID);
                        //   _OprationTagsRepo.InsertLongOpration(_barcode,needSave);

                           LastTagNo = LastTagNo + 1;

                           



                       }





                       

                   
                   
               }

                //   Debug.WriteLine(lstBarcodes.Count + "List Of Barcode ");

               return true;
           }
           catch(Exception ex){
               Debug.WriteLine(ex.Message);
               return false;
           }
       }