using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace fatd_faturamento.DAL.Execucao
{
    public class execucaoQuery
    {
        public string vFILTER = null;
        public string vTABLE = null;
        public string vINNERJOIN = null;
        public string vAND = null;
        public string vORDERBY = null;

        #region " Comandos SQL "

        StringBuilder sb = new StringBuilder();

        public string QueryInsert
        {
            get
            {
                this.sb.Clear();

                this.sb.AppendLine("INSERT INTO  ");
                this.sb.AppendLine(vTABLE);
                this.sb.AppendLine("SET  ");
                this.sb.AppendLine(vFILTER);

                return sb.ToString();
            }
        }

        public string QueryUpdate
        {
            get
            {
                this.sb.Clear();

                this.sb.AppendLine("UPDATE  ");
                this.sb.AppendLine(vTABLE);
                this.sb.AppendLine("SET  ");
                this.sb.AppendLine(vFILTER);
                this.sb.AppendLine("WHERE 1 = 1 ");
                this.sb.AppendLine(vAND);

                return sb.ToString();
            }
        }

        public string QueryDelete
        {
            get
            {
                this.sb.Clear();

                this.sb.AppendLine("DELETE FROM ");
                this.sb.AppendLine(vTABLE);
                this.sb.AppendLine("WHERE 1 = 1 ");
                this.sb.AppendLine(vAND);
                this.sb.AppendLine(vORDERBY);

                return sb.ToString();
            }
        }

        public string QuerySelect
        {
            get
            {
                this.sb.Clear();

                this.sb.AppendLine("SELECT ");
                this.sb.AppendLine(vFILTER);
                this.sb.AppendLine("FROM ");
                this.sb.AppendLine(vTABLE);
                this.sb.AppendLine(vINNERJOIN);
                this.sb.AppendLine("WHERE 1 = 1  ");
                this.sb.AppendLine(vAND);
                this.sb.AppendLine(vORDERBY);

                return sb.ToString();
            }
        }

        public string QueryExecute
        {
            get
            {
                this.sb.Clear();

                this.sb.AppendLine(vAND);
                this.sb.AppendLine(vORDERBY);

                return sb.ToString();
            }
        }

        #endregion

    }
}
