예제 #1
0
        private object RecordItemLog(
            string table_name,
            string where,
            string error,
            int duration,
            string path,
            string fileName)
        {
            var user        = User.Identity.Name;
            var date        = DateTime.Today;
            var info        = where;
            var durationSec = duration;
            var errors      = error;

            var imp = new ImpManager();

            try
            {
                if (!imp.GetItems().Any(i => i.name == "ExportIn" + table_name))
                {
                    var item = new imp_items
                    {
                        code      = "exportIn" + table_name,
                        datatable = table_name,
                        name      = "ExportIn" + table_name
                    };
                    imp.SaveItem(item);
                }

                var itemID  = imp.GetItems().FirstOrDefault(i => i.name == "ExportIn" + table_name).id;
                var itemLog = new imp_itemLog
                {
                    itemID      = itemID,
                    created     = date,
                    createdBy   = user,
                    durationSec = durationSec,
                    errors      = errors,
                    info        = info,
                    isImport    = false,
                    withBackup  = false
                };
                imp.SaveItemLog(itemLog);


                return(new { result = true, msg = error, path = path, fileName = fileName + ".xlsx" });
            }
            catch (Exception exc)
            {
                return(new { result = false, msg = exc.Message });
            }
        }
예제 #2
0
        //// --------------------- ItemLogsDict --------------------------
        public ActionResult ItemLogs()
        {
            var mng = new ImpManager();

            ViewBag.Items = mng.GetItems();//items с первичным ключом

            return(View());
        }
예제 #3
0
        //-----------------------StatisticImportExport------------------------
        public ActionResult StatisticImportExport()
        {
            var oper = new ImpManager();

            ViewBag.Operations = oper.GetItems();

            var users = new CoreManager();

            ViewBag.Users = users.GetUsers().ToList();

            var tables = new TablesDataBase();

            ViewBag.Objects = tables.GetTablesDataBaseList();

            return(View());
        }