示例#1
0
        public ActionResult Settings(settings model)
        {
            if (ModelState.IsValid)
                try
                {
                    settings.Insert(model);

                    ViewData["Info"] = "Налаштування збережено";
                }
                catch (Exception ex)
                {
                    ViewData["Error"] = _ErrorChatcher.ShowError(ex.Message, "Помилка");
                }

            return View(model);
        }
示例#2
0
        private static settings SetDefaultValue()
        {
            settings model = new settings()
            {
                countValue = 6,
                id_settings = 0,
                maxValue = 42,
                minValue = 1,
                minJackPot = 500,
                stepJackPot = 1,
                timeAfterDraw = 0,
                timeBeforeDraw = 0,
                timeDraw = 100
            };

            return model;
        }
示例#3
0
        public static void Insert(settings model)
        {
            try
            {
                DataBaseLayer.LoterejaEntities dbc = new DataBaseLayer.LoterejaEntities();

                dbc.settings.Add((DataBaseLayer.setting)model);
                dbc.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }