示例#1
0
        public void MoveDataToSchedule()
        {
            strSQL = "DELETE FROM Schedule_RunStep";
            Sqlite.ExecuteNonQuery(strSQL, null);
            strSQL = "INSERT INTO Schedule_RunStep SELECT * FROM Schedule_RunStep_ForRestore";
            Sqlite.ExecuteNonQuery(strSQL, null);

            strSQL = "DELETE FROM Schedule_BaseData";
            Sqlite.ExecuteNonQuery(strSQL, null);
            strSQL = "INSERT INTO Schedule_BaseData SELECT * FROM Schedule_BaseData_ForRestore";
            Sqlite.ExecuteNonQuery(strSQL, null);
        }
示例#2
0
 public void UpdateSiteProfile(string type, string SiteName, string SiteIP, string UserID, string Password, string RenameFile, string Description, string Port)
 {
     strSQL = "UPDATE SiteProfile SET Type=@type,SiteIP=@SiteIP,UserID=@UserID,Password=@Password,RenameFile=@RenameFile,Description=@Description,Port=@Port WHERE SiteName=@SiteName";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@type", type),
                                                    new SQLiteParameter("@SiteIP", SiteIP),
                                                    new SQLiteParameter("@UserID", UserID),
                                                    new SQLiteParameter("@Password", Password),
                                                    new SQLiteParameter("@SiteName", SiteName),
                                                    new SQLiteParameter("@RenameFile", RenameFile),
                                                    new SQLiteParameter("@Description", Description),
                                                    new SQLiteParameter("@Port", Port) });
 }
示例#3
0
 public void AddNewSiteProfile(string type, string SiteName, string SiteIP, string UserID, string Password, string RenameFile, string Description, string Port)
 {
     strSQL = "INSERT INTO SiteProfile(Type,SiteName,SiteIP,UserID,Password,RenameFile,Description,Port) VALUES (@type,@SiteName,@SiteIP,@UserID,@Password,@RenameFile,@Description,@Port)";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@type", type),
                                                    new SQLiteParameter("@SiteIP", SiteIP),
                                                    new SQLiteParameter("@UserID", UserID),
                                                    new SQLiteParameter("@Password", Password),
                                                    new SQLiteParameter("@SiteName", SiteName),
                                                    new SQLiteParameter("@RenameFile", RenameFile),
                                                    new SQLiteParameter("@Description", Description),
                                                    new SQLiteParameter("@Port", Port) });
 }
示例#4
0
 public void Addnewuploaditem(string SiteName, string Ftppath, string Filenamewithoutpath, string Localpath, string Type, string Filesize, string FtpFullFilePath, string LocalFullFilePath, string ModifyDate)
 {
     strSQL = "INSERT INTO UploadBreakpoint(SiteName,FtpPath,FileNameWithoutPath,LocalPath,Type,FileSize,FtpFullFilePath,LocalFullFilePath,ModifyDate) VALUES (@SiteName,@Ftppath,@Filenamewithoutpath,@Localpath,@Type,@Filesize,@FtpFullFilePath,@LocalFullFilePath,@ModifyDate)";
     Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName),
                                                            new SQLiteParameter("@Ftppath", Ftppath),
                                                            new SQLiteParameter("@Filenamewithoutpath", Filenamewithoutpath),
                                                            new SQLiteParameter("@Localpath", Localpath),
                                                            new SQLiteParameter("@Type", Type),
                                                            new SQLiteParameter("@Filesize", Filesize),
                                                            new SQLiteParameter("@FtpFullFilePath", FtpFullFilePath),
                                                            new SQLiteParameter("@LocalFullFilePath", LocalFullFilePath),
                                                            new SQLiteParameter("@ModifyDate", ModifyDate) });
 }
示例#5
0
 public void AddRestoreItemIntoScheduleRunStep(string ScheduleName, string Step, string Action,
                                               string RemoteFileFolder, string RemoteIsFolder, string LocalFileFolder, string LocalIsFolder)
 {
     strSQL = "INSERT INTO Schedule_RunStep_ForRestore(ScheduleName,Step,Action,RemoteFileFolder,RemoteIsFolder,LocalFileFolder,LocalIsFolder)" +
              " VALUES (@ScheduleName,@Step,@Action,@RemoteFileFolder,@RemoteIsFolder,@LocalFileFolder,@LocalIsFolder)";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@ScheduleName", ScheduleName),
                                                    new SQLiteParameter("@Step", Step),
                                                    new SQLiteParameter("@Action", Action),
                                                    new SQLiteParameter("@RemoteFileFolder", RemoteFileFolder),
                                                    new SQLiteParameter("@RemoteIsFolder", RemoteIsFolder),
                                                    new SQLiteParameter("@LocalFileFolder", LocalFileFolder),
                                                    new SQLiteParameter("@LocalIsFolder", LocalIsFolder) });
 }
示例#6
0
        public bool CheckUploadIsFinished(string SiteName)
        {
            strSQL = "SELECT TOP 1 FileNameWithoutPath FROM UploadBreakpoint WHERE SiteName=@SiteName";
            DataTable dt = Sqlite.ExecuteDataTable(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) });

            if (dt.Rows.Count == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#7
0
        public DataSet GetScheduleToBackup()
        {
            strSQL = "SELECT * FROM Schedule_BaseData";
            DataTable dt1 = Sqlite.ExecuteDataTable(strSQL, null);

            dt1.TableName = "Schedule_BaseData";
            strSQL        = "SELECT * FROM Schedule_RunStep";
            DataTable dt2 = Sqlite.ExecuteDataTable(strSQL, null);

            dt2.TableName = "Schedule_RunStep";
            DataSet ds = new DataSet();

            ds.Tables.Add(dt1);
            ds.Tables.Add(dt2);
            return(ds);
        }
示例#8
0
 public bool IsSiteProfileExist(string SiteName)
 {
     strSQL = "SELECT SiteIP FROM SiteProfile WHERE SiteName=@SiteName";
     using (DataTable dt = Sqlite.ExecuteDataTable(strSQL,
                                                   new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) }))
     {
         if (dt.Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
示例#9
0
 public bool CheckScheduleNameIsAlreadyExist(string SchName)
 {
     strSQL = "SELECT ScheduleName FROM Schedule_BaseData WHERE ScheduleName=@SchName";
     using (DataTable dt = Sqlite.ExecuteDataTable(strSQL,
                                                   new SQLiteParameter[] { new SQLiteParameter("@SchName", SchName) }))
     {
         if (dt.Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
示例#10
0
 public bool CheckActionIsAlreadyUsed(string Action)
 {
     strSQL = "SELECT Action FROM Schedule_RunStep WHERE Action=@Action Limit 1";
     using (DataTable dt = Sqlite.ExecuteDataTable(strSQL,
                                                   new SQLiteParameter[] { new SQLiteParameter("@Action", Action) }))
     {
         if (dt.Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
示例#11
0
 public bool CheckActionIsAlreadyExist(string Action)
 {
     strSQL = "SELECT Action FROM ActionType WHERE Action=@Action";
     using (DataTable dt = Sqlite.ExecuteDataTable(strSQL,
                                                   new SQLiteParameter[] { new SQLiteParameter("@Action", Action) }))
     {
         if (dt.Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
示例#12
0
 public void AddRestoreItemIntoScheduleBaseData(string ScheduleName, string SiteProfile,
                                                string StartDateTime, string LastRunDateTime, string Repeat, string Status, string SuccessfulMail, string Mail, string ReconnectTimes, string ReconnectInterval, string FileExistAction)
 {
     strSQL = "INSERT INTO Schedule_BaseData_ForRestore(ScheduleName,SiteProfile,StartDateTime,LastRunDateTime,Repeat,Status,SuccessfulMail,Mail,ReconnectTimes,ReconnectInterval,FileExistAction)" +
              " VALUES (@ScheduleName,@SiteProfile,@StartDateTime,@LastRunDateTime,@Repeat,@Status,@SuccessfulMail,@Mail,@ReconnectTimes,@ReconnectInterval,@FileExistAction)";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@ScheduleName", ScheduleName),
                                                    new SQLiteParameter("@SiteProfile", SiteProfile),
                                                    new SQLiteParameter("@StartDateTime", StartDateTime),
                                                    new SQLiteParameter("@LastRunDateTime", LastRunDateTime),
                                                    new SQLiteParameter("@Repeat", Repeat),
                                                    new SQLiteParameter("@Status", Status),
                                                    new SQLiteParameter("@SuccessfulMail", SuccessfulMail),
                                                    new SQLiteParameter("@Mail", Mail),
                                                    new SQLiteParameter("@ReconnectTimes", ReconnectTimes),
                                                    new SQLiteParameter("@ReconnectInterval", ReconnectInterval),
                                                    new SQLiteParameter("@FileExistAction", FileExistAction) });
 }
示例#13
0
 public void UpdateScheduleBaseData(string SchName, string SiteProfile, string StartDateTime,
                                    string LastRunDateTime, string Repeat, string Status, string SuccessfulMail, string Mail,
                                    string ReconnectTimes, string ReconnectInterval, string FileExistAction)
 {
     strSQL = "UPDATE Schedule_BaseData SET SiteProfile=@SiteProfile,StartDateTime=@StartDateTime,LastRunDateTime=@LastRunDateTime,Repeat=@Repeat,Status=@Status,SuccessfulMail=@SuccessfulMail,Mail=@Mail,ReconnectTimes=@ReconnectTimes,ReconnectInterval=@ReconnectInterval,FileExistAction=@FileExistAction" +
              " WHERE ScheduleName=@SchName";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@SchName", SchName),
                                                    new SQLiteParameter("@StartDateTime", StartDateTime),
                                                    new SQLiteParameter("@SiteProfile", SiteProfile),
                                                    new SQLiteParameter("@LastRunDateTime", LastRunDateTime),
                                                    new SQLiteParameter("@Repeat", Repeat),
                                                    new SQLiteParameter("@Status", Status),
                                                    new SQLiteParameter("@SuccessfulMail", SuccessfulMail),
                                                    new SQLiteParameter("@Mail", Mail),
                                                    new SQLiteParameter("@ReconnectTimes", ReconnectTimes),
                                                    new SQLiteParameter("@ReconnectInterval", ReconnectInterval),
                                                    new SQLiteParameter("@FileExistAction", FileExistAction) });
 }
示例#14
0
        public void SaveUploadlist(string SiteName, string Localpath, string Filenamewithoutpath, string Ftppath, string Type, string Filesize, string LocalFullFilePath, string FtpFullFilePath, string ModifyDate)
        {
            strSQL = "SELECT * FROM UploadBreakpoint WHERE SiteName=@SiteName AND LocalPath=@Localpath AND FileNameWithoutPath=@Filenamewithoutpath AND FtpPath=@Ftppath AND FileSize=@Filesize AND LocalFullFilePath=@LocalFullFilePath";
            DataTable dt = Sqlite.ExecuteDataTable(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName),
                                                                                   new SQLiteParameter("@Ftppath", Ftppath),
                                                                                   new SQLiteParameter("@Filenamewithoutpath", Filenamewithoutpath),
                                                                                   new SQLiteParameter("@Localpath", Localpath),
                                                                                   new SQLiteParameter("@Filesize", Filesize),
                                                                                   new SQLiteParameter("@LocalFullFilePath", LocalFullFilePath) });

            if (dt.Rows.Count == 0)
            {
                Addnewuploaditem(SiteName, Ftppath, Filenamewithoutpath, Localpath, Type, Filesize, FtpFullFilePath, LocalFullFilePath, ModifyDate);
            }
            else
            {
                strSQL = "DELETE FROM UploadBreakpoint WHERE SiteName=@SiteName AND FtpPath=@Ftppath AND FileNameWithoutPath=@Filenamewithoutpath AND LocalPath=@Localpath";
                Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName),
                                                                       new SQLiteParameter("@Ftppath", Ftppath),
                                                                       new SQLiteParameter("@Filenamewithoutpath", Filenamewithoutpath),
                                                                       new SQLiteParameter("@Localpath", Localpath) });
                Addnewuploaditem(SiteName, Ftppath, Filenamewithoutpath, Localpath, Type, Filesize, FtpFullFilePath, LocalFullFilePath, ModifyDate);
            }
        }
示例#15
0
 public void AddNewActionType(string Action)
 {
     strSQL = "INSERT INTO ActionType(Action) VALUES (@Action)";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@Action", Action) });
 }
示例#16
0
 public void DeleteSiteProfile(string SiteName)
 {
     strSQL = "DELETE FROM SiteProfile WHERE SiteName=@SiteName";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) });
 }
示例#17
0
 public void DeleteAction(string Action)
 {
     strSQL = "DELETE FROM ActionType WHERE Action=@Action";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@Action", Action) });
 }
示例#18
0
 public void DeleteAllUnfinishedUploadItem(string SiteName)
 {
     strSQL = "DELETE FROM UploadBreakpoint WHERE SiteName=@SiteName";
     Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) });
 }
示例#19
0
 public void DeleteScheduleActionData(string SchName)
 {
     strSQL = "DELETE FROM Schedule_RunStep WHERE ScheduleName=@SchName";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@SchName", SchName) });
 }
示例#20
0
 public void UpdateLastRunTime(string SchName, string Time)
 {
     strSQL = "UPDATE Schedule_BaseData SET LastRunDateTime=@Time WHERE ScheduleName=@SchName";
     Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SchName", SchName), new SQLiteParameter("@Time", Time) });
 }
示例#21
0
 public void DeleteSiteProfileRestoreTable()
 {
     strSQL = "DELETE FROM SiteProfile_ForRestore";
     Sqlite.ExecuteNonQuery(strSQL, null);
 }
示例#22
0
 public void DeleteActionRestoreTable()
 {
     strSQL = "DELETE FROM ActionType_ForRestore";
     Sqlite.ExecuteNonQuery(strSQL, null);
 }
示例#23
0
 public void AddRestoreItemIntoAction(string Action)
 {
     strSQL = "INSERT INTO ActionType_ForRestore(Action) VALUES (@Action)";
     Sqlite.ExecuteNonQuery(strSQL,
                            new SQLiteParameter[] { new SQLiteParameter("@Action", Action) });
 }