Exemple #1
0
        protected override void InitData()
        {
            var materialList = materialService.GetMaterial().ToList().Select(a => new InputItem {
                Value = a.MatCode, DisPlayName = a.MatCode, InputCode1 = a.MatName, InputCode2 = a.MatSpec, InputCode3 = a.MatClass2
            }).ToList();

            SetGridLookUpEdit(repositoryItemMatSpecCode, materialList, 3);
            //SetGridLookUpEdit(RemarksTextEdit, materialList, "物料代号", "物料名称");
            repositoryItemMatSpecCode.View.Columns[0].Caption = "物料代号";
            repositoryItemMatSpecCode.View.Columns[1].Caption = "物料名称";
            repositoryItemMatSpecCode.View.Columns[2].Caption = "物料规格";
            repositoryItemMatSpecCode.View.Columns[3].Caption = "材质";
            suppList = supplierService.GetSuppler().ToList().Select(a => new InputItem {
                Value = a.SuppCode, DisPlayName = a.Alias, InputCode1 = a.SuppCode
            }).ToList();
            SetGridLookUpEdit(repositoryItemSupplier, suppList, 1);
            repositoryItemMatSpecCode.View.Columns[0].Caption = "供应商简称";
            repositoryItemMatSpecCode.View.Columns[1].Caption = "供应商编号";
            this.wMSM105MatGetBindingSource.DataSource        = tempData;
            var matDetailList = matGetService.GetMatDetailQuery().Where(a => a.RequestNo == tempData.RequestNo).ToList();
            var count         = matDetailList.Count;

            for (int i = 0; i < 20 - count; i++)
            {
                WMS_M105_MatGetDetail bomMat = new WMS_M105_MatGetDetail();
                bomMat.RequestNo = tempData.RequestNo;
                matDetailList.Add(bomMat);
            }
            this.wMSM105MatGetDetailBindingSource.DataSource = matDetailList;
        }
Exemple #2
0
        public override void InitData()
        {
            var materialData = materialServer.GetMaterial().Select(a => new InputItem {
                DisPlayName = a.MatName, Value = a.MatCode, InputCode1 = a.MatCode, InputCode2 = a.MatSpec
            }).ToList();

            SetGridLookUpEdit(repositoryMatCode, materialData, 2);
            SetGridLookUpEdit(repositoryMatCode2, materialData, 2);
            SetGridLookUpEdit(repositoryMatSpec, materialData, 2);
            var suppData = supplierServer.GetSuppler().Select(a => new InputItem {
                DisPlayName = a.Alias, Value = a.SuppCode, InputCode1 = a.SuppCode
            }).ToList();

            SetGridLookUpEdit(repositorySuppCode, suppData, 1);
            gridColumn13.ColumnEdit                      = repositorySuppCode;
            repositoryMatCode2.DisplayMember             = "InputCode1";
            repositoryMatSpec.DisplayMember              = "InputCode2";
            colMatName.ColumnEdit                        = repositoryMatCode;
            colMatSpec2.ColumnEdit                       = repositoryMatSpec;
            colMatCode3.ColumnEdit                       = repositoryMatCode2;
            gridView1.FocusedRowChanged                 += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridView1_FocusedRowChanged);
            gridView2.FocusedRowChanged                 += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridView2_FocusedRowChanged);
            this.sUPPM001PurPlanBindingSource.DataSource = purPlanService.GetList();
            this.gridView1.BestFitColumns();
            gridView1_FocusedRowChanged(null, null);
        }
Exemple #3
0
        protected override void InitData()
        {
            var materialData = materialServer.GetMaterial().Select(a => new InputItem {
                DisPlayName = a.MatName, Value = a.MatCode, InputCode1 = a.MatCode, InputCode2 = a.MatSpec
            }).ToList();

            SetGridLookUpEdit(repositoryMatCode, materialData, 2);
            SetGridLookUpEdit(repositoryMatCode2, materialData, 2);
            SetGridLookUpEdit(repositoryMatSpec, materialData, 2);
            repositoryMatCode2.DisplayMember             = "InputCode1";
            repositoryMatSpec.DisplayMember              = "InputCode2";
            this.sUPPM001PurPlanBindingSource.DataSource = tempData;
            //this.sUPPM001PurPlanDetailBindingSource.DataSource = purPlanService.GetPurDetail().Where(a => a.PurPlNo == tempData.PurPlNo).ToList();
            var purDetailData = purPlanService.GetPurDetail().Where(a => a.PurPlNo == tempData.PurPlNo).ToList();

            if (this.Tag.ToString() == BtnCommandEnum.Add)
            {
                for (int i = 0; i < 20; i++)
                {
                    SUPP_M001_PurPlan_Detail bomMat = new SUPP_M001_PurPlan_Detail();
                    purDetailData.Add(bomMat);
                }
            }
            this.sUPPM001PurPlanDetailBindingSource.DataSource = purDetailData;
        }
Exemple #4
0
        private void repositoryItemMaterial_EditValueChanged(object sender, EventArgs e)
        {
            this.gridMaterial.CloseEditor();
            var model = this.productMaterialViewModelBindingSource.Current as ProductMaterialViewModel;

            if (model != null)
            {
                var material = materialService.GetMaterial().Where(a => a.MatCode == model.MatCode).FirstOrDefault() ?? new ERP_M001_Material();
                model.MatName = material.MatName;
                model.MatSpec = material.MatSpec;
                this.productMaterialViewModelBindingSource.ResetCurrentItem();
            }
        }
Exemple #5
0
        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            string matclass     = e.Node.Tag.ToStr();
            var    materialData = materialService.GetMaterial();

            if (matclass != "全部")
            {
                materialData = materialData.Where(a => a.MatClass1 == matclass);
            }
            this.eRPM001MaterialBindingSource.DataSource = materialData.ToList();
            this.gridView1.BestFitColumns();
            gridView1_FocusedRowChanged(null, null);
        }
Exemple #6
0
        private void repositoryItemMaterial_EditValueChanged(object sender, EventArgs e)
        {
            this.gridMaterial.CloseEditor();
            var detail = this.eRPM002BOMMaterialBindingSource.Current as ERP_M002_BOM_Material;

            if (detail != null)
            {
                var material = materialService.GetMaterial().Where(a => a.MatCode == detail.MatCode).FirstOrDefault() ?? new ERP_M001_Material();
                detail.MatName = material.MatName;
                detail.MatSpec = material.MatSpec;
                this.eRPM002BOMMaterialBindingSource.ResetCurrentItem();
                //this.gridProduct.BestFitColumns();
            }
        }
Exemple #7
0
        /// <summary>
        /// 根据供应商显示物料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            ERP_C003_Supplier temp = eRPC003SupplierBindingSource.Current as ERP_C003_Supplier;

            if (temp != null)
            {
                IERP_M001_MaterialService      materialService = Unity.Instance.GetService <IERP_M001_MaterialService>();
                IERP_C003_Supplier_FileService suppFileService = Unity.Instance.GetService <IERP_C003_Supplier_FileService>();
                var matCodeData = materialService.GetMatSupp().Where(a => a.SuppCode == temp.SuppCode).Select(a => a.MatCode).Distinct().ToList();
                this.ykGridControl2.DataSource = materialService.GetMaterial().Where(a => matCodeData.Contains(a.MatCode)).ToList();
                this.gridView2.BestFitColumns();
                this.eRPC003SupplierFileBindingSource.DataSource = suppFileService.GetQuery().Where(a => a.SuppCode == temp.SuppCode).ToList();
            }
        }
Exemple #8
0
        protected override void InitData()
        {
            var suppData = supplierServer.GetSuppler().Select(a => new InputItem {
                DisPlayName = a.SuppName, Value = a.SuppCode, InputCode1 = a.SuppCode
            }).ToList();

            SetGridLookUpEdit(repositorySuppCode, suppData, 1);
            var materialData = materialService.GetMaterial().Select(a => new InputItem {
                DisPlayName = a.MatName, Value = a.MatCode, InputCode1 = a.MatCode, InputCode2 = a.MatClass2, InputCode3 = a.MatSpec
            }).ToList();

            SetGridLookUpEdit(repositoryMatCode, materialData, 1);
            SetGridLookUpEdit(txtMatCode, materialData, 3);
        }
Exemple #9
0
        protected override void InitData()
        {
            var suppData = supplierServer.GetSuppler().Select(a => new InputItem {
                DisPlayName = a.Alias, Value = a.SuppCode, InputCode1 = a.SuppCode
            }).ToList();

            SetGridLookUpEdit(repositorySuppCode, suppData, 1);
            var materialData = materialServer.GetMaterial().Select(a => new InputItem {
                DisPlayName = a.MatName, Value = a.MatCode, InputCode1 = a.MatCode, InputCode2 = a.MatSpec
            }).ToList();

            SetGridLookUpEdit(repositoryMatCode, materialData, 2);
            SetGridLookUpEdit(repositoryMatCode2, materialData, 2);
            SetGridLookUpEdit(repositoryMatSpec, materialData, 2);
            repositoryMatCode2.DisplayMember             = "InputCode1";
            repositoryMatSpec.DisplayMember              = "InputCode2";
            this.sUPPM001PurPlanBindingSource.DataSource = tempData;
            if (this.Tag.ToString() == BtnCommandEnum.Add)
            {
                var purDetailData = purPlanService.GetPurDetail().Where(a => a.PurPlNo == tempData.PurPlNo).ToList();
                var matCodeList   = purDetailData.Select(a => a.MatCode).Distinct().ToList();
                var matSuppData   = materialServer.GetMatSupp().Where(a => matCodeList.Contains(a.MatCode)).ToList();
                var purMatData    = matSuppData.Select(a => new SUPP_M001_PurPlan_Material()
                {
                    CompCode = a.CompCode, MatCode = a.MatCode, PurPlNo = tempData.PurPlNo, SuppCode = a.SuppCode, SuppPurPer = a.PurPer, SuppLevel = a.Level, PurQty = a.DeliveryDays ?? 0
                }).ToList();
                foreach (var purMat in purMatData)
                {
                    if (purMat.PurQty > 0)
                    {
                        purMat.DeliveryDt = ((DateTime)tempData.TxDt).AddDays((Int32)purMat.PurQty);
                    }
                    SUPP_M001_PurPlan_Detail purDetail = purDetailData.Where(a => a.MatCode == purMat.MatCode).FirstOrDefault();
                    if (purDetail != null)
                    {
                        purMat.PurQty  = purDetail.PurQty;
                        purMat.SuppQty = purMat.PurQty * purMat.SuppPurPer;
                    }
                }
                this.sUPPM001PurPlanMaterialBindingSource.DataSource = purMatData.OrderBy(a => a.MatCode).ToList();
            }
            else
            {
                this.sUPPM001PurPlanMaterialBindingSource.DataSource = purPlanService.GetPurMat().Where(a => a.PurPlNo == tempData.PurPlNo).OrderBy(a => a.MatCode).ToList();
            }
        }
Exemple #10
0
        protected override void InitData()
        {
            var suppData = supplierServer.GetSuppler().Select(a => new InputItem {
                DisPlayName = a.Alias, Value = a.SuppCode, InputCode1 = a.SuppCode
            }).ToList();

            SetGridLookUpEdit(SuppCodeTextEdit, suppData, 1);
            materialData = materialServer.GetMaterial().Select(a => new InputItem {
                DisPlayName = a.MatName, Value = a.MatCode, InputCode1 = a.MatCode, InputCode2 = a.MatSpec, InputCode3 = a.MatClass2
            }).ToList();
            SetGridLookUpEdit(repositoryMatCode, materialData, 3);
            var areaData = areaService.GetAreaQuery().Where(a => a.StockArea == tempData.StockArea).Select(a => new InputItem {
                DisPlayName = a.ARName, Value = a.ARCode
            }).ToList();

            SetGridLookUpEdit(repositoryAreaCode, areaData, 0);
            //SetGridLookUpEdit(repositoryMatSpec, materialData, 2);
            //SetGridLookUpEdit(repositoryMatClass2, materialData, 2);
            //repositoryMatClass2.DisplayMember = "InputCode3";
            //repositoryMatSpec.DisplayMember = "InputCode2";
            //repositoryMatClass2.ValueMember = "InputCode3";
            //repositoryMatSpec.ValueMember = "InputCode2";
            this.wMSC101InStoreBindingSource.DataSource = tempData;
            var storeDetailList = instoreService.GetDetailListByInstoreId(tempData.Id);

            if (this.Tag.ToString() == BtnCommandEnum.Add)
            {
                for (int i = 0; i < 20; i++)
                {
                    WMS_C102_InStoreDetail storeDetail = new WMS_C102_InStoreDetail();

                    storeDetailList.Add(storeDetail);
                }
            }
            this.wMSC102InStoreDetailBindingSource.DataSource = storeDetailList;
        }