private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, string storageName)
        {
            SqlCommand cmd = new SqlCommand();

            StringBuilder sqlStatement = new StringBuilder("Delete " + storageName);
            sqlStatement.Append(" Where " + keyPropertyBridge.Name + " = " + keyPropertyBridge.AtName);

            cmd.CommandText = sqlStatement.ToString();
            keyPropertyBridge.SetSqlParameter(cmd);

            return cmd;
        }
        private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, string storageName)
        {
            SqlCommand cmd = new SqlCommand();

            StringBuilder sqlStatement = new StringBuilder("Delete " + storageName);

            sqlStatement.Append(" Where " + keyPropertyBridge.Name + " = " + keyPropertyBridge.AtName);

            cmd.CommandText = sqlStatement.ToString();
            keyPropertyBridge.SetSqlParameter(cmd);

            return(cmd);
        }
        private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, List<PropertyBridge> propertyBridgeList, string storageName, bool isAutoGenerated)
        {
            SqlCommand cmd = new SqlCommand();

            StringBuilder sqlUpdateStatement = new StringBuilder("Insert " + storageName);
            StringBuilder fieldList = new StringBuilder();
            StringBuilder parameterList = new StringBuilder();

            for (int i = 0; i < propertyBridgeList.Count; i++)
            {
                fieldList.Append("[" + propertyBridgeList[i].Name + "]");
                fieldList.Append(", ");

                parameterList.Append(propertyBridgeList[i].AtName);
                parameterList.Append(", ");
            }

            if (isAutoGenerated == true)
            {
                fieldList.Remove(fieldList.Length - 2, 2);
                parameterList.Remove(parameterList.Length - 2, 2);
            }
            else
            {
                fieldList.Append(keyPropertyBridge.Name);
                parameterList.Append(keyPropertyBridge.AtName);
            }

            sqlUpdateStatement.Append("(" + fieldList + ")");
            sqlUpdateStatement.Append(" Values ");
            sqlUpdateStatement.Append("(" + parameterList + ")");

            cmd.CommandText = sqlUpdateStatement.ToString();
            keyPropertyBridge.SetSqlParameter(cmd);
            foreach (PropertyBridge propertyBridge in propertyBridgeList)
            {
                propertyBridge.SetSqlParameter(cmd);
            }

            return cmd;
        }
        private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, List <PropertyBridge> propertyBridgeList, string storageName, bool isAutoGenerated)
        {
            SqlCommand cmd = new SqlCommand();

            StringBuilder sqlUpdateStatement = new StringBuilder("Insert " + storageName);
            StringBuilder fieldList          = new StringBuilder();
            StringBuilder parameterList      = new StringBuilder();

            for (int i = 0; i < propertyBridgeList.Count; i++)
            {
                fieldList.Append("[" + propertyBridgeList[i].Name + "]");
                fieldList.Append(", ");

                parameterList.Append(propertyBridgeList[i].AtName);
                parameterList.Append(", ");
            }

            if (isAutoGenerated == true)
            {
                fieldList.Remove(fieldList.Length - 2, 2);
                parameterList.Remove(parameterList.Length - 2, 2);
            }
            else
            {
                fieldList.Append(keyPropertyBridge.Name);
                parameterList.Append(keyPropertyBridge.AtName);
            }

            sqlUpdateStatement.Append("(" + fieldList + ")");
            sqlUpdateStatement.Append(" Values ");
            sqlUpdateStatement.Append("(" + parameterList + ")");

            cmd.CommandText = sqlUpdateStatement.ToString();
            keyPropertyBridge.SetSqlParameter(cmd);
            foreach (PropertyBridge propertyBridge in propertyBridgeList)
            {
                propertyBridge.SetSqlParameter(cmd);
            }

            return(cmd);
        }
        private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, List<PropertyBridge> propertyBridgeList, string storageName)
        {
            SqlCommand cmd = new SqlCommand();

            keyPropertyBridge.SetSqlParameter(cmd);
            StringBuilder sqlStatement = new StringBuilder("Update " + storageName + " Set ");

            for (int i = 0; i < propertyBridgeList.Count; i++)
            {
                sqlStatement.Append("[" + propertyBridgeList[i].Name + "] = " + propertyBridgeList[i].AtName);
                if (i != propertyBridgeList.Count - 1)
                {
                    sqlStatement.Append(", ");
                }
                propertyBridgeList[i].SetSqlParameter(cmd);
            }

            sqlStatement.Append(" Where " + keyPropertyBridge.Name + " = " + keyPropertyBridge.AtName);
            cmd.CommandText = sqlStatement.ToString();

            return cmd;
        }
        private SqlCommand CreateSqlCommand(PropertyBridge keyPropertyBridge, List <PropertyBridge> propertyBridgeList, string storageName)
        {
            SqlCommand cmd = new SqlCommand();

            keyPropertyBridge.SetSqlParameter(cmd);
            StringBuilder sqlStatement = new StringBuilder("Update " + storageName + " Set ");

            for (int i = 0; i < propertyBridgeList.Count; i++)
            {
                sqlStatement.Append("[" + propertyBridgeList[i].Name + "] = " + propertyBridgeList[i].AtName);
                if (i != propertyBridgeList.Count - 1)
                {
                    sqlStatement.Append(", ");
                }
                propertyBridgeList[i].SetSqlParameter(cmd);
            }

            sqlStatement.Append(" Where " + keyPropertyBridge.Name + " = " + keyPropertyBridge.AtName);
            cmd.CommandText = sqlStatement.ToString();

            return(cmd);
        }