using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CMSDAL.Query.FieldComponent { public static class FieldComponentQB { // ======================= GET FIELDCOMPONENT ======================= public const string GET_FIELDCOMPONENT = @"SELECT FC.FIELDCOMPONENTID AS FieldComponentId, FC.NAME AS FieldComponentName, FC.SLUG AS FieldComponentSlug, FC.DESCRIPTION AS FieldComponentDescription, FC.FIELDTYPE AS FieldComponentFieldType, FC.ICON AS FieldComponentIcon, FC.CATEGORY AS FieldComponentCategory, FC.SCHEMAJSON AS FieldComponentSchemaJson, FC.VALIDATIONRULES AS FieldComponentValidationRules, FC.DEFAULTVALUE AS FieldComponentDefaultValue, FC.ISSTANDARD AS FieldComponentIsStandard, FC.USAGECOUNT AS FieldComponentUsageCount, FC.TAGS AS FieldComponentTags, FC.COLORID AS FieldComponentColorId, FC.VISIBILITY AS FieldComponentVisibility, FC.CONTENTTYPEID AS FieldComponentContentTypeId, FC.FIELDNAME AS FieldComponentFieldName, FC.REMARKS AS FieldComponentRemarks, FC.TENANTID AS TenantId, FC.CREATEDBYID AS CreatedById, FC.CREATEDON AS CreatedOn, CU.USERNAME AS CreatedByName, FC.MODIFIEDBYID AS ModifiedById, FC.MODIFIEDON AS ModifiedOn, MU.USERNAME AS ModifiedByName, FC.STATUS AS Status, FC.VERSION AS Version FROM MFIELDCOMPONENT FC LEFT JOIN MUSER CU ON CU.USERID = FC.CREATEDBYID LEFT JOIN MUSER MU ON MU.USERID = FC.MODIFIEDBYID WHERE FC.FIELDCOMPONENTID = @FieldComponentId;"; // ======================= SAVE FIELDCOMPONENT ======================= public const string SAVE_FIELDCOMPONENT = @"INSERT INTO MFIELDCOMPONENT ( TENANTID, NAME, SLUG, DESCRIPTION, FIELDTYPE, ICON, CATEGORY, SCHEMAJSON, VALIDATIONRULES, DEFAULTVALUE, ISSTANDARD, USAGECOUNT, TAGS, COLORID, VISIBILITY, CONTENTTYPEID, FIELDNAME, REMARKS, STATUS, VERSION, CREATEDBYID, CREATEDON, MODIFIEDBYID, MODIFIEDON ) VALUES ( @TenantId, @FieldComponentName, @FieldComponentSlug, @FieldComponentDescription, @FieldComponentFieldType, @FieldComponentIcon, @FieldComponentCategory, @FieldComponentSchemaJson, @FieldComponentValidationRules, @FieldComponentDefaultValue, @FieldComponentIsStandard, @FieldComponentUsageCount, @FieldComponentTags, @FieldComponentColorId, @FieldComponentVisibility, @FieldComponentContentTypeId, @FieldComponentFieldName, @FieldComponentRemarks, @Status, @Version, @CreatedById, @CreatedOn, @ModifiedById, @ModifiedOn );"; // ======================= UPDATE FIELDCOMPONENT ======================= public const string UPDATE_FIELDCOMPONENT = @"UPDATE MFIELDCOMPONENT SET NAME = @FieldComponentName, SLUG = @FieldComponentSlug, DESCRIPTION = @FieldComponentDescription, FIELDTYPE = @FieldComponentFieldType, ICON = @FieldComponentIcon, CATEGORY = @FieldComponentCategory, SCHEMAJSON = @FieldComponentSchemaJson, VALIDATIONRULES = @FieldComponentValidationRules, DEFAULTVALUE = @FieldComponentDefaultValue, ISSTANDARD = @FieldComponentIsStandard, USAGECOUNT = @FieldComponentUsageCount, TAGS = @FieldComponentTags, COLORID = @FieldComponentColorId, VISIBILITY = @FieldComponentVisibility, CONTENTTYPEID = @FieldComponentContentTypeId, FIELDNAME = @FieldComponentFieldName, REMARKS = @FieldComponentRemarks, TENANTID = @TenantId, STATUS = @Status, VERSION = @Version, MODIFIEDBYID = @ModifiedById, MODIFIEDON = @ModifiedOn WHERE FIELDCOMPONENTID = @FieldComponentId;"; // ======================= DELETE FIELDCOMPONENT ======================= public const string DELETE_FIELDCOMPONENT = @"DELETE FROM MFIELDCOMPONENT WHERE FIELDCOMPONENTID = @FieldComponentId;"; // ======================= SELECT LIST FIELDCOMPONENT ======================= public const string GET_SELECTLIST_FIELDCOMPONENT = @"SELECT FC.FIELDCOMPONENTID AS FIELDCOMPONENTId, FC.NAME AS FIELDCOMPONENTName FROM MFIELDCOMPONENT FC WHERE FC.STATUS = 1 ORDER BY FC.NAME;"; } }