예제 #1
0
        public ActionResult Tables(TablesModel tableModel, string submitButton)
        {
            tableModel.OutletList = _iDropDownService.GetOutletList();

            if (!ModelState.IsValid)
            {
                string errorString = this.ValidationTables(tableModel);
                if (!string.IsNullOrEmpty(errorString))
                {
                    ViewBag.Validate = errorString;
                    return(View(tableModel));
                }
            }

            if (tableModel.Id > 0)
            {
                var result = _iTablesService.UpdateTables(tableModel);
                ViewBag.Result = _locService.GetLocalizedHtmlString("EditSuccss");
            }
            else
            {
                var result = _iTablesService.InsertTables(tableModel);
                ViewBag.Result = _locService.GetLocalizedHtmlString("SaveSuccess");
            }

            return(RedirectToAction("Index", "Tables"));
        }