CinderellaMGS.SQL_Queries.setShiftStartEnd C# (CSharp) Method

setShiftStartEnd() public method

Updates the time of either a shift start or shift end in the ConfigSettings table.
public setShiftStartEnd ( bool shiftStart, bool clear ) : void
shiftStart bool True-set the shift start time :: False-Set the shift end time.
clear bool True-Clear the value :: False-Set the value with the current datetime
return void
        public void setShiftStartEnd(bool shiftStart, bool clear)
        {
            if (shiftStart)
            {
                if (clear)
                {
                    database.ExecuteQuery("UPDATE [CinderellaMGS].[dbo].[ConfigSettings] SET [PropertyValue]='' WHERE [appProperty]='shiftStart'");
                }

                else
                {
                    database.ExecuteQuery("UPDATE [CinderellaMGS].[dbo].[ConfigSettings] SET [PropertyValue]=CONVERT(VARCHAR, getDate(), 109) WHERE [appProperty]='shiftStart'");
                }
            }
            else//shiftEnd
            {
                if (clear)
                {
                    database.ExecuteQuery("UPDATE [CinderellaMGS].[dbo].[ConfigSettings] SET [PropertyValue]='' WHERE [appProperty]='shiftEnd'");
                }

                else
                {
                    database.ExecuteQuery("UPDATE [CinderellaMGS].[dbo].[ConfigSettings] SET [PropertyValue]=CONVERT(VARCHAR, getDate(), 109) WHERE [appProperty]='shiftEnd'");
                }
            }
        }