コード例 #1
0
ファイル: StockLedger.cs プロジェクト: nuwanprabath/ITRACK
        public string GetTransactionID()
        {
            try
            {

                RunningNo _No = new RunningNo();
                string _Code = "";
               // clsRuningNoEngine _Engine = new clsRuningNoEngine();

                GenaricRepository<RunningNo> _RunningNoRepo = new GenaricRepository<RunningNo>(new ItrackContext());
                foreach (var item in _RunningNoRepo.GetAll().ToList().Where(x => x.Venue == "TR"))
                {
                    _No.Prefix = item.Prefix;
                    _No.Starting = item.Starting;
                    _No.Length = item.Length;

                    _Code = _No.GenarateNo(_No, getLedgerCount());


                }
                return _Code;

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

        }
コード例 #2
0
        private void ScanBarcode(string _barcode) {
            try {
                GenaricRepository<OprationBarcodes> _BarcodeRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
                foreach (var barcode in _BarcodeRepository.GetAll().Where(p => p.OprationBarcodesID == _barcode).ToList()) {

                  txtStyleNo.Text =   barcode.BundleDetails.BundleHeader.CuttingItem.CuttingHeader.StyleID;
                  txtBundleNo.Text =Convert.ToString( barcode.BundleDetails.BundleDetailsID);
                  txtNoOfPCS.Text = Convert.ToString(barcode.BundleDetails.NoOfItem);
                  txtOperationNo.Text = barcode.OprationNO;
                  txtOperationName.Text = barcode.OparationName;
                  txtSize.Text = barcode.BundleDetails.BundleHeader.CuttingItem.Size;
                  txtColor.Text = barcode.BundleDetails.BundleHeader.CuttingItem.Color;
                  txtPartName.Text = barcode.PartName;
                  txtComplatedAt.Text = Convert.ToString(DateTime.Now);
                  lblTextDisplay.Text ="Last Scaning Opration is :"+ _barcode  + "  "+ barcode.OparationName;
                  this.BarcodeID = _barcode;
                  this.Grade = barcode.OprationGrade;
                  this.Role = barcode.OprationRole;
                  UpdateOprationStatus();



                }
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        
        }
コード例 #3
0
        List<dailyProductionByHour> GetReportData(DateTime _fromDate, DateTime _toDate) 
        {

            try {

                List<dailyProductionByHour> lstProduction = new List<dailyProductionByHour>();

                GenaricRepository<DailyProduction> _ProRepo = new GenaricRepository<DailyProduction>(new ItrackContext());

                var result = from item in _ProRepo.GetAll().ToList()
                           //  where item.Date <= _fromDate && item.Date <= _toDate
                             select item;

                foreach (var production in result)
                {
                    lstProduction.Add(new dailyProductionByHour { StyleNo=production.StyleID,PoNo=production.PoNo,Date=production.Date,LineNo=production.LineNo,HourNo=production.HourNo,Color=production.Color,Type=production.Type,Qty= production.Qty});
                }

                return lstProduction;
            }
            catch(Exception ex){
                return null;
            
            }
        
        
        }
コード例 #4
0
        void saveOparation() {
            try {

                GenaricRepository<DividingPlanHeader> _dHeaderRepo = new GenaricRepository<DividingPlanHeader>(new ItrackContext());
                DividingPlanHeader dHeader = new DividingPlanHeader();
                dHeader.LineNo = txtLineNo.Text;
                dHeader.ProductionPerHour =Convert.ToInt16( txtProductionPerHour.Text);
                dHeader.StyleID = txtStyleNo.Text;
                dHeader.TotalEmployee =Convert.ToInt16( txtTotalEmployee.Text);
                dHeader.Target =Convert.ToInt16(txtTarget.Text);

                _dHeaderRepo.Add(dHeader);

                dHeader.DividingPlanheaderID = _dHeaderRepo.GetAll().ToList().Last().DividingPlanheaderID;
                
                
                
                for (int i = 0; i < gridView3.RowCount; i++)
                {
                   
                    GenaricRepository<DividingPlanItem> _dItemRepo = new GenaricRepository<DividingPlanItem>(new ItrackContext());
                    
                    DividingPlanItem dItem = new DividingPlanItem();
                   
                    dItem.OprationNo = gridView3.GetRowCellValue(i, "OprationNo").ToString();
                    dItem.OprationName = gridView3.GetRowCellValue(i, "OprationName").ToString();
                    dItem.SMVType = gridView3.GetRowCellValue(i, "SMVType").ToString();
                    dItem.MachineType = gridView3.GetRowCellValue(i, "MachineType").ToString();
                    dItem.SMV =Convert.ToDouble( gridView3.GetRowCellValue(i, "SMV").ToString());
                    dItem.DividingPlanHeaderID = dHeader.DividingPlanheaderID;
                    dItem.PartName = gridView3.GetRowCellValue(i, "PartName").ToString();
                    
                    string status = gridView3.GetRowCellValue(i, "Selected").ToString();
                    GenaricRepository<DividingPlanTemp> _dItemTempRepo = new GenaricRepository<DividingPlanTemp>(new ItrackContext());
                    DividingPlanTemp dTemp = new DividingPlanTemp();
                    dTemp.DividingPlanTempID = Convert.ToInt16(gridView3.GetRowCellValue(i, "DividingPlanTempID").ToString());
                    if (status == "True")
                    {
                        _dItemRepo.Insert(dItem);
                        _dItemTempRepo.Delete(dTemp);
                    }
                    else { 
                        
                    }

                    
                }
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        }
コード例 #5
0
        string GetEmployeeNameByID(string _id) {
            try {
                GenaricRepository<Employee> _EMployeeRepo = new GenaricRepository<Employee>(new ItrackContext());
                  // _EMployeeRepo.GetAll().Where(x => x.EmployeeID == _id).Last().FullName.ToString();

                string EmployeName ="";
                   foreach( var item in _EMployeeRepo.GetAll().Where(x=>x.EmployeeID==_id).ToList())
                   {
                       EmployeName = item.FullName;
                   }

                   return EmployeName;
            }
            catch(Exception ex){
                return null;
            }
        }
コード例 #6
0
ファイル: User.cs プロジェクト: nuwanprabath/ITRACK
        //public bool CreateUser() {

        //    try { }
        //    catch(){
            
        //    }
        
        //}

        public List<User> GetUser(User _user)
        {
            try {

                GenaricRepository<User> _repository = new GenaricRepository<User>(new ItrackContext());
                var userList = from user in _repository.GetAll().ToList()
                               where user.UserName == _user.UserName && user.Password == _user.Password

                               select new { user.UserName, user.UserID, user.Department, user.UserLevel, user.Password };
                 
                 

                return UserList;
                
            }catch(Exception ex)
            {
                return null;
            
            }
        }
コード例 #7
0
        void GenarateReport(string _styleNo,int _from,int _to)
        {
            try {
                GenaricRepository<OprationBarcodes> _ItemRepo = new GenaricRepository<OprationBarcodes>(new ItrackContext());

                var items = from item in _ItemRepo.GetAll().ToList()
                            where item.StyleNo == _styleNo && item.BundleDetails.BundleNo >= _from && item.BundleDetails.BundleNo < _to && item.isOparationComplete==true
                            select item;

                BundleWiseProduction lbl = new BundleWiseProduction();
                lbl.DataSource = items;
                ReportPrintTool tool = new ReportPrintTool(lbl);
                tool.ShowPreview();


            }
            catch(Exception ex){
            
            }
        
        
        }
コード例 #8
0
   //   clsProductionSummary _summary = new clsProductionSummary();
       public List<clsProductionSummary> GetInputCount()
       {
           try {

               GenaricRepository<OprationBarcodes> _BarcodeEditRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
               var itemList = from items in _BarcodeEditRepository.GetAll().ToList() where items.OprationRole == "In" && items.isOparationComplete == true group items by items.OprationComplteAt.Date into ItemG select new { Date = Convert.ToDateTime(ItemG.Key.ToString("dd-MM-yyyy")), Count = ItemG.Sum(c => c.BundleDetails.NoOfItem) };
               
               foreach (var item in itemList) {

                   
               //    Debug.WriteLine("Date :" + item.Date + " Input: " + item.Count + "  " + " Out: " + GetOutPut(item.Date, "") + "" +"  Cut Out:"+ GetCutOut(item.Date, ""));

                //   lstSummary.Add(new clsProductionSummary("By-Jk", "V-6", GetCutOut(item.Date, ""), Convert.ToInt16(item.Count), GetOutPut(item.Date, ""), 0, 0, item.Date));
               
               }
               return lstSummary;
           }
           catch(Exception ex){
               Debug.WriteLine(ex.Message);
               return null;
               
           }
       
       }
コード例 #9
0
        void SearchScanSchadual(Int16 id) {

            try {
                GenaricRepository<ScaningTimeSchadual> _ScaningTimeSchadualRepository = new GenaricRepository<ScaningTimeSchadual>(new ItrackContext());

                var list = from item in _ScaningTimeSchadualRepository.GetAll().ToList()
                           where item.ScaningTimeSchadualID == id
                           select new { item.ScaningTimeSchadualID, item.HourNO, item.ScaningTime };

                if (list.Count() > 0)
                {
                    grdSearch.DataSource = list;

                }
              

                

            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        
        }
コード例 #10
0
ファイル: frmGRN.cs プロジェクト: nuwanprabath/ITRACK
        void setGrnItems(string GrnNo)
        {
            try
            {
                GenaricRepository<GrnItems> _GrnItemsRepo = new GenaricRepository<GrnItems>(new ItrackContext());
              //var dataSource = from item in _GrnItemsRepo.GetAll().ToList() where item.GRNID == GrnNo select new {item.ItemCode};


                var data = _GrnItemsRepo.GetAll().Where(x => x.GRNID == GrnNo).ToList();
                grdGrnAdd.DataSource = data;
                gridView3.Columns["GRN"].Visible = false;
                gridView3.Columns["GRNID"].Visible = false;
            }

            catch (Exception ex)
            {

            }
        }
コード例 #11
0
ファイル: frmGRN.cs プロジェクト: nuwanprabath/ITRACK
         void GetNewCode()
         {
             try
             {

                 RunningNo _No = new RunningNo();
                 clsRuningNoEngine _Engine = new clsRuningNoEngine();

                 GenaricRepository<RunningNo> _RunningNoRepo = new GenaricRepository<RunningNo>(new ItrackContext());
                 foreach (var item in _RunningNoRepo.GetAll().ToList().Where(x => x.Venue == "GRN"))
                 {
                     _No.Prefix = item.Prefix;
                     _No.Starting = item.Starting;
                     _No.Length = item.Length;

                     txtGrnNo.Text = _Engine.GenarateNo(_No, getPoCount());


                 }


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

         }
コード例 #12
0
ファイル: frmGRN.cs プロジェクト: nuwanprabath/ITRACK
         int getPoCount()
         {
             try
             {
                 GenaricRepository<GRN> _GRNRepo = new GenaricRepository<GRN>(new ItrackContext());
                 return _GRNRepo.GetAll().ToList().Count;
             }
             catch (Exception ex)
             {
                 Debug.WriteLine(ex.Message);
                 return 0;
             }

         }
コード例 #13
0
ファイル: Opration List.cs プロジェクト: nuwanprabath/ITRACK
        void getUpdatedList() {

            foreach (var item in lst.Where(x => x.Selected == true))
            {
                //lstselected.Add(new OperationListSelection(item.OprationNo, item.OprationName, item.SMV, item.WorkstationNo,item.Selected));
                MessageBox.Show(item.OprationNo);
                DividingPlanItem _item = new DividingPlanItem();
                if (_item.DividingPlanHeaderID != 0)
                {
                    _item.DividingPlanHeaderID = Convert.ToInt16(this.DividingPlanHeader);
                }
                else
                {
                    _item.DividingPlanHeaderID = DividingPlanHeader;
                }

                
                _item.OprationNo = item.OprationNo;
                _item.OprationName = item.OprationName;
                _item.MachineType = item.MachineType;
                _item.SMVType = item.SMVType;
                _item.SMV = item.SMV;
                _item.PartName = item.PartName;
                _item.OperationRole = item.OperationRole;
                _item.WorkstationNo = item.WorkstationNo;
                GenaricRepository<DividingPlanItem> _pDidingItemRepository = new GenaricRepository<DividingPlanItem>(new ItrackContext());

                _item.OpNo =    _pDidingItemRepository.GetAll().ToList().Where(X => X.DividingPlanHeaderID == _item.DividingPlanHeaderID).Count();

                if (_pDidingItemRepository.Insert(_item) == true) 
                {
                    
                }
                


            }
            MessageBox.Show("Save Sucessfully !", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
            
        
        }
コード例 #14
0
        private List<PoDeliveries> GetReportData(DateTime _fromDate,DateTime _toDate,string _styleNo,int option)
        {

            try {
                GenaricRepository<PurchaseOrderItems> _PoRepo = new GenaricRepository<PurchaseOrderItems>(new ItrackContext());
                lstPo.Clear();
                if (option == 1)
                {
                    foreach (var item in _PoRepo.GetAll().ToList().Where(x=>x.PurchaseOrderHeader.StyleID==_styleNo))
                    {

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

                        var cut = from x in _CutRepo.GetAll()
                                  where x.Size == item.Size && x.Color == item.Color && x.PoNo == item.PurchaseOrderID
                                  select x;

                        int cutQty = 0;
                        if (cut.Count() > 0)
                        {

                            foreach (var i in cut)
                            {

                                cutQty = i.NoOfItem + cutQty;
                            }


                        }


                    // add item to list of POs
                        lstPo.Add(new PoDeliveries
                        {
                            Date = item.PurchaseOrderHeader.EndDate,
                            PoNo = item.PurchaseOrderID,
                            StyleNo = item.PurchaseOrderHeader.StyleID,
                            Color = item.Color,
                            Size = item.Size,
                            Pcs = item.Quantity,
                            CutQty = cutQty
                        });

                        cutQty = 0;

                    }
                }
                else
                {

                    foreach (var item in _PoRepo.GetAll().ToList())
                    {

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

                        var cut = from x in _CutRepo.GetAll()
                                  where x.Size == item.Size && x.Color == item.Color && x.PoNo == item.PurchaseOrderID
                                  select x;

                        int cutQty = 0;
                        if (cut.Count() > 0)
                        {

                            foreach (var i in cut)
                            {

                                cutQty = i.NoOfItem + cutQty;
                            }


                        }




                        lstPo.Add(new PoDeliveries
                        {
                            Date = item.PurchaseOrderHeader.EndDate,
                            PoNo = item.PurchaseOrderID,
                            StyleNo = item.PurchaseOrderHeader.StyleID,
                            Color = item.Color,
                            Size = item.Size,
                            Pcs = item.Quantity,
                            CutQty = cutQty
                        });

                        cutQty = 0;

                    }
                
                }
              




                Debug.WriteLine("No Of rows" + lstPo.Count);
                return lstPo;

            }
            catch(Exception){
                return lstPo;
            }
        
        }
コード例 #15
0
        private List<CuttingItem> GetCuttingItem(int ID)
        {
            try
            {
                GenaricRepository<CuttingItem> _CuttingItem = new GenaricRepository<CuttingItem>(new ItrackContext());
                return _CuttingItem.GetAll().Where(u => u.CuttingItemID== ID).ToList();


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error - B-0006", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return null;

            }

        }
コード例 #16
0
 private void SetLayingDetails(string StyleNo) {
     try {
         GenaricRepository<LayinDetails> _LayinDetailsRepo = new GenaricRepository<LayinDetails>(new ItrackContext());
         grdFabricDetails.DataSource = _LayinDetailsRepo.GetAll().ToList().Where(x => x.StyleID == StyleNo);
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
     }
 
 }
コード例 #17
0
        private List<HourlyProductionList> GetReportData(DateTime _fromDate, DateTime _toDate)
        {

            try
            {

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


                // get production result from table and analys by date or date range 
                var result = from items in _BarcodeRepo.GetAll().ToList()
                             where
                                 (items.OprationComplteAt.Day <= _toDate.Day && items.OprationComplteAt.Day >= _fromDate.Day)
                                 && (items.OprationComplteAt.Month <= _toDate.Month && items.OprationComplteAt.Month >= _fromDate.Month)
                                 && (items.OprationComplteAt.Year <= _toDate.Year && items.OprationComplteAt.Year >= _fromDate.Year)
                                 && items.isOparationComplete == true
               //group by result and get sum by operation no and hour 
                             group items by new { items.OprationComplteAt.Date,items.OprationNO,items.Employee.FullName, items.OprationComplteAt.Hour, items.OprationComplteAt.Minute, items.LineNo, items.StyleNo } into ItemG

                             select new { ItemG.Key.Date, ItemG.Key.OprationNO, ItemG.Key.FullName, ItemG.Key.Hour, ItemG.Key.Minute, ItemG.Key.LineNo, ItemG.Key.StyleNo, Count = ItemG.Sum(c => c.BundleDetails.NoOfItem) };
                // go through result and fill foreeach result in to lstPro List
                foreach (var production in result) {


                    lstPro.Add(new HourlyProductionList { StyleNo = production.StyleNo, Date = production.Date.Date, LineNo = production.LineNo,OperationNo=production.OprationNO,EmployeeName=production.FullName ,Hour = production.Hour+"."+production.Minute, Pcs =Convert.ToInt16(production.Count) });
                
                }
                            

               


                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "2", LineIn = 5, LineOut = 5 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "3", LineIn = 45, LineOut = 45 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "4", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "5", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "6", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "7", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "8", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-07", LineNo = "V-6", Hour = "9", LineIn = 200, LineOut = 200 });


                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "1", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "2", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "3", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "4", LineIn = 200, LineOut = 220 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "5", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "6", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "7", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "8", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-01", LineNo = "V-6", Hour = "9", LineIn = 205, LineOut = 200 });


                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "1", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "2", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "3", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "4", LineIn = 310, LineOut = 215 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "5", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "6", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "7", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "8", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-02", LineNo = "V-6", Hour = "9", LineIn = 220, LineOut = 255 });


                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "1", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "2", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "3", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "4", LineIn = 235, LineOut = 200 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "5", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "6", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "7", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "8", LineIn = 0, LineOut = 0 });
                //lstPro.Add(new HourlyProductionList { StyleNo = "46575", Date = "2015-09-03", LineNo = "V-6", Hour = "9", LineIn = 210, LineOut = 205 });



                    
               
              
                return lstPro;

            }
            catch (Exception)
            {
                return lstPro;
            }

        }
コード例 #18
0
      private List<LayinDetails> GetLayinDetailsReport(string _styleNo)
      {

          try
          {
              GenaricRepository<LayinDetails> _CuttingItemRepo = new GenaricRepository<LayinDetails>(new ItrackContext());
              return _CuttingItemRepo.GetAll().Where(x => x.StyleID == _styleNo).ToList();
          }
          catch (Exception ex)
          {
              Debug.WriteLine(ex.Message);
              return null;
          }

      }
コード例 #19
0
ファイル: EmployeeMaster.cs プロジェクト: nuwanprabath/ITRACK
        private void GetPromotion(string Id)
        {
            try
            {
              GenaricRepository<Promotion> _PromotionRepository = new GenaricRepository<Promotion>(new ItrackContext());
              var selected =   _PromotionRepository.GetAll().Where(x => x.EmployeeID == Id).ToList();

              grdPromotion.DataSource = from item in selected select new { item.PromotionID,  item.FromDesignation, item.ToDesignation, item.PromotedDate, item.JobDescription, item.Remark };
              gridView1.Columns["PromotionID"].Visible = false;
            }
            catch(Exception ex){
            
            }
        }
コード例 #20
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;
            }
        
        }
コード例 #21
0
 private bool isExistingItem( string _markerNo) {
     try {
         GenaricRepository<CuttingItem> _CutItemrepo = new GenaricRepository<CuttingItem>(new ItrackContext());
         if (_CutItemrepo.GetAll().Where(x => x.MarkerNo == _markerNo).ToList().Count() > 0)
         {
             return true;
         }
         else {
             return false;
         }
     }
     catch(Exception ex){
        
         Debug.WriteLine(ex.Message);
         return false;
     }
 
 }
コード例 #22
0
      void FeedColorCombo(ComboBoxEdit combo)
        {
            try {
               
                ComboBoxItemCollection coll = combo.Properties.Items;

                GenaricRepository<PurchaseOrderItems> _PoRepo = new GenaricRepository<PurchaseOrderItems>(new ItrackContext());
                foreach (var items in _PoRepo.GetAll().Where(u => u.PurchaseOrderHeader.Style.StyleID == txtStyleNo.Text).Distinct())
                {
                    coll.Add(items.Color);

                } 

                            
                
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        
        }
コード例 #23
0
ファイル: frmGRN.cs プロジェクト: nuwanprabath/ITRACK
        void initilizeValues() {
            GetNewCode();
            txtGrnDate.Text = DateTime.Now.ToShortDateString();

            GenaricRepository<Company> _CompanyRepository = new GenaricRepository<Company>(new ItrackContext());

            foreach (var item in _CompanyRepository.GetAll().Where(x => x.isDefaultCompany == true))
            {
                cmbLocationCode.Text = item.LocationCode;

            }

        
        }
コード例 #24
0
        private bool ProcessTextFile() {
            
               // textfileOpen.Filter = "Text Files (*.txt) | *.doc";
                textfileOpen.InitialDirectory = @"C:\";
                textfileOpen.Title = "Select Text File To Process";
                TextFileReadingHelper _helper = new TextFileReadingHelper();
                if (textfileOpen.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {


                    string _path = textfileOpen.FileName;
                    foreach (var Line in _helper.getAllLines(_path)) {

                        if (Line.Length == 5)
                        {
                            GenaricRepository<Employee> _EmployeeRepos = new GenaricRepository<Employee>(new ItrackContext());
                            var emplist = _EmployeeRepos.GetAll().Where(x=>x.EmployeeID == Line);
                            if (emplist.Count() > 0)
                            {
                                _employee.EmployeeID = Line;

                            }
                            else {

                                Debug.WriteLine("Error :" + _employee.EmployeeID);
                            
                            }
                         
                            Debug.WriteLine("EMployee ID :" + Line);
                        }
                        else if (Line.Length == 6) 
                        {

                            offlineScaning(Line);
                            Debug.WriteLine(Line);
                        }
                    
                }

                


            }

            return true;
        
        }
コード例 #25
0
ファイル: frmGRN.cs プロジェクト: nuwanprabath/ITRACK
        void PrintReport()
        {
            try
            {
                rtGRN report = new rtGRN();

                GenaricRepository<GrnItems> _ItemRepo = new GenaricRepository<GrnItems>(new ItrackContext());
                var dataSource = from item in _ItemRepo.GetAll().ToList()
                                 where item.GRNID == txtGrnNo.Text
                                 select item;

                report.DataSource = dataSource;

              ReportPrintTool preview = new ReportPrintTool(report);

              preview.ShowPreview();
            }
            catch(Exception ex){
            
            }
        
        }
コード例 #26
0
        void FeedLayinDetails(string _styleNo) {
            try {

                GenaricRepository<LayinDetails> _LayinDetailsRepo = new GenaricRepository<LayinDetails>(new ItrackContext());

              grdFabricDetails.DataSource =   _LayinDetailsRepo.GetAll().ToList().Where(x=>x.StyleID == _styleNo );
              gridView4.Columns["Style"].Visible = false;
            
            }
            catch(Exception ex){

                Debug.WriteLine(ex.Message);
            
            }
        
        }
コード例 #27
0
 private List<CutReport> GetList() {
     GenaricRepository<CuttingItem> _CuttingItemRepo = new GenaricRepository<CuttingItem>(new ItrackContext());
     List<CutReport> lst = new List<CutReport>();
     foreach (var item in _CuttingItemRepo.GetAll().ToList().Where(x=>x.CuttingHeader.StyleID==txtStyleNo.Text)) {
         lst.Add(new CutReport {StyleNo=item.CuttingHeader.StyleID, Date= item.Date,LineNo = item.LineNo,Color=item.Color,Size=item.Size,Pcs=item.NoOfItem});
     }
     return lst;
 }
コード例 #28
0
 private void offlineScaning(string _barcode) {
     try { 
         GenaricRepository<OprationBarcodes> _BarcodeRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
         GenaricRepository<OprationBarcodes> _BarcodeEditRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
         foreach (var barcode in _BarcodeRepository.GetAll().Where(p => p.OprationBarcodesID == _barcode).ToList())
         {
              OprationBarcodes _sbarcode = new OprationBarcodes();
             _sbarcode.OprationComplteAt =Convert.ToDateTime(txtDate.Text + " " +txtTime.Text);
             _sbarcode.isOparationComplete = true;
             _sbarcode.EmployeeID = _employee.EmployeeID;
             _sbarcode.OprationBarcodesID = this.BarcodeID;
             _sbarcode.OprationNO = barcode.OprationNO; ;
             _sbarcode.OparationName = barcode.OparationName;
             _sbarcode.OprationGrade = barcode.OprationGrade;
             _sbarcode.OprationRole = barcode.OprationRole;
             _sbarcode.BundleDetailsID = barcode.BundleDetails.BundleDetailsID;
             _sbarcode.PartName = barcode.PartName;
             _sbarcode.LineNo = barcode.LineNo;
             _sbarcode.StyleNo = barcode.StyleNo;
             _sbarcode.OprationBarcodesID = _barcode;
             _sbarcode.OperationPoolID = barcode.OprationNO;
             _BarcodeEditRepository.Update(_sbarcode);
         
         }
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
     }
 
 }
コード例 #29
0
ファイル: EmployeeMaster.cs プロジェクト: nuwanprabath/ITRACK
        private void GetPromotionDetails (string _empId){
            try
            {
              int Id =  Convert.ToInt16(gridView1.GetFocusedRowCellValue("PromotionID").ToString());
                GenaricRepository<Promotion> _PromotionRepository = new GenaricRepository<Promotion>(new ItrackContext());

               var result =   _PromotionRepository.GetAll().Where(x => x.EmployeeID == _empId).ToList();

               foreach (var item in result.Where(x => x.PromotionID == Id))
               {
                    
                    Promotion.EmployeeID = item.EmployeeID;
                    Promotion.PromotionID = item.PromotionID;
                    Promotion.FromDesignation = item.FromDesignation;
                    Promotion.ToDesignation = item.ToDesignation;
                    Promotion.JobDescription = item.JobDescription;
                    Promotion.Remark = item.Remark;
                    Promotion.PromotedDate = item.PromotedDate;
                }
               
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        
        }
コード例 #30
0
        private void ScaningEmployee(string _barcode) {
            try {

                GenaricRepository<Employee> _EmployeeRepository = new GenaricRepository<Employee>(new ItrackContext());
                foreach (var employee in _EmployeeRepository.GetAll().Where(p => p.EmployeeID == _barcode).ToList()) {

                    txtEmployeeID.Text = employee.EmployeeID;
                    txtEmployeeName.Text = employee.FullName;
                    txtEPFNo.Text = employee.EPFNo;
                    txtDesignation.Text = employee.Designation;
                    Employee = employee;

                    byte[] picture = employee.Image;
                    imgprofile.Image = Image.FromStream(new MemoryStream(picture));
                    imgprofile.Refresh();
                }
            
            
            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        }