Beispiel #1
0
        protected override System.Linq.Expressions.Expression <Func <ERP_M002_BOM_Material, bool> > ReadExpression()
        {
            ICacheServiceBase appCacheService = Unity.Instance.GetService <ICacheServiceBase>();
            tb_Sys_User       tempUser        = appCacheService.GetItem("user") as tb_Sys_User;

            return(i => i.CompCode == tempUser.CompCode);
        }
Beispiel #2
0
        protected override System.Linq.Expressions.Expression <Func <MES_M201_Plan_Daily, bool> > ReadExpression()
        {
            ICacheServiceBase appCacheService = Unity.Instance.GetService <ICacheServiceBase>();
            tb_Sys_User       tempUser        = appCacheService.GetItem("user") as tb_Sys_User;

            return(i => i.CompCode == tempUser.CompCode);
        }
Beispiel #3
0
        public void Save(MES_M202_Task_Detail taskDetail, List <MES_M202_Task_JobLot> taskJobLotList)
        {
            tb_Sys_User tempUser   = appCacheService.GetItem("user") as tb_Sys_User;
            var         existstemp = this.GetById(taskDetail.Id);

            if (existstemp == null)
            {
                taskDetail.CompCode   = tempUser.CompCode;
                taskDetail.CreateDt   = DateTime.Now;
                taskDetail.CreateUser = tempUser.UserName;
                taskDetail.Validate();
                this.MES_M202_Task_DetailRepository.Add(taskDetail);
            }
            else
            {
                taskDetail.ModifyDt   = DateTime.Now;
                taskDetail.ModifyUser = tempUser.UserName;
                taskDetail.Validate();
                this.MES_M202_Task_DetailRepository.SetValues(taskDetail, existstemp);
            }
            if (taskJobLotList != null)
            {
                string sql = string.Format("Delete MES_M202_Task_JobLot where JobNo = '{0}'", taskDetail.TaskNo);
                taskJobLotRepository.GetDbContext().Database.ExecuteSqlCommand(sql);
                foreach (var taskJobLot in taskJobLotList)
                {
                    taskJobLot.JobNo    = taskDetail.TaskNo;
                    taskJobLot.CompCode = tempUser.CompCode;
                    taskJobLot.Validate();
                    this.taskJobLotRepository.Add(taskJobLot);
                }
            }
            this.runtimeService.Commit();
        }
Beispiel #4
0
        public List <ERP_C001_Code> GetListByCodeID(string codeID)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;
            var         q        = this.ERP_C001_CodeRepository.GetMany(i => i.CodeID == codeID);

            return(q.ToList());
        }
        public void Create(WMS_MatConsume_ActMatDetail WMS_MatConsume_ActMatDetail)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_MatConsume_ActMatDetail.Validate();
            this.WMS_MatConsume_ActMatDetailRepository.Add(WMS_MatConsume_ActMatDetail);
            this.runtimeService.Commit();
        }
Beispiel #6
0
        private void MainTreeForm_Load(object sender, EventArgs e)
        {
            this.Text = "MES管理系统 (" + appCacheService.GetItem("CompName") as string + ")";
            tb_Sys_User user = appCacheService.GetItem("user") as tb_Sys_User;

            labUserName.Text  = "用户名:" + user.UserName;
            labLoginTime.Text = "登录时间:" + DateTime.Now.ToString();
        }
Beispiel #7
0
        public void Create(MES_M801_Label_S MES_M801_Label_S)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M801_Label_S.Validate();
            this.MES_M801_Label_SRepository.Add(MES_M801_Label_S);
            this.runtimeService.Commit();
        }
Beispiel #8
0
        public void Save(WMS_C104_OutStore outstore, List <WMS_C105_OutStoreDetail> outstoreDetailList)
        {
            tb_Sys_User tempUser    = appCacheService.GetItem("user") as tb_Sys_User;
            var         existslotTx = this.GetById(outstore.Id);

            if (existslotTx == null)
            {
                outstore.CompCode   = tempUser.CompCode;
                outstore.CreateDt   = DateTime.Now;
                outstore.CreateUser = tempUser.UserName;
                outstore.Validate();
                this.WMS_C104_OutStoreRepository.Add(outstore);
            }
            else
            {
                outstore.ModifyDt   = DateTime.Now;
                outstore.ModifyUser = tempUser.UserName;
                outstore.Validate();
                this.WMS_C104_OutStoreRepository.SetValues(outstore, existslotTx);
            }
            if (outstoreDetailList != null)
            {
                foreach (var detail in outstoreDetailList)
                {
                    var existstoutStoreDetail = this.outStoreDetailRepository.GetByID(detail.Id);
                    if (existstoutStoreDetail == null)
                    {
                        //var stock = this.stockRepostiroy.GetMany(i => i.Id == detail.StockId).FirstOrDefault();
                        var stock = this.stockRepostiroy.GetMany(i => i.ARCode == detail.ARCode && i.PartSpec == detail.PartSpec && i.MatClass2 == detail.MatClass2).FirstOrDefault();
                        if (stock == null)
                        {
                            throw new AppException(string.Format("出库单'{0}'在位置'{1}'没有库存,请检查", detail.OutSotreNo, detail.ARCode));
                        }
                        if (detail.Amount > stock.StoreAmount)
                        {
                            throw new AppException(string.Format("出库单'{0}'在位置'{1}'的库存小于出库数量,请检查", detail.OutSotreNo, detail.ARCode));
                        }
                        detail.CompCode   = tempUser.CompCode;
                        detail.CreateDt   = DateTime.Now;
                        detail.CreateUser = tempUser.UserName;
                        detail.Validate();
                        this.outStoreDetailRepository.Add(detail);
                        //更新库存
                        stock.StoreAmount = stock.StoreAmount - detail.Amount;
                    }
                    else
                    {
                        if (existstoutStoreDetail.Amount != detail.Amount)
                        {
                            throw new AppException(string.Format("出库单'{0}'在位置'{1}'的已经出库,无法修改", detail.OutSotreNo, detail.ARCode));
                        }
                        detail.Validate();
                        this.outStoreDetailRepository.SetValues(detail, existstoutStoreDetail);
                    }
                }
            }
            this.runtimeService.Commit();
        }
Beispiel #9
0
        public void Create(MES_M202_Task_JobLot MES_M202_Task_JobLot)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M202_Task_JobLot.CompCode = tempUser.CompCode;
            MES_M202_Task_JobLot.Validate();
            this.MES_M202_Task_JobLotRepository.Add(MES_M202_Task_JobLot);
            this.runtimeService.Commit();
        }
        public void Create(ERP_M001_Product_ProcessFlow ERP_M001_Product_ProcessFlow)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_M001_Product_ProcessFlow.CompCode = tempUser.CompCode;
            ERP_M001_Product_ProcessFlow.Validate();
            this.ERP_M001_Product_ProcessFlowRepository.Add(ERP_M001_Product_ProcessFlow);
            this.runtimeService.Commit();
        }
Beispiel #11
0
        /// <summary>
        /// baocun
        /// </summary>
        /// <param name="job"></param>
        /// <param name="lotList"></param>
        public void Save(MES_M002_Job job, List <MES_M002_Job_Lot> lotList, List <MES_M002_Job_Lot_Process> jobLotProcessList)
        {
            tb_Sys_User tempUser  = appCacheService.GetItem("user") as tb_Sys_User;
            var         existsJob = this.GetById(job.Id);

            if (existsJob == null)
            {
                job.CompCode   = tempUser.CompCode;
                job.CreateDt   = DateTime.Now;
                job.CreateUser = tempUser.UserName;
                job.Validate();
                this.MES_M002_JobRepository.Add(job);
            }
            else
            {
                job.ModifyDt   = DateTime.Now;
                job.ModifyUser = tempUser.UserName;
                job.Validate();
                this.MES_M002_JobRepository.SetValues(job, existsJob);
            }
            if (lotList != null)
            {
                foreach (var lot in lotList)
                {
                    var existstlot = this.jobLotRepository.GetByID(lot.Id);
                    if (existstlot == null)
                    {
                        lot.CompCode   = tempUser.CompCode;
                        lot.CreateDt   = DateTime.Now;
                        lot.CreateUser = tempUser.UserName;
                        lot.Validate();
                        this.jobLotRepository.Add(lot);
                    }
                    else
                    {
                        //lot.ModifyDt = DateTime.Now;
                        lot.ModifyUser = tempUser.UserName;
                        lot.Validate();
                        this.jobLotRepository.SetValues(lot, existstlot);
                    }
                }
            }
            if (jobLotProcessList != null && jobLotProcessList.Count > 0)
            {
                string Sqlcommand = string.Format("delete dbo.MES_M002_Job_Lot_Process where JobNo = '{0}'", job.JobNo);
                joblotProcessRepository.GetDbContext().Database.ExecuteSqlCommand(Sqlcommand);
                foreach (var lotProcess in jobLotProcessList)
                {
                    lotProcess.CompCode   = tempUser.CompCode;
                    lotProcess.CreateDt   = DateTime.Now;
                    lotProcess.CreateUser = tempUser.UserName;
                    lotProcess.Validate();
                    this.joblotProcessRepository.Add(lotProcess);
                }
            }
            this.runtimeService.Commit();
        }
Beispiel #12
0
        public void Create(MES_M501_JobTxProdInfo MES_M501_JobTxProdInfo)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M501_JobTxProdInfo.CompCode = tempUser.CompCode;
            MES_M501_JobTxProdInfo.Validate();
            this.MES_M501_JobTxProdInfoRepository.Add(MES_M501_JobTxProdInfo);
            this.runtimeService.Commit();
        }
        public void Create(ERP_C006_ProcessFlow_ProdInfo ERP_C006_ProcessFlow_ProdInfo)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_C006_ProcessFlow_ProdInfo.CompCode = tempUser.CompCode;
            ERP_C006_ProcessFlow_ProdInfo.Validate();
            this.ERP_C006_ProcessFlow_ProdInfoRepository.Add(ERP_C006_ProcessFlow_ProdInfo);
            this.runtimeService.Commit();
        }
        public void Create(ERP_M001_Product_ProdInfo ERP_M001_Product_ProdInfo)
        {
            ERP_M001_Product_ProdInfo.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_M001_Product_ProdInfo.CreateUser = tempUser.UserName;
            ERP_M001_Product_ProdInfo.Validate();
            this.ERP_M001_Product_ProdInfoRepository.Add(ERP_M001_Product_ProdInfo);
            this.runtimeService.Commit();
        }
Beispiel #15
0
        public void Create(WMS_MatConsume_ActMat WMS_MatConsume_ActMat)
        {
            WMS_MatConsume_ActMat.CreatDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_MatConsume_ActMat.CreateUser = tempUser.UserName;
            WMS_MatConsume_ActMat.Validate();
            this.WMS_MatConsume_ActMatRepository.Add(WMS_MatConsume_ActMat);
            this.runtimeService.Commit();
        }
Beispiel #16
0
        public void Create(DEV_D001_Device DEV_D001_Device)
        {
            DEV_D001_Device.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            DEV_D001_Device.CreateUser = tempUser.UserName;
            DEV_D001_Device.Validate();
            this.DEV_D001_DeviceRepository.Add(DEV_D001_Device);
            this.runtimeService.Commit();
        }
        public void Create(MES_M002_Job_Lot_Process MES_M002_Job_Lot_Process)
        {
            MES_M002_Job_Lot_Process.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M002_Job_Lot_Process.CreateUser = tempUser.UserName;
            MES_M002_Job_Lot_Process.Validate();
            this.MES_M002_Job_Lot_ProcessRepository.Add(MES_M002_Job_Lot_Process);
            this.runtimeService.Commit();
        }
        public void Update(ERP_C006_ProcessFlow_ProdInfo ERP_C006_ProcessFlow_ProdInfo)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_C006_ProcessFlow_ProdInfo.Validate();
            var existstb_Sys_Menu = this.GetById(ERP_C006_ProcessFlow_ProdInfo.Id);

            this.ERP_C006_ProcessFlow_ProdInfoRepository.SetValues(ERP_C006_ProcessFlow_ProdInfo, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Beispiel #19
0
        public void Create(MES_M501_JobTx_NG MES_M501_JobTx_NG)
        {
            MES_M501_JobTx_NG.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M501_JobTx_NG.CreateUser = tempUser.UserName;
            MES_M501_JobTx_NG.Validate();
            this.MES_M501_JobTx_NGRepository.Add(MES_M501_JobTx_NG);
            this.runtimeService.Commit();
        }
Beispiel #20
0
        public void Create(ESOP_Product ESOP_Product)
        {
            ESOP_Product.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ESOP_Product.CreateUser = tempUser.UserName;
            ESOP_Product.Validate();
            this.productRepository.Add(ESOP_Product);
            this.runtimeService.Commit();
        }
Beispiel #21
0
        public void Create(WMS_M002_StockTx WMS_M002_StockTx)
        {
            WMS_M002_StockTx.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_M002_StockTx.CreateUser = tempUser.UserName;
            WMS_M002_StockTx.Validate();
            this.WMS_M002_StockTxRepository.Add(WMS_M002_StockTx);
            this.runtimeService.Commit();
        }
Beispiel #22
0
        public void Create(ERP_M002_BOM_Material ERP_M002_BOM_Material)
        {
            ERP_M002_BOM_Material.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_M002_BOM_Material.CreateUser = tempUser.UserName;
            ERP_M002_BOM_Material.Validate();
            this.ERP_M002_BOM_MaterialRepository.Add(ERP_M002_BOM_Material);
            this.runtimeService.Commit();
        }
Beispiel #23
0
        public void Create(MES_M003_LotTx_NG_Clone MES_M003_LotTx_NG_Clone)
        {
            MES_M003_LotTx_NG_Clone.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M003_LotTx_NG_Clone.CreateUser = tempUser.UserName;
            MES_M003_LotTx_NG_Clone.Validate();
            this.MES_M003_LotTx_NG_CloneRepository.Add(MES_M003_LotTx_NG_Clone);
            this.runtimeService.Commit();
        }
        public void Create(SUPP_M001_PurPlan_Detail SUPP_M001_PurPlan_Detail)
        {
            SUPP_M001_PurPlan_Detail.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            SUPP_M001_PurPlan_Detail.CreateUser = tempUser.UserName;
            SUPP_M001_PurPlan_Detail.Validate();
            this.SUPP_M001_PurPlan_DetailRepository.Add(SUPP_M001_PurPlan_Detail);
            this.runtimeService.Commit();
        }
Beispiel #25
0
        public void Create(MES_M201_Plan_Material MES_M201_Plan_Material)
        {
            MES_M201_Plan_Material.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M201_Plan_Material.CreateUser = tempUser.UserName;
            MES_M201_Plan_Material.Validate();
            this.MES_M201_Plan_MaterialRepository.Add(MES_M201_Plan_Material);
            this.runtimeService.Commit();
        }
Beispiel #26
0
        public void Create(ERP_M003_InStore ERP_M003_InStore)
        {
            ERP_M003_InStore.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_M003_InStore.CreateUser = tempUser.UserName;
            ERP_M003_InStore.Validate();
            this.ERP_M003_InStoreRepository.Add(ERP_M003_InStore);
            this.runtimeService.Commit();
        }
Beispiel #27
0
        public void Create(MES_M802_Packing_Hd MES_M802_Packing_Hd)
        {
            MES_M802_Packing_Hd.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M802_Packing_Hd.CreateUser = tempUser.UserName;
            MES_M802_Packing_Hd.Validate();
            this.MES_M802_Packing_HdRepository.Add(MES_M802_Packing_Hd);
            this.runtimeService.Commit();
        }
        public void Create(WMS_M105_MatReturnDetail WMS_M105_MatReturnDetail)
        {
            WMS_M105_MatReturnDetail.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_M105_MatReturnDetail.CreateUser = tempUser.UserName;
            WMS_M105_MatReturnDetail.Validate();
            this.WMS_M105_MatReturnDetailRepository.Add(WMS_M105_MatReturnDetail);
            this.runtimeService.Commit();
        }
Beispiel #29
0
        public void Create(WMS_C101_WareHouse WMS_C101_WareHouse)
        {
            WMS_C101_WareHouse.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_C101_WareHouse.CreateUser = tempUser.UserName;
            WMS_C101_WareHouse.Validate();
            this.WMS_C101_WareHouseRepository.Add(WMS_C101_WareHouse);
            this.runtimeService.Commit();
        }
        public void Update(WMS_MatConsume_ActMatDetail WMS_MatConsume_ActMatDetail)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_MatConsume_ActMatDetail.Validate();
            var existstb_Sys_Menu = this.GetById(WMS_MatConsume_ActMatDetail.Id);

            this.WMS_MatConsume_ActMatDetailRepository.SetValues(WMS_MatConsume_ActMatDetail, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }