Пример #1
0
        public ActionResult DeleteRowConfirmed(int id)
        {
            ChangesFixator cf     = new ChangesFixator(DataBaseInfo, Model);
            var            result = cf.FixateChanges(ChangesFixator.QueryType.Delete, GetIdOrdinalIndex(), id);

            if (result == string.Empty)
            {
                result = "Ряд " + id + " успешно удалён.";
            }

            TempData["StatusMessage"] = result;
            TempData.Keep("StatusMessage");

            return(RedirectToAction("Index", new { dbId = DbId, defaultTableName = Model.TableName }));
        }
Пример #2
0
        public ActionResult UploadNewRow()
        {
            DataTable      dt            = Model;
            ChangesFixator changesHelper = new ChangesFixator(DataBaseInfo, dt);
            int            changedRowId  = int.Parse(Request[dt.Columns[GetIdOrdinalIndex()].ColumnName]);

            foreach (DataColumn column in dt.Columns)
            {
                changesHelper.AddDataColumn(Request[column.ColumnName]);
            }

            var result = changesHelper.FixateChanges(ChangesFixator.QueryType.Insert);

            if (result == string.Empty)
            {
                result = "Ряд " + changedRowId + " был успешно добавлен!";
            }

            TempData["StatusMessage"] = result;
            return(RedirectToAction("Index", new { dbId = DbId, defaultTableName = dt.TableName }));
        }