using System; using System.Collections.Generic; using System.Text; namespace Big.Lito.Data.Sql { public static class Scripts { /// /// Sql to get a project details by Id /// public static readonly string sqlGetProjectById = "Select" + " Id, [Project name], [Author], [Created], [Last updated]," + " [FrameWidth], [FrameHeight], [ResW], [ResH], [ObjName], [ObjW], [ObjH]," + " [NRows], [NCols], [CoX], [CoY], [NSlices], [NSlicesTexture], [LowLevelBrightness], " + " [HighLevelBrightness], [Repeats], [HomeDir], [BlenderDir]" + " From ProjectSettings Where Id = @Id"; /// /// Sql to get a project details by name /// public static readonly string sqlGetProjectByName = "Select" + " Id, [Project name], [Author], [Created], [Last updated]," + " [FrameWidth], [FrameHeight], [ResW], [ResH], [ObjName], [ObjW], [ObjH]," + " [NRows], [NCols], [CoX], [CoY], [NSlices], [NSlicesTexture], [LowLevelBrightness], " + " [HighLevelBrightness], [Repeats], [HomeDir], [BlenderDir]" + " From ProjectSettings Where [Project name] = @ProjectName"; /// /// Sql to get all club members /// public static readonly string SqlGetAllProjects = "Select" + " Id, [Project name], [Author], [Created], [Last updated]," + " [FrameWidth], [FrameHeight], [ResW], [ResH], [ObjName], [ObjW], [ObjH]," + " [NRows], [NCols], [CoX], [CoY], [NSlices], [NSlicesTexture], [LowLevelBrightness], " + " [HighLevelBrightness], [Repeats], [HomeDir], [BlenderDir]" + " From ProjectSettings"; /// /// Sql to get all club members /// public static readonly string SqlGetAllProjectsForGridView = "Select" + " [Project name], [Author], [Created], [Last updated]," + " [ObjName]" + " From ProjectSettings"; /// /// sql to insert a club member details /// public static readonly string SqlInsertProject = "Insert Into" + " ProjectSettings([Project name], [Author], [Created], [Last updated], [HomeDir])" + " Values(@ProjectName, @Author, @Created, @LastUpdated, @HomeDir)"; /// /// sql to search for club members /// public static readonly string SqlSearchClubMembers = "Select " + " Id, Name, DateOfBirth, Occupation, MaritalStatus, HealthStatus, Salary, NumberOfChildren" + " From ClubMember Where (@Occupation Is NULL OR @Occupation = Occupation) {0}" + " (@MaritalStatus Is NULL OR @MaritalStatus = MaritalStatus)"; /// /// sql to update project details /// public static readonly string SqlUpdateProject = "Update ProjectSettings " + " Set [Project name] = @ProjectName, [Author] = @Author, [Last updated] = @LastUpdated, [HomeDir]) = @HomeDir " + " Where([Id] = @Id)"; /// /// sql to update IniGen part of project details /// public static readonly string SqlUpdateProjectIniGen = "Update ProjectSettings " + " Set [Last updated] = @LastUpdated, [FrameWidth] = @FrameWidth, [FrameHeight] = @FrameHeight," + " [ResW] = @ResW, [ResH] = @ResH, [ObjName] = @ObjName, [ObjH] = @ObjH, [ObjW] = @ObjW, " + " [NRows] = @NRows, [NCols] = @NCols, [CoX] = @CoX, [CoY] = @CoY " + " Where([Id] = @Id)"; /// /// sql to delete a project record /// public static readonly string SqlDeleteProject = "Delete From ProjectSettings Where (Id = @Id)"; /// /// Sql to get a project details by Id /// public static readonly string sqlGetHeightmapByProjectId = "Select" + " [HighLevelBrightness], [LowLevelBrightness], [NSlices], [Repeats]" + " From ProjectSettings Where Id = @Id"; /// /// Sql to get a project details by name /// public static readonly string sqlGetHeightmapByProjectName = "Select" + " [HighLevelBrightness], [LowLevelBrightness], [NSlices], [Repeats]" + " From ProjectSettings Where [Project name] = @ProjectName"; public static readonly string SqlUpdateHeightMap = "Update ProjectSettings " + " Set [HighLevelBrightness] = @HighLevelBrightness, [LowLevelBrightness] = @LowLevelBrightness," + " [NSlices] = @NSlices, [NSlicesTexture] = @NSlicesTexture, [MaxSlices] = @MaxSlices," + " [BorderSize] = @BorderSize, [PictureWidth] = @PictureWidth, [Repeats] = @Repeats " + " Where([Id] = @Id)"; public static readonly string SqlUpdateSystemSettings = "Update ProjectSettings " + " Set [HomeDir] = @HomeDir, [BlenderDir] = @BlenderDir" + " Where([Id] = @Id)"; /// /// Sql to get a progress details by Id /// public static readonly string sqlGetProgressById = "Select" + " Id, [name], [start], [end], [val], [projectId]" + " From BtoFProgress Where Id = @Id"; /// /// Sql to get all club members /// public static readonly string SqlGetAllProgress = "Select" + " Id, [name], [start], [end], [val], [projectId]" + " From BtoFProgress"; /// /// Sql to update progress details by Id /// public static readonly string sqlUpdateProgress = "Update BtoFProgress" + " Set [name] = @ProgressName, [start] = @start, [end] = @end, [val] = @val, [projectId]" + " Where Id = @Id"; /// /// Sql to update progress details by name /// public static readonly string SqlUpdateProgressByName = "Update BtoFProgress" + " Set [start] = @start, [end] = @end, [val] = @val" + " Where [name] = @name"; /// /// Sql to update progress details by name /// public static readonly string SqlInsertProcessLevel = "Insert Into" + " ProcessLevels([name], [start], [end])" + " Values(@name, @start, @end)"; /// /// Sql to update progress details by name /// public static readonly string sqlUpdateProcessLevelsByName = "Update ProcessLevels" + " Set [start] = @start, [end] = @end" + " Where [name] = @name"; /// /// Sql to get a project details by name /// public static readonly string sqlGetProcessLevelsByName = "Select" + " [start], [end]" + " From ProcessLevels Where [name] = @Name"; /// /// Sql to get a progress details by Id /// public static readonly string sqlUpdateProjectId = "Update BtoFProgress" + " Set [projectId] = @projectId" + " Where Id = @Id"; /// /// Sql to get a project details by name /// public static readonly string sqlGetProgressByName = "Select" + " Id, [start], [end], [val], [val_ext]" + " From BtoFProgress Where [name] = @ProgressName"; /// /// sql to delete a project record /// public static readonly string SqlDeleteProgress = "Delete From BtoFProgress Where (Id = @Id)"; /// /// Sql to update progress details by name /// public static readonly string sqlUpdateFToBIniGen = "Update FToBIniGen" + " Set [ObjName] = @ObjName, [CoX] = @CoX, [CoY] = @CoY, [WRes] = @WRes," + " [HRes] = @HRes, [FrmW] = @FrmW, [FrmH] = @FrmH, [NRows] = @NRows, [NCols] = @NCols," + " [FilePath] = @FilePath Where [Name] = @Name"; /// /// Sql to update progress details by name /// public static readonly string sqlUpdateCancelFToBIniGen = "Update FToBIniGen" + " Set [cancelIniGen] = @cancelIniGen Where [Name] = @Name"; /// /// Sql to update progress details by name /// public static readonly string sqlUpdateRepeatsFToBIniGen = "Update FToBIniGen" + " Set [repeats] = @repeats Where [Name] = @Name"; /// /// Sql to update progress details by name /// public static readonly string sqlUpdateRowStartEndFToBIniGen = "Update FToBIniGen" + " Set [row_start] = @row_start, [row_end] = @row_end Where [Name] = @Name"; } }