예제 #1
0
        private void btImport_Click(object sender, EventArgs e)
        {
            SelectMMDefForm form = new SelectMMDefForm();
            EncodeCollection <SupAndMMRelation> ec = new EncodeCollection <SupAndMMRelation>();

            if (form.ShowDialog() == DialogResult.OK)
            {
                var definitions = form.SelectedItems;
                if (definitions != null)
                {
                    foreach (var def     in definitions)
                    {
                        if (SupAndMMRelation.Instance.Datas.FirstOrDefault(p => p.Enable && p.DefPK == def.DefPK && p.SupPK == grid.SupPK) == null)
                        {
                            SupAndMMRelation supAndMMRelation = new SupAndMMRelation
                            {
                                DefID     = def.DefID,
                                SupPK     = grid.SupPK,
                                ParamName = def.DefName,
                                State     = DataState.New
                            };
                            grid.Encodes.Add(supAndMMRelation);
                            grid.InsertRow(grid.RowsCount - 1, supAndMMRelation);
                            // ec.Add(supAndMMRelation);
                        }
                    }
                }

                // grid.InsertRow(,ec);
            }
            //List<MMDefinition> mmdefList = form.SelectedItems;
        }
예제 #2
0
        private void TxtSelectDefinition_Click(object sender, EventArgs e)
        {
            List <int>         Ids  = null;
            SelectSupandMMForm form = new  SelectSupandMMForm(Ids);

            if (form.ShowDialog() == DialogResult.OK)
            {
                SupAndMMRelation sam = form.SelectedItem;
                if (sam != null)
                {
                    SetValue(sam.DefPK);
                    //this.Value = mm.ParamName;
                    //this.Tag = mm;
                }
            }
        }