Ejemplo n.º 1
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();
            }
        }