예제 #1
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;
            
            }
        
        
        }
예제 #2
0
        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 "";
            }

        }
예제 #3
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);
            }
        
        }
예제 #4
0
 void addDayendHeader() {
     try {
         GenaricRepository<DayendHeader> _DayendHeaderRepository = new GenaricRepository<DayendHeader>(new ItrackContext());
         _DayendHeaderRepository.Add(AssignHeader());
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
     }
 }
예제 #5
0
 void AddTimeScadual() {
     try {
         GenaricRepository<ScaningTimeSchadual> _ScaningRepository = new GenaricRepository<ScaningTimeSchadual>(new ItrackContext());
         _ScaningRepository.Add(AssignValues());
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
     }
 
 }
예제 #6
0
        private void AddField()
        {
            try
            {
                GenaricRepository<GRN> _GRNRepo = new GenaricRepository<GRN>(new ItrackContext());
                _GRNRepo.Add(AssingGRN());
            }
            catch (Exception ex)
            {

            }
        }
예제 #7
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);
            }
        }
예제 #8
0
 private void AddPOItems()
 {
     try
     {
         GenaricRepository<PurchaseOrderItems> _PoRepository = new GenaricRepository<PurchaseOrderItems>(new ItrackContext());
         _PoRepository.Add(AssignPoItems());
       
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error - B-0002", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #9
0
    /// <summary>
    /// 
    /// </summary>
        private void SearchCuttingHeader()
        {

            try
            {

                splashScreenManager1.ShowWaitForm();
                //create expression 
                ParameterExpression argParam = Expression.Parameter(typeof(CuttingHeader), "s");
                Expression nameProperty = Expression.Property(argParam, "CuttingHeaderID");
                Expression namespaceProperty = Expression.Property(argParam, "StyleID");

                var val1 = Expression.Constant(txtSearchBox.Text);
                var val2 = Expression.Constant(txtSearchBox.Text);
                //expresttion 1 
                Expression e1 = Expression.Call(nameProperty, "Contains", null, val1);
                // expresstion 2
                Expression e2 = Expression.Call(namespaceProperty, "Contains", null, val2);
                var andExp = Expression.Or(e1, e2);


                // get expresttion to labda objet 
                var lambda1 = Expression.Lambda<Func<CuttingHeader, bool>>(andExp, argParam);
                // pass object to query 
               GenaricRepository<CuttingHeader> _SearchHeaderRepository = new GenaricRepository<CuttingHeader>(new ItrackContext());
                var selected = from item in _SearchHeaderRepository.SearchFor(lambda1).ToList() select new { item.CuttingHeaderID, item.StyleID, item.OrderQuantity, item.Date, item.Remark };

                //check is record exist in selected item
               if (selected.Count() > 0)
                {
                    grdSearch.Show();
                    btnClose.Show();

                    grdSearch.DataSource = selected;
                }
                else
                {
                    grdSearch.DataSource = null;
                }

               splashScreenManager1.CloseWaitForm();

            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                MessageBox.Show(ex.Message, "Error - B-0007", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }
예제 #10
0
        private void Search()
        {

            try
            {


                //create expression 
                ParameterExpression argParam = Expression.Parameter(typeof(ScaningTimeSchadual), "s");
                Expression nameProperty = Expression.Property(argParam, "ScaningTime");
                Expression namespaceProperty = Expression.Property(argParam, "ScaningTime");

                var val1 = Expression.Constant(txtScanTime.Text);
                var val2 = Expression.Constant(txtScanTime.Text);
                //expresttion 1 
                Expression e1 = Expression.Call(nameProperty, "Contains", null, val1);
                // expresstion 2
                Expression e2 = Expression.Call(namespaceProperty, "Contains", null, val2);
                var andExp = Expression.Or(e1, e2);


                GenaricRepository<ScaningTimeSchadual> _ScaningTimeSchadualRepository = new GenaricRepository<ScaningTimeSchadual>(new ItrackContext());
                // get expresttion to labda objet 
                var lambda1 = Expression.Lambda<Func<ScaningTimeSchadual, bool>>(andExp, argParam);
                // pass object to query 
                var selected = from item in _ScaningTimeSchadualRepository.SearchFor(lambda1).ToList() select new { item.ScaningTimeSchadualID, item.HourNO, item.ScaningTime };
                grdSearch.Show();
                //check is record exist in selected item
                if (selected.Count() > 0)
                {



                    grdSearch.DataSource = selected;
                }
                else
                {
                    grdSearch.DataSource = null;
                }



            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message, "Error - B-0007", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }
예제 #11
0
        public bool FeedLedger(StockLedger _ledger) {

            try {

                GenaricRepository<StockLedger> _GRNRepo = new GenaricRepository<StockLedger>(new ItrackContext());
                _GRNRepo.Add(_ledger);
                return true;
            }
            catch (Exception ex) {
                return false;
            }



        }
예제 #12
0
        // edit existing group 
      private  void EditGroup()
      {

          try
          {
           
              GenaricRepository<Group> _repository = new GenaricRepository<Group>(new ItrackContext());
              _repository.Edit(AssignGroup());

          }
          catch (Exception ex)
          {
              Debug.WriteLine(ex.Message);
              MessageBox.Show(ex.Message, "Error - C-0002", MessageBoxButtons.OK, MessageBoxIcon.Error);
          }

      }
        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;
            }
        }
예제 #14
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;
            
            }
        }
예제 #15
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){
            
            }
        
        
        }
예제 #16
0
        Promotion AssignValues() {
            try
            {
                GenaricRepository<Promotion> _PromotionRepository = new GenaricRepository<Promotion>(new ItrackContext());
                Pr.PromotionID = PID;
                Pr.FromDesignation = txtFromDesignation.Text;
                Pr.ToDesignation = txtToDesigation.Text;
                Pr.PromotedDate =Convert.ToDateTime( txtFromotedDate.Text);

                Pr.JobDescription = txtJobDescription.Text;
                Pr.Remark = txtRemark.Text;
                Pr.EmployeeID = EmpID;
                return Pr;
            }
            catch(Exception ex)
            {
                Debug.WriteLine(ex.Message);
                return null;
            
            }
        
        }
예제 #17
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;
               
           }
       
       }
예제 #18
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);
            }
        
        }
예제 #19
0
         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;
             }

         }
예제 #20
0
        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);
            }
        
        }
예제 #21
0
        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){
            
            }
        }
예제 #22
0
 private void AddEmployee()
 {
     try
     {
         GenaricRepository<Employee> _EmployeeRepo = new GenaricRepository<Employee>(new ItrackContext());
         _EmployeeRepo.Add(AssignEmployee());
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         MessageBox.Show(ex.Message, "Error - B-0003", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #23
0
        private void AddField()
        {
            try
            {

                GenaricRepository<VehicleRequisition> _VehicleRequestionRepo = new GenaricRepository<VehicleRequisition>(new ItrackContext());
                _VehicleRequestionRepo.Add(AssingVehicleRequisition());

            }
            catch (Exception ex)
            {

            }
        }
예제 #24
0
        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){
            
            }
        
        }
        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;
            }

        }
예제 #26
0
        private void SearchPo()
        {
            try
            {
                
                GenaricRepository<PO> _PORepo = new GenaricRepository<PO>(new ItrackContext());
                //create expression 
                ParameterExpression argParam = Expression.Parameter(typeof(PO), "s");
                Expression nameProperty = Expression.Property(argParam, "POID");
                Expression namespaceProperty = Expression.Property(argParam, "SupplierMasterID");

                var val1 = Expression.Constant(txtSearchBox.Text);
                var val2 = Expression.Constant(txtSearchBox.Text);
                //expresttion 1 
                Expression e1 = Expression.Call(nameProperty, "Contains", null, val1);
                // expresstion 2
                Expression e2 = Expression.Call(namespaceProperty, "Contains", null, val2);
                var andExp = Expression.Or(e1, e2);


                // get expresttion to labda objet 
                var lambda1 = Expression.Lambda<Func<PO, bool>>(andExp, argParam);
                // pass object to query 
                var selected = from item in _PORepo.SearchFor(lambda1).ToList() select new { item.POID, item.SupplierName, item.Date };

                //check is record exist in selected item
                if (selected.Count() > 0)
                {
                    grdPOSearch.Show();
                    btnClose.Show();

                    grdPOSearch.DataSource = selected;
                }
                else
                {
                    grdPOSearch.DataSource = null;
                }

              
            }
            catch (Exception ex)
            {


            }

        }
예제 #27
0
        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;

            }

        
        }
예제 #28
0
        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)
            {

            }
        }
예제 #29
0
         private void addGrnItems()
         {
             try
             {
                 GenaricRepository<GrnItems> _GrnItemsRepo = new GenaricRepository<GrnItems>(new ItrackContext());
                 GrnItems _grnitems = new GrnItems();

                 foreach (var item in lstGrnItems)
                 {
                     _grnitems.ItemCode = item.ItemCode;
                     _grnitems.Description = item.Description;
                     _grnitems.Color = item.Color;
                     _grnitems.Width = item.Width;
                     _grnitems.Unit = item.Unit;
                     _grnitems.Qty = item.Qty;
                     _grnitems.ReceivedQty = item.ReceivedQty;
                     _grnitems.UnitPrice = item.UnitPrice;
                     _grnitems.ReceivedPrice = item.ReceivedPrice;
                     _grnitems.LineDiscount = item.LineDiscount;
                     _grnitems.waistadeQty = item.waistadeQty;
                     _grnitems.SubTotal = item.SubTotal;
                     _grnitems.GRNID = txtGrnNo.Text;
                     _GrnItemsRepo.Add(_grnitems);
                      feedLedger(_grnitems);
                 }

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

         }
예제 #30
0
         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);
             }

         }