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); }
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) }); }
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) }); }
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) }); }
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) }); }
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); } }
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); }
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); } } }
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); } } }
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); } } }
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); } } }
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) }); }
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) }); }
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); } }
public void AddNewActionType(string Action) { strSQL = "INSERT INTO ActionType(Action) VALUES (@Action)"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@Action", Action) }); }
public void DeleteSiteProfile(string SiteName) { strSQL = "DELETE FROM SiteProfile WHERE SiteName=@SiteName"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) }); }
public void DeleteAction(string Action) { strSQL = "DELETE FROM ActionType WHERE Action=@Action"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@Action", Action) }); }
public void DeleteAllUnfinishedUploadItem(string SiteName) { strSQL = "DELETE FROM UploadBreakpoint WHERE SiteName=@SiteName"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SiteName", SiteName) }); }
public void DeleteScheduleActionData(string SchName) { strSQL = "DELETE FROM Schedule_RunStep WHERE ScheduleName=@SchName"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@SchName", SchName) }); }
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) }); }
public void DeleteSiteProfileRestoreTable() { strSQL = "DELETE FROM SiteProfile_ForRestore"; Sqlite.ExecuteNonQuery(strSQL, null); }
public void DeleteActionRestoreTable() { strSQL = "DELETE FROM ActionType_ForRestore"; Sqlite.ExecuteNonQuery(strSQL, null); }
public void AddRestoreItemIntoAction(string Action) { strSQL = "INSERT INTO ActionType_ForRestore(Action) VALUES (@Action)"; Sqlite.ExecuteNonQuery(strSQL, new SQLiteParameter[] { new SQLiteParameter("@Action", Action) }); }