示例#1
0
        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            var s = listBox2.SelectedItem;

            var k1 = listBox2.SelectedIndex;

            if (SelectedOpt != null)
            {
                if (SelectedOpt.Key != textBox2.Text || SelectedOpt.Value != textBox3.Text)
                {
                    button3_Click(null, null);
                    listBox2.SetSelected(k1, true);
                }
            }

            if (s == null)
            {
                return;
            }
            foreach (var k in SelectedCheckBox.Options)
            {
                if (k.Value == s.ToString())
                {
                    SelectedOpt   = k;
                    textBox2.Text = k.Key;
                    textBox3.Text = k.Value;
                }
            }
        }
示例#2
0
 private void button8_Click(object sender, EventArgs e)
 {
     SelectedCheckBox.Options.Remove(SelectedOpt);
     FillLst();
     textBox2.Text = "";
     textBox3.Text = "";
     SelectedOpt   = new NGOPT();
 }
示例#3
0
 private void button6_Click(object sender, EventArgs e)
 {
     SelectedCombo.Options.Remove(SelectedOption);
     SelectedOption = null;
     FillTexts(true);
     FillOptList();
     textBox1.Text  = "";
     textBox2.Text  = "";
     SelectedOption = new NGOPT();
 }
示例#4
0
        private void button4_Click(object sender, EventArgs e)
        {
            SelectedOption       = new NGOPT();
            SelectedOption.Key   = "Key";
            SelectedOption.Value = "Value";
            SelectedCombo.Options.Add(SelectedOption);
            var ss = SelectedCombo.Options.Select(x => x.Key).ToList();

            FillOpt();
            CommonFunctions.FillList(listBox2, ss);
        }
示例#5
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            NGOPT opt = new NGOPT();

            opt.Key = "Key";
            var s = SelectedCheckBox.Options.Select(x => x.Value).ToList();

            opt.Value   = CommonFunctions.GetNewName("Value", s);
            SelectedOpt = opt;
            FillTexts();
            SelectedCheckBox.Options.Add(opt);
            FillLst();
            CommonFunctions.SelectList(listBox2, opt.Value);
        }
示例#6
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            var s  = listBox1.SelectedItem;
            var k1 = listBox1.SelectedIndex;

            if (SelectedCombo != null)
            {
                if (SelectedCombo.Name != textBox3.Text)
                {
                    button2_Click(null, null);
                    listBox1.SetSelected(k1, true);
                }
            }

            //var s = listBox1.SelectedItem;
            if (s == null)
            {
                return;
            }
            foreach (var k in CombosList)
            {
                if (k.Name == s.ToString())
                {
                    SelectedCombo = k;
                    textBox3.Text = k.Name;
                    try
                    {
                        if (SelectedCombo.IsFixed == true)
                        {
                            radioButton1.Checked = true;
                        }
                        else
                        {
                            radioButton2.Checked = true;
                        }
                        comboBox1.SelectedIndex = GetIndex(comboBox1, k.ServiceName);
                        comboBox3.SelectedIndex = GetIndex(comboBox3, k.Key);
                        comboBox2.SelectedIndex = GetIndex(comboBox2, k.Value);
                    }
                    catch
                    { }
                }
            }
            FillOptList();
            SelectedOption = null;
            textBox1.Text  = "";
            textBox2.Text  = "";
        }
示例#7
0
        private void button4_Click_1(object sender, EventArgs e)
        {
            NGOPT opt = new NGOPT();
            var   ss  = SelectedCombo.Options.Select(x => x.Key).ToList();

            opt.Key   = CommonFunctions.GetNewName("Key", ss);
            ss        = SelectedCombo.Options.Select(x => x.Value).ToList();
            opt.Value = CommonFunctions.GetNewName("Value", ss);
            SelectedCombo.Options.Add(opt);
            SelectedOption = opt;
            FillTexts();
            FillOpt();
            FillOptList();

            CommonFunctions.SelectList(listBox2, SelectedOption.Key);
        }
        public static NgProject ToNgProgect(NgProject2 ng1)
        {
            NgProject ng = new NgProject();

            ng.Name = ng1.Name;
            ng.Path = ng1.Path;
            ng.MenuesList.Clear();
            ng.NetProject.DataBaseConnectionString = ng1.NetProject.DataBaseConnectionString;

            foreach (var ss in ng1.RadiosList)
            {
                NgRadio ch = new NgRadio();
                ch.Name = ss.Name;
                foreach (var op in ss.Options)
                {
                    NGOPT op1 = new NGOPT();
                    op1.Key   = op.Key;
                    op1.Value = op.Value;
                    ch.Options.Add(op1);
                }
                ng.RadiosList.Add(ch);
            }

            foreach (var ss in ng1.CombosList)
            {
                NGCombo cb = new NGCombo();
                cb.ServiceName = ss.ServiceName;
                cb.IsFixed     = ss.IsFixed;
                cb.Name        = ss.Name;
                cb.Key         = ss.Key;
                cb.Value       = ss.Value;
                foreach (var op in ss.Options)
                {
                    NGOPT op1 = new NGOPT();
                    op1.Key   = op.Key;
                    op1.Value = op.Value;
                    cb.Options.Add(op1);
                }
                ng.CombosList.Add(cb);
            }

            foreach (string ss in ng1.MenuesList)
            {
                ng.MenuesList.Add(ss);
            }
            foreach (var mn1 in ng1.Menues)
            {
                NgMenu mn = new NgMenu();
                mn.Index = mn1.Index;
                mn.Name  = mn1.Name;
                foreach (var s1 in mn1.Submenues)
                {
                    NgSubMenu s = new NgSubMenu();
                    foreach (var ts in s1.TabNameList)
                    {
                        s.TabNameList.Add(ts);
                    }
                    s.NetClassName       = s1.NetClassName;
                    s.CreateThisForm     = s1.CreateThisForm;
                    s.AllowAddNewFeature = s1.AllowAddNewFeature;
                    s.AllowEditFeature   = s1.AllowEditFeature;
                    s.AllowMultiDelete   = s1.AllowMultiDelete;
                    s.AllowDelete        = s1.AllowDelete;
                    s.DeleteFormMessage  = s1.DeleteFormMessage;
                    s.DeleteFormTitle    = s1.DeleteFormTitle;
                    s.DisplayName        = s1.DisplayName;
                    s.Index                = s1.Index;
                    s.IsTabbed             = s1.IsTabbed;
                    s.Name                 = s1.Name;
                    s.NumberOfRowsInPaging = s1.NumberOfRowsInPaging;
                    s.Tabs                 = s1.Tabs;
                    s.Menues               = s1.Menues;

                    NgFileProp m1 = new NgFileProp();
                    m1.Name = s1.Model.Name;
                    foreach (var f1 in s1.Model.Fields)
                    {
                        NgField f = new NgField();
                        f.IsIdentity           = f1.IsIdentity;
                        f.DisplayName          = f1.DisplayName;
                        f.ErrorMessage         = f1.ErrorMessage;
                        f.IncludeInSearch      = f1.IncludeInSearch;
                        f.SearchCondition      = f1.SearchCondition;
                        f.Index                = f1.Index;
                        f.Length               = f1.Length;
                        f.IsValidationRequired = f1.IsValidationRequired;
                        f.OriginalName         = f1.OriginalName;
                        f.TabName              = f1.TabName;
                        f.TabsRequired         = f1.TabsRequired;
                        f.ToDisplayInControls  = f1.ToDisplayInControls;
                        f.ToDisplayInGrid      = f1.ToDisplayInGrid;
                        f.Type           = f1.Type;
                        f.NetType        = f1.NetType;
                        f.ComboBoxSource = f1.ComboBoxSource;
                        f.RadioBoxSource = f1.RadioBoxSource;
                        f.IsPrimaryKey   = f1.IsPrimaryKey;
                        //f.CheckBoxSource = f1.CheckBoxSource;
                        foreach (var ss in ng1.CombosList)
                        {
                            if (ss.Name == f1.ComboBoxSource)
                            {
                                f.ComboxBox = ss;
                            }
                        }
                        foreach (var ss in ng1.RadiosList)
                        {
                            if (ss.Name == f1.RadioBoxSource)
                            {
                                f.RadioButton = ss;
                            }
                        }
                        f.ControlType = f1.ControlType;
                        m1.Fields.Add(f);
                    }
                    s.Model = m1;

                    mn.Submenues.Add(s);
                }
                ng.Menues.Add(mn);
            }
            return(ng);
        }