Пример #1
0
 public ActionResult SubmitForm(DbBackupEntity dbBackupEntity)
 {
     dbBackupEntity.F_FilePath = Server.MapPath("~/Resource/DbBackup/" + dbBackupEntity.F_FileName + ".bak");
     dbBackupEntity.F_FileName = dbBackupEntity.F_FileName + ".bak";
     dbBackupApp.SubmitForm(dbBackupEntity);
     return(Success("操作成功。"));
 }
Пример #2
0
        public ActionResult SubmitForm(DbBackupEntity dbBackupEntity)
        {
            var       module     = new ModuleApp().GetList().Where(a => a.F_Layers == 1 && a.F_EnCode == moduleName).FirstOrDefault();
            var       moduleitem = new ModuleApp().GetList().Where(a => a.F_Layers > 1 && a.F_EnCode == className.Substring(0, className.Length - 10)).FirstOrDefault();
            LogEntity logEntity  = new LogEntity(module.F_FullName, moduleitem.F_FullName, DbLogType.Create.ToString());

            logEntity.F_Description += DbLogType.Create.ToDescription();
            try
            {
                logEntity.F_Account       = OperatorProvider.Provider.GetCurrent().UserCode;
                logEntity.F_NickName      = OperatorProvider.Provider.GetCurrent().UserName;
                dbBackupEntity.F_FilePath = Server.MapPath("~/Resource/DbBackup/" + dbBackupEntity.F_FileName + ".bak");
                if (!Directory.Exists(Server.MapPath("~/Resource/DbBackup/")))
                {
                    DirectoryInfo directoryInfo = new DirectoryInfo(Server.MapPath("~/Resource/DbBackup/"));
                    directoryInfo.Create();
                }
                dbBackupEntity.F_FileName = dbBackupEntity.F_FileName + ".bak";
                dbBackupApp.SubmitForm(dbBackupEntity);
                logEntity.F_Description += "操作成功";
                new LogApp().WriteDbLog(logEntity);
                return(Success("操作成功。"));
            }
            catch (Exception ex)
            {
                logEntity.F_Result       = false;
                logEntity.F_Description += "操作失败," + ex.Message;
                new LogApp().WriteDbLog(logEntity);
                return(Error(ex.Message));
            }
        }
Пример #3
0
 public ActionResult SubmitForm(DbBackupEntity dbBackupEntity)
 {
     dbBackupEntity.F_FilePath = _hostingEnvironment.WebRootPath + "/Resource/DbBackup/" + dbBackupEntity.F_FileName + ".bak";
     dbBackupEntity.F_FileName = dbBackupEntity.F_FileName + ".bak";
     dbBackupApp.SubmitForm(dbBackupEntity);
     return(Success("操作成功。"));
 }
Пример #4
0
        public ActionResult SubmitForm(DbBackupEntity dbBackupEntity)
        {
            string DBBasePath = Server.MapPath("/Resource/DbBackup/");

            FileHelper.CreateDirectory(DBBasePath);
            dbBackupEntity.F_FilePath = DBBasePath + dbBackupEntity.F_FileName + ".bak";
            dbBackupEntity.F_FileName = dbBackupEntity.F_FileName + ".bak";
            dbBackupApp.SubmitForm(dbBackupEntity);
            base.OperateLog("数据库备份", "/SystemSecurity/DbBackup/SubmitForm", "数据备份", Application.DbLogType.Other);
            return(Success("操作成功。"));
        }
Пример #5
0
 public ActionResult SubmitForm(DbBackupEntity dbBackupEntity)
 {
     if (!Directory.Exists(Server.MapPath("~/Resource/DbBackup/")))
     {
         Directory.CreateDirectory(Server.MapPath("~/Resource/DbBackup/"));
     }
     dbBackupEntity.F_FilePath = Server.MapPath("~/Resource/DbBackup/" + dbBackupEntity.F_FileName + ".bak");
     dbBackupEntity.F_FileName = dbBackupEntity.F_FileName + ".bak";
     dbBackupApp.SubmitForm(dbBackupEntity);
     return(Success("操作成功。"));
 }