object ApiDatabase: TApiDatabase
  OnCreate = DataModuleCreate
  Height = 358
  Width = 519
  object ucETaskApi: TUniConnection
    ProviderName = 'MySQL'
    Database = 'eTask'
    Username = 'root'
    Server = '192.168.116.132'
    LoginPrompt = False
    Left = 71
    Top = 65
    EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF'
  end
  object MySQLUniProvider1: TMySQLUniProvider
    Left = 178
    Top = 66
  end
  object uqUsers: TUniQuery
    Connection = ucETaskApi
    SQL.Strings = (
      'SELECT USER_ID, NAME, STATUS from users ORDER BY NAME')
    OnCalcFields = uqUsersCalcFields
    Left = 304
    Top = 70
    object uqUsersUSER_ID: TIntegerField
      FieldName = 'USER_ID'
      Required = True
    end
    object uqUsersNAME: TStringField
      FieldName = 'NAME'
      Size = 40
    end
    object uqUsersSTATUS: TStringField
      FieldName = 'STATUS'
      Size = 7
    end
    object uqUsersREPRESENTATIVE: TStringField
      FieldKind = fkCalculated
      FieldName = 'REPRESENTATIVE'
      Calculated = True
    end
  end
  object uqSaveTaskRow: TUniQuery
    Connection = ucETaskApi
    SQL.Strings = (
      'UPDATE web_tasks'
      'SET'
      '  APPLICATION   = :APPLICATION,'
      '  APP_VERSION   = :APP_VERSION,'
      '  TASK_DATE     = :TASK_DATE,'
      '  REPORTED_BY   = :REPORTED_BY,'
      '  ASSIGNED_TO   = :ASSIGNED_TO,'
      '  STATUS        = :STATUS,'
      '  STATUS_DATE   = :STATUS_DATE,'
      '  FIXED_VERSION = :FIXED_VERSION,'
      '  FORM_SECTION  = :FORM_SECTION,'
      '  ISSUE         = :ISSUE,'
      '  NOTES         = :NOTES'
      'WHERE TASK_ITEM_ID = :TASK_ITEM_ID')
    Left = 306
    Top = 198
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'APPLICATION'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'APP_VERSION'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'TASK_DATE'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'REPORTED_BY'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'ASSIGNED_TO'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'STATUS'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'STATUS_DATE'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'FIXED_VERSION'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'FORM_SECTION'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'ISSUE'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'NOTES'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'TASK_ITEM_ID'
        Value = nil
      end>
  end
  object uqTaskItems: TUniQuery
    Connection = ucETaskApi
    SQL.Strings = (
      'select'
      '  TASK_ITEM_ID,'
      '  TASK_ID,'
      '  ITEM_NUM,'
      '  APPLICATION,'
      '  APP_VERSION,'
      '  TASK_DATE,'
      '  STATUS_DATE,'
      '  REPORTED_BY,'
      '  ASSIGNED_TO,'
      '  STATUS,'
      '  FIXED_VERSION,'
      '  FORM_SECTION,'
      '  ISSUE,'
      '  NOTES'
      'from task_items'
      'where TASK_ID = :TASK_ID'
      'order by ITEM_NUM')
    Left = 306
    Top = 134
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'TASK_ID'
        Value = nil
      end>
    object uqTaskItemsTASK_ITEM_ID: TStringField
      FieldName = 'TASK_ITEM_ID'
      Required = True
      Size = 7
    end
    object uqTaskItemsTASK_ID: TStringField
      FieldName = 'TASK_ID'
      Required = True
      Size = 7
    end
    object uqTaskItemsITEM_NUM: TShortintField
      FieldName = 'ITEM_NUM'
      Required = True
    end
    object uqTaskItemsAPPLICATION: TStringField
      FieldName = 'APPLICATION'
      Required = True
      Size = 255
    end
    object uqTaskItemsAPP_VERSION: TStringField
      FieldName = 'APP_VERSION'
      Required = True
      Size = 50
    end
    object uqTaskItemsTASK_DATE: TDateField
      FieldName = 'TASK_DATE'
      Required = True
    end
    object uqTaskItemsSTATUS_DATE: TDateField
      FieldName = 'STATUS_DATE'
      Required = True
    end
    object uqTaskItemsREPORTED_BY: TStringField
      FieldName = 'REPORTED_BY'
      Required = True
      Size = 50
    end
    object uqTaskItemsASSIGNED_TO: TStringField
      FieldName = 'ASSIGNED_TO'
      Required = True
      Size = 50
    end
    object uqTaskItemsSTATUS: TStringField
      FieldName = 'STATUS'
      Required = True
      Size = 100
    end
    object uqTaskItemsFIXED_VERSION: TStringField
      FieldName = 'FIXED_VERSION'
      Required = True
      Size = 50
    end
    object uqTaskItemsFORM_SECTION: TStringField
      FieldName = 'FORM_SECTION'
      Required = True
      Size = 255
    end
    object uqTaskItemsISSUE: TStringField
      FieldName = 'ISSUE'
      Required = True
      Size = 1000
    end
    object uqTaskItemsNOTES: TStringField
      FieldName = 'NOTES'
      Required = True
      Size = 1000
    end
  end
  object uqEnsureBlankRow: TUniQuery
    Connection = ucETaskApi
    SQL.Strings = (
      'insert ignore into web_tasks ('
      '  TASK_ITEM_ID,'
      '  TASK_ID,'
      '  PROJECT_ID,'
      '  APPLICATION,'
      '  APP_VERSION,'
      '  TASK_DATE,'
      '  STATUS_DATE,'
      '  REPORTED_BY,'
      '  ASSIGNED_TO,'
      '  STATUS,'
      '  FIXED_VERSION,'
      '  FORM_SECTION,'
      '  ISSUE,'
      '  NOTES'
      ')'
      'values ('
      '  :TASK_ID,'
      '  :TASK_ID,'
      
        '  coalesce((select PROJECT_ID from tasks where TASK_ID = :TASK_I' +
        'D), '#39#39'),'
      '  '#39#39','
      '  '#39#39','
      '  curdate(),'
      '  curdate(),'
      '  '#39#39','
      '  '#39#39','
      '  '#39#39','
      '  '#39#39','
      '  '#39#39','
      '  '#39#39','
      '  '#39#39
      ')')
    Left = 306
    Top = 254
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'TASK_ID'
        Value = nil
      end>
  end
end
