public ActionResult SettingDefine(settingDefineViewModel model, string returnUrl)
        {
            //if (model.memset.settingId.groupId != null)
            //{
            using (var db = new UsersContext())
            {
                if (model.literalValue == null || model.literalValue == "")
                {
                    ModelState.AddModelError("", "Your setting value is missing, please try again");
                    return View(new searchHeadlineViewModel());
                }
                if (model.settingName == null || model.settingName == "")
                {
                    ModelState.AddModelError("", "Your setting is missing, please try again");
                    return View(new searchHeadlineViewModel());
                }
                var defaultColor = "";
                var defaultFont = "";
                var defaultHighlight = "";
                if (model.settingName == "styleSheet")
                {
                    switch (model.literalValue)
                    {
                        case "Foundation":
                            defaultColor = "Black";
                            defaultFont = "white";
                            defaultHighlight = "white";
                            break;
                        case "Windows":
                            defaultColor = "white";
                            defaultFont = "silver";
                            defaultHighlight = "blue";
                            break;
                    }
                    memberSetting defaultNeeded = db.memberSettings.FirstOrDefault(u => u.UserId.UserId ==
                        WebSecurity.CurrentUserId && u.settingId_settingId.Key == "backgroundColor");
                    memberSetting defaultNeeded2 = db.memberSettings.FirstOrDefault(u => u.UserId.UserId ==
                        WebSecurity.CurrentUserId && u.settingId_settingId.Key == "fontColor");
                    memberSetting defaultNeeded3 = db.memberSettings.FirstOrDefault(u => u.UserId.UserId ==
                        WebSecurity.CurrentUserId && u.settingId_settingId.Key == "highlightColor");
                    defaultNeeded.literalValue = defaultColor;
                    defaultNeeded2.literalValue = defaultFont;
                    defaultNeeded3.literalValue = defaultHighlight;
                }


                var settouse = (from set in db.Settings
                                where set.Key == model.settingName//model.settingId.name
                                select set.Key).FirstOrDefault();

                memberSetting memset = db.memberSettings.FirstOrDefault(u => u.UserId.UserId == WebSecurity.CurrentUserId
                    && u.settingId_settingId.Key == model.settingName);
                memset.literalValue = model.literalValue;
                db.SaveChanges();
            }
            //}
            return View(new settingDefineViewModel());
        }
 public ActionResult SettingDefine(settingDefineViewModel model)
 {
     return View(new settingDefineViewModel());
 }