Example #1
0
        private void MunCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Equipment_Data EqD = new Equipment_Data();

            string SelItemMun = (((ComboBoxItem)(MunCombo.SelectedItem)).Content).ToString();
            int    SelModID   = 0;

            List <Equipment_Base> Eq_Data = EqD.GetData();

            foreach (var item in Eq_Data)
            {
                if (item.ManufacturerName.ToString() == SelItemMun)
                {
                    SelModID = item.intModelID;
                }
            }

            try
            {
                Model_Data modDB    = new Model_Data();
                int        i        = 0;
                int        NumOfRow = modDB.Model_Table.Count;

                ComboBoxItem[] itemsMod = new ComboBoxItem[NumOfRow];
                ModCombo.Items.Clear();

                bool first = true;
                bool teg   = false;
                foreach (var item in modDB.Model_Table)
                {
                    if (SelModID == item.intModelID)
                    {
                        teg         = true;
                        itemsMod[i] = new ComboBoxItem
                        {
                            Content    = item.strName,
                            IsSelected = first
                        };
                        ModCombo.Items.Add(itemsMod[i]);
                        i++;
                    }
                }
                if (teg == false)
                {
                    itemsMod[i] = new ComboBoxItem
                    {
                        Content = "Нет моделей"
                    };
                    ModCombo.Items.Add(itemsMod[i]);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        public ActionResult Model_add(Model_Data model_Data)
        {
            var files = FileManager.FileUpload2();

            if (files.Count() > 0)
            {
                var _insert = new Model_Data()
                {
                    M_name        = model_Data.M_name,
                    Category      = model_Data.Category,
                    M_age         = model_Data.M_age,
                    M_country     = model_Data.M_country,
                    M_city        = model_Data.M_city,
                    M_height      = model_Data.M_height,
                    M_content     = model_Data.M_content,
                    MainImgPath   = "http://supertalent.theblueeye.com/Upload2/" + files[0],
                    M_facebook    = model_Data.M_facebook,
                    M_youtube     = model_Data.M_youtube,
                    M_insta       = model_Data.M_insta,
                    M_country_img = "http://supertalent.theblueeye.com/Upload2/country_img/" + model_Data.M_country_img + ".png",
                    M_language    = model_Data.M_language,
                    M_season      = model_Data.M_season,
                };
                db.Model_Data.Add(_insert);
                db.SaveChanges();

                return(Content("<html><script>alert('모델 리스트 페이지로 이동합니다.'); window.top.location.href = '/Admin/Model_list';</script></html>"));
            }
            else
            {
                var _insert2 = new Model_Data()
                {
                    M_name        = model_Data.M_name,
                    Category      = model_Data.Category,
                    M_age         = model_Data.M_age,
                    M_country     = model_Data.M_country,
                    M_city        = model_Data.M_city,
                    M_height      = model_Data.M_height,
                    M_content     = model_Data.M_content,
                    M_facebook    = model_Data.M_facebook,
                    M_youtube     = model_Data.M_youtube,
                    M_insta       = model_Data.M_insta,
                    M_country_img = "http://supertalent.theblueeye.com/Upload2/country_img" + model_Data.M_country_img,
                    M_language    = model_Data.M_language,
                    M_season      = model_Data.M_season,
                };
                db.Model_Data.Add(_insert2);
                db.SaveChanges();

                return(Content("<html><script>alert('모델 리스트 페이지로 이동합니다.'); window.top.location.href = '/Admin/Model_list';</script></html>"));
            }
        }
Example #3
0
        public static void BubbleSortByCharField(Model_Data[] AllData)
        {
            int length = AllData.Length;

            for (int i = 0; i < length - 1; i++)
            {
                for (int j = 0; j < length - (i + 1); j++)
                {
                    if (Model_Data.GreaterThanString(AllData[j].Grupo.ToString(), AllData[j + 1].Grupo.ToString()))
                    {
                        char switcher;
                        switcher             = AllData[j].Grupo;
                        AllData[j].Grupo     = AllData[j + 1].Grupo;
                        AllData[j + 1].Grupo = switcher;
                    }
                }
            }
        }
Example #4
0
        public static void BubbleSortByStringField(Model_Data[] AllData)
        {
            int length = AllData.Length;

            for (int i = 0; i < length - 1; i++)
            {
                for (int j = 0; j < length - (i + 1); j++)
                {
                    if (Model_Data.GreaterThanString(AllData[j].Titulo, AllData[j + 1].Titulo))
                    {
                        string switcher = null;
                        switcher              = AllData[j].Titulo;
                        AllData[j].Titulo     = AllData[j + 1].Titulo;
                        AllData[j + 1].Titulo = switcher;
                    }
                }
            }
        }
Example #5
0
        public static void BubbleSortByBoolField(Model_Data[] AllData)
        {
            int length = AllData.Length;

            for (int i = 0; i < length - 1; i++)
            {
                for (int j = 0; j < length - (i + 1); j++)
                {
                    if (Model_Data.GreaterThanBool(AllData[j].Disponibilidade, AllData[j + 1].Disponibilidade))
                    {
                        bool switcher = false;
                        switcher = AllData[j].Disponibilidade;
                        AllData[j].Disponibilidade     = AllData[j + 1].Disponibilidade;
                        AllData[j + 1].Disponibilidade = switcher;
                    }
                }
            }
        }
Example #6
0
        public ActionResult Model_edit(Model_Data model_Data)
        {
            var files = FileManager.FileUpload2();

            var _data = db.Model_Data.Find(model_Data.id);

            if (files.Count() > 0)
            {
                _data.Category    = model_Data.Category;
                _data.M_season    = model_Data.M_season;
                _data.M_name      = model_Data.M_name;
                _data.M_age       = model_Data.M_age;
                _data.M_country   = model_Data.M_country;
                _data.M_city      = model_Data.M_city;
                _data.M_height    = model_Data.M_height;
                _data.M_language  = model_Data.M_language;
                _data.M_facebook  = model_Data.M_facebook;
                _data.M_insta     = model_Data.M_insta;
                _data.M_youtube   = model_Data.M_youtube;
                _data.MainImgPath = "http://supertalent.theblueeye.com/Upload/" + files[0];

                db.SaveChanges();
            }
            else
            {
                _data.Category   = model_Data.Category;
                _data.M_season   = model_Data.M_season;
                _data.M_name     = model_Data.M_name;
                _data.M_age      = model_Data.M_age;
                _data.M_country  = model_Data.M_country;
                _data.M_city     = model_Data.M_city;
                _data.M_height   = model_Data.M_height;
                _data.M_language = model_Data.M_language;
                _data.M_facebook = model_Data.M_facebook;
                _data.M_insta    = model_Data.M_insta;
                _data.M_youtube  = model_Data.M_youtube;

                db.SaveChanges();
            }

            return(Content("<html><script>alert('모델이 수정 되었습니다.'); window.top.location.href = '/Admin/Model_list';</script></html>"));
        }
Example #7
0
 public ViewModel_Main()
 {
     Data1            = new Model_Data();
     ClickTestCommand = new CommandBase(clickTestCommand);
     ClickOpenCommand = new CommandBase(clickOpenCommand);
 }
Example #8
0
        }                                    //数据引用声明

        public ViewModel_MVVMExample()
        {
            Data1 = new Model_Data();
        }