Exemple #1
0
        // GET: Messages
        //[Authorize(Roles = "admin")]
        //[Authorize(Roles = "manager")]
        public ActionResult Index(string sortOrder, string searchString)
        {
            string nameSetting = "MessageGen";
            string messageG    = SettingBL.FindSettingValueByName(nameSetting);

            ViewBag.messageG = int.Parse(messageG);
            int lang      = LanguageBL.CheckLanguageSession();
            var messagesT = db.SPP_MessageTransDistinct(lang).ToList();

            ViewBag.NameSortParam = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            if (!String.IsNullOrEmpty((searchString)))
            {
                messagesT = messagesT.Where(s => s.title.ToLower().StartsWith(searchString.ToLower())).ToList();
            }
            switch (sortOrder)
            {
            case "name_desc":
                messagesT = messagesT.OrderByDescending(d => d.title).ToList();
                break;

            default:
                messagesT = messagesT.OrderBy(d => d.title).ToList();
                break;
            }

            return(View(messagesT));
        }
Exemple #2
0
        // GET: Languages
        //[Authorize(Roles = "admin")]
        //[Authorize(Roles = "manager")]
        public ActionResult Index()
        {
            string nameSetting = "Language";
            string langSetting = SettingBL.FindSettingValueByName(nameSetting);

            ViewBag.langSetting = langSetting;
            return(View(db.LANGUAGESs.ToList()));
        }
Exemple #3
0
        // GET: Vats
        //[Authorize(Roles = "admin")]
        //[Authorize(Roles = "manager")]
        public ActionResult Index()
        {
            //to do --> find setting message
            string nameSetting      = "Vat";
            string vatSetting       = SettingBL.FindSettingValueByName(nameSetting);
            var    numberFormatInfo = new NumberFormatInfo {
                NumberDecimalSeparator = "."
            };
            var value = Decimal.Parse(vatSetting, numberFormatInfo);

            ViewBag.vatSetting = value;
            return(View(db.VATs.ToList()));
        }