using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FrameworkDAL.Query.DataAlert { public static class DataAlertQB { public const string GET_DATAALERT = @" SELECT DA.DATAALERTID AS DataAlertId, DA.DATAALERTNAME AS DataAlertName, DA.MODULEID AS ModuleId, MM.MODULECODE AS ModuleCode, MM.MODULENAME AS ModuleName, DA.SECTION AS DataAlertSection, DA.DESCRIPTION AS DataAlertDescription, DA.ALERTLEVEL AS DataAlertAlertLevel, DA.EXPRESSION AS DataAlertExpression, DA.SUMMARYEXPRESSION AS DataAlertSummaryExpression, DA.FILTERSUMMARYEXPRESSION AS DataAlertFilterSummaryExpression, DA.OUWISE AS DataAlertOUWise, DA.USERWISE AS DataAlertUserWise, DA.NOOFFILTERS AS DataAlertNoOfFilters, DA.MESSAGE AS DataAlertMessage, DA.SOLUTION AS DataAlertSolution, DA.FILTERNAME1 AS DataAlertFilterName1, DA.FILTERNAME2 AS DataAlertFilterName2, DA.FILTERNAME3 AS DataAlertFilterName3, DA.FILTERNAME4 AS DataAlertFilterName4, DA.FILTERNAME5 AS DataAlertFilterName5, DA.FIELDSTODISPLAY AS DataAlertFieldsToDisplay, DA.ENTITYID AS EntityId, ME.ENTITYCODE AS EntityCode, ME.ENTITYNAME AS EntityName, DA.SORTORDER AS DataAlertSortOrder, DA.VERSION AS DataAlertVersion, DA.STATUS AS DataAlertStatus, DA.CREATEDBYID AS DataAlertCreatedById, U1.USERNAME AS DataAlertCreatedByName, DA.CREATEDON AS DataAlertCreatedOn, DA.MODIFIEDBYID AS DataAlertModifiedById, U2.USERNAME AS DataAlertModifiedByName, DA.MODIFIEDON AS DataAlertModifiedOn, DA.SOURCETYPE AS DataAlertSourceType, DA.FILTER1 AS DataAlertFilter1, DA.FILTER2 AS DataAlertFilter2, DA.FILTER3 AS DataAlertFilter3, DA.FILTER4 AS DataAlertFilter4, DA.FILTER5 AS DataAlertFilter5 FROM MDATAALERT DA LEFT JOIN MENTITY ME ON ME.ENTITYID = DA.ENTITYID LEFT JOIN MMODULE MM ON MM.MODULEID = DA.MODULEID LEFT JOIN MUSER U1 ON U1.USERID = DA.CREATEDBYID LEFT JOIN MUSER U2 ON U2.USERID = DA.MODIFIEDBYID WHERE DA.DATAALERTID = @dataalertid;"; public const string GET_SELECTLIST_DATAALERT = @"SELECT A.DATAALERTID AS Id, A.DATAALERTNAME AS Name FROM MDATAALERT A;"; public const string SAVE_DATAALERT = @"INSERT INTO MDATAALERT ( DATAALERTID, DATAALERTNAME, MODULEID, SECTION, DESCRIPTION, ALERTLEVEL, EXPRESSION, SUMMARYEXPRESSION, FILTERSUMMARYEXPRESSION, OUWISE, USERWISE, NOOFFILTERS, MESSAGE, SOLUTION, FILTERNAME1, FILTERNAME2, FILTERNAME3, FILTERNAME4, FILTERNAME5, FIELDSTODISPLAY, ENTITYID, SORTORDER, VERSION, STATUS, CREATEDBYID, CREATEDON, MODIFIEDBYID, MODIFIEDON, SOURCETYPE, FILTER1, FILTER2, FILTER3, FILTER4, FILTER5 ) VALUES ( @DataAlertId, @DataAlertName, @ModuleId, @DataAlertSection, @DataAlertDescription, @DataAlertAlertLevel, @DataAlertExpression, @DataAlertSummaryExpression, @DataAlertFilterSummaryExpression, @DataAlertOUWise, @DataAlertUserWise, @DataAlertNoOfFilters, @DataAlertMessage, @DataAlertSolution, @DataAlertFilterName1, @DataAlertFilterName2, @DataAlertFilterName3, @DataAlertFilterName4, @DataAlertFilterName5, @DataAlertFieldsToDisplay, @EntityId, @DataAlertSortOrder, @DataAlertVersion, @DataAlertStatus, @DataAlertCreatedById, @DataAlertCreatedOn, @DataAlertModifiedById, @DataAlertModifiedOn, @DataAlertSourceType, @DataAlertFilter1, @DataAlertFilter2, @DataAlertFilter3, @DataAlertFilter4, @DataAlertFilter5 ); "; public const string UPDATE_DATAALERT = @"UPDATE MDATAALERT SET DATAALERTNAME = @DataAlertName, MODULEID = @ModuleId, SECTION = @DataAlertSection, DESCRIPTION = @DataAlertDescription, ALERTLEVEL = @DataAlertAlertLevel, EXPRESSION = @DataAlertExpression, SUMMARYEXPRESSION = @DataAlertSummaryExpression, FILTERSUMMARYEXPRESSION = @DataAlertFilterSummaryExpression, OUWISE = @DataAlertOUWise, USERWISE = @DataAlertUserWise, NOOFFILTERS = @DataAlertNoOfFilters, MESSAGE = @DataAlertMessage, SOLUTION = @DataAlertSolution, FILTERNAME1 = @DataAlertFilterName1, FILTERNAME2 = @DataAlertFilterName2, FILTERNAME3 = @DataAlertFilterName3, FILTERNAME4 = @DataAlertFilterName4, FILTERNAME5 = @DataAlertFilterName5, FIELDSTODISPLAY = @DataAlertFieldsToDisplay, ENTITYID = @EntityId, SORTORDER = @DataAlertSortOrder, VERSION = @DataAlertVersion, STATUS = @DataAlertStatus, MODIFIEDBYID = @DataAlertModifiedById, MODIFIEDON = @DataAlertModifiedOn, SOURCETYPE = @DataAlertSourceType, FILTER1 = @DataAlertFilter1, FILTER2 = @DataAlertFilter2, FILTER3 = @DataAlertFilter3, FILTER4 = @DataAlertFilter4, FILTER5 = @DataAlertFilter5 WHERE DATAALERTID = @DataAlertId; "; public const string DELETE_DATAALERT = @"DELETE FROM MDATAALERT WHERE DATAALERTID = @dataalertid; "; } }