Esempio n. 1
0
 public void SubmitForm(SysFileBackupEntity entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         service.Update(entity);
     }
     else
     {
         entity.Create();
         service.Insert(entity);
     }
 }
        public ActionResult SubmitForm(SysFileBackupEntity entity, string keyValue, string chkDrop)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                base.OperateLog("编辑文件备份:F_Id:" + keyValue, "/SystemSecurity/FileBackup/SubmitForm", "文件备份", Application.DbLogType.Update);
            }
            else
            {
                base.OperateLog("新增文件备份:" + entity.F_BackupName, "/SystemSecurity/FileBackup/SubmitForm", "文件备份", Application.DbLogType.Create);
            }

            if (!string.IsNullOrEmpty(entity.F_ServerIp))
            {
                SysBackupServerEntity model = new SysBackupServerApp().GetForm(entity.F_ServerIp);

                string virtualPath = string.Empty;
                string strPath     = string.Empty;

                switch (entity.F_BackupType)
                {
                case "0":     //图片
                    virtualPath       = "/Upload/Images/";
                    entity.F_FileName = Common.CreateNo() + "_Images.zip";
                    strPath           = Server.MapPath("/Upload/" + entity.F_FileName);
                    break;

                case "1":     //源文件
                    virtualPath       = "/Upload/files/";
                    entity.F_FileName = Common.CreateNo() + "_Files.zip";
                    strPath           = Server.MapPath("/Upload/" + entity.F_FileName);
                    break;

                case "2":     //全部
                    virtualPath       = "/Upload/";
                    entity.F_FileName = Common.CreateNo() + "_Upload.zip";
                    strPath           = Server.MapPath("/Upload/" + entity.F_FileName);
                    break;

                default:
                    break;
                }
                FtpTrans(model, entity.F_BackupPath, virtualPath, strPath, chkDrop);//备份操作,异步操作
                app.SubmitForm(entity, keyValue);
                return(Success("操作成功。"));
            }
            return(Error("ServerIp地址不存在。"));
        }
Esempio n. 3
0
 public void UpdateForm(SysFileBackupEntity entity)
 {
     service.Update(entity);
 }
Esempio n. 4
0
 public void Delete(SysFileBackupEntity entity)
 {
     service.Delete(entity);
 }