Esempio n. 1
0
        private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
        {
            if (this.action == "insert" || this.action == "update")
            {
                if (this.gridView1.FocusedColumn.Name == "gridColumnProductUnit")
                {
                    if (this.gridView1.FocusedColumn.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemComboBox)
                    {
                        Model.Product p = (this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as Model.ProduceTransferDetail).Product;

                        this.repositoryItemComboBox1.Items.Clear();
                        if (p != null)
                        {
                            if (!string.IsNullOrEmpty(p.BasedUnitGroupId))
                            {
                                BL.ProductUnitManager     manager  = new Book.BL.ProductUnitManager();
                                IList <Model.ProductUnit> unitList = manager.Select(p.BasedUnitGroup);
                                foreach (Model.ProductUnit item in unitList)
                                {
                                    this.repositoryItemComboBox1.Items.Add(item.CnName);
                                }
                            }
                        }
                    }
                }
                if (this.gridView1.FocusedColumn.Name == "gridProceduresOut" || this.gridView1.FocusedColumn.Name == "gridProceduresIn")
                {
                    if (this.gridView1.FocusedColumn.ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemComboBox)
                    {
                        this.repositoryItemComboBox2.Items.Clear();
                        Model.Product p = (this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as Model.ProduceTransferDetail).Product;
                        if (p != null)
                        {
                            Model.BomParentPartInfo bom = new BL.BomParentPartInfoManager().Get(p);
                            if (bom == null)
                            {
                                return;
                            }
                            Model.TechonlogyHeader th = new BL.TechonlogyHeaderManager().GetDetail(bom.TechonlogyHeaderId);

                            if (th != null)
                            {
                                foreach (Model.Technologydetails item in th.detail)
                                {
                                    this.repositoryItemComboBox2.Items.Add(item.Procedures.Id);
                                }
                            }
                        }
                    }
                }

                this.gridControl1.RefreshDataSource();
            }
        }
        //bool isFirst = true;

        protected override void LoadData()
        {
            BL.TechonlogyHeaderManager manager = this.manager as BL.TechonlogyHeaderManager;

            this.BomBomTechonlogyHeaderSource.DataSource = manager.Select();
        }