Click here to Skip to main content
15,891,136 members
Articles / Desktop Programming / WPF

DBTool for Oracle - Part 1

Rate me:
Please Sign up or sign in to vote.
4.92/5 (45 votes)
13 Apr 2014CPOL18 min read 137.6K   5.1K   88  
Enhance productivity and reliability, write your own tools.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Harlinn.Oracle.DBTool.Types.Projects;
using Harlinn.Oracle.DBTool.Generators.Utils;

namespace Harlinn.Oracle.DBTool.Generators.Types
{
    public class OperationGenerator : GeneratorBase
    {
        ProjectTabular tabular;

        public OperationGenerator(ProjectTabular tabular)
        {
            this.tabular = tabular;    
        }


        public override string GetFilename()
        {
            string fileName = tabular.GetBaseName()+"Operations";
            string directory = GetDirectory();

            string result = directory + "\\" + fileName + ".cs";
            return result;
        }

        public override string GetDirectory()
        {
            string namespace_ = Project.Current.DataNamespace + ".Operations";
            string directory = Project.Current.NamespaceToDirectory(namespace_);
            return directory;
        }


        public void Generate()
        {
            string commonNamespace = Project.Current.CommonNamespace;
            string dataNamespace = Project.Current.DataNamespace;


            WriteLine("using System;");
            WriteLine("using System.Collections.Generic;");
            WriteLine("using System.Data;");
            WriteLine("using System.Reflection;");
            WriteLine("using System.Runtime.Serialization;");

            WriteLine("using Oracle.DataAccess.Client;");
            WriteLine("using Oracle.DataAccess.Types;");
            WriteLine();
            WriteLine();
            WriteLine("using " + commonNamespace + ";");
            WriteLine("using " + dataNamespace + ";");

            WriteLine();
            WriteLine("namespace " + Project.Current.DataNamespace + ".Operations");
            WriteLine("{");

            Process();

            WriteLine("}");
            WriteLine();
            WriteLine();
        }



        private void Process()
        {
            GenerateGetOperations(tabular);

            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                GenerateSaveOperation(projectTable);
                GenerateInsertOperation(projectTable);
                GenerateUpdateOperation(projectTable);
                GenerateDeleteOperation(projectTable);
            }

        }

        private void GenerateGetOperations(ProjectTabular tabular)
        {
            GenerateGetAllOperation(tabular);

            GenerateGetByPrimaryKeyOperation(tabular);

            ProjectTabularIndexes indexes = tabular.GetIndexes();
            foreach (ProjectTabularIndex index in indexes.Children)
            {
                GenerateGetByIndexOperation(tabular, index);
            }


            ProjectTabularReferences references = tabular.GetReferences();
            foreach (ProjectTabularReference reference in references.Children)
            {
                GenerateGetByReferenceOperation(tabular, reference);
            }

            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                GenerateTagValueGetOperation(projectTable);
            }
        }

        public void GenerateGetAllOperation(ProjectTabular tabular)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();
            

            string methodName = "GetAll" + baseName + "s";
            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        private long tag;");
                    WriteLine();
                }
            }
            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName+ ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private List<" + dataClassName + "> result;");
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        long tag;");
                    WriteLine();
                }
            }
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public List<" + dataClassName + "> Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("    }");
            WriteLine();

        }

        public void GenerateGetByPrimaryKeyOperation(ProjectTabular tabular)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();

            if (!(tabular is ProjectTable))
            {
                return;
            }


            ProjectTabularPrimaryKey primaryKey = tabular.GetPrimaryKey();
            List<ProjectTabularField> fields = primaryKey.GetFieldList();
            string methodName = MethodNamesHelper.GetServiceGetByMethodName(primaryKey);

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        private long tag;");
                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private " + dataClassName + " result;");
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        long tag;");

                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();
        }

        public void GenerateGetByIndexOperation(ProjectTabular tabular, ProjectTabularIndex index)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = index.GetFieldList();
            string methodName = MethodNamesHelper.GetServiceGetByMethodName(index);

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        private long tag;");
                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private " + dataClassName + " result;");
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        long tag;");

                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if ((projectTable.IsTimeSeries) && (projectTable.IsTagValue == false))
                {
                    methodName = MethodNamesHelper.GetServiceGetByForTimeStampMethodName(index);

                    requestClassName = methodName + "Request";
                    replyClassName = methodName + "Reply";

                    WriteLine();
                    WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
                    WriteLine("    [Serializable]");
                    WriteLine("    public class " + requestClassName + " : OperationRequest");
                    WriteLine("    {");
                    WriteLine();
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        private long tag;");
                    }

                    for (int i = 0; i < fields.Count; i++)
                    {
                        ProjectTabularField field = fields[i];

                        string typeName = field.PropertyType;
                        string fieldName = field.PropertyFieldName;

                        WriteLine("        private " + typeName + " " + fieldName + ";");

                    }
                    WriteLine();

                    WriteLine("        public " + requestClassName + "()");
                    WriteLine("        {");
                    WriteLine("        }");
                    WriteLine();
                    WriteLine("        public " + requestClassName + "(Guid requestId)");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("        }");
                    WriteLine();
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                        WriteLine("            : base(requestId)");
                        WriteLine("        {");
                        WriteLine("            this.tag = tag;");
                        WriteLine("        }");
                        WriteLine();
                    }
                    WriteLine("        public override ServiceOperation ServiceOperation");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return ServiceOperation." + methodName + ";");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        [DataMember(EmitDefaultValue=false)]");
                        WriteLine("        public long Tag");
                        WriteLine("        {");
                        WriteLine("            get");
                        WriteLine("            {");
                        WriteLine("                return tag;");
                        WriteLine("            }");
                        WriteLine("            set");
                        WriteLine("            {");
                        WriteLine("                this.tag = value;");
                        WriteLine("            }");
                        WriteLine("        }");
                        WriteLine();
                    }
                    for (int i = 0; i < fields.Count; i++)
                    {
                        ProjectTabularField field = fields[i];
                        string propertyType = field.PropertyType;
                        string propertyName = field.PropertyName;
                        string propertyFieldName = field.PropertyFieldName;

                        WriteLine("        [DataMember(EmitDefaultValue=false)]");
                        WriteLine("        public " + propertyType + " " + propertyName);
                        WriteLine("        {");
                        WriteLine("            get");
                        WriteLine("            {");
                        WriteLine("                return " + propertyFieldName + ";");
                        WriteLine("            }");
                        WriteLine("            set");
                        WriteLine("            {");
                        WriteLine("                this." + propertyFieldName + " = value;");
                        WriteLine("            }");
                        WriteLine("        }");
                        WriteLine();
                        WriteLine();

                    }
                    WriteLine("    }");
                    WriteLine();

                    WriteLine();
                    WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
                    WriteLine("    [Serializable]");
                    WriteLine("    public class " + replyClassName + " : OperationReply");
                    WriteLine("    {");
                    WriteLine();
                    WriteLine("        private " + dataClassName + " result;");
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        long tag;");

                    }

                    for (int i = 0; i < fields.Count; i++)
                    {
                        ProjectTabularField field = fields[i];

                        string typeName = field.PropertyType;
                        string fieldName = field.PropertyFieldName;

                        WriteLine("        private " + typeName + " " + fieldName + ";");

                    }
                    WriteLine();
                    WriteLine("        public " + replyClassName + "()");
                    WriteLine("        {");
                    WriteLine("        }");
                    WriteLine();
                    WriteLine("        public " + replyClassName + "(Guid requestId)");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("        }");
                    WriteLine();
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                        WriteLine("            : base(requestId)");
                        WriteLine("        {");
                        WriteLine("            this.tag = tag;");
                        WriteLine("        }");
                        WriteLine();
                    }
                    WriteLine("        public override ServiceOperation ServiceOperation");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return ServiceOperation." + methodName + ";");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    if (projectTable.IsTagValue)
                    {
                        WriteLine("        [DataMember]");
                        WriteLine("        public long Tag");
                        WriteLine("        {");
                        WriteLine("            get");
                        WriteLine("            {");
                        WriteLine("                return tag;");
                        WriteLine("            }");
                        WriteLine("            set");
                        WriteLine("            {");
                        WriteLine("                this.tag = value;");
                        WriteLine("            }");
                        WriteLine("        }");
                        WriteLine();
                    }
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public " + dataClassName + " Result");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return result;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.result = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    for (int i = 0; i < fields.Count; i++)
                    {
                        ProjectTabularField field = fields[i];
                        string propertyType = field.PropertyType;
                        string propertyName = field.PropertyName;
                        string propertyFieldName = field.PropertyFieldName;

                        WriteLine("        [DataMember(EmitDefaultValue=false)]");
                        WriteLine("        public " + propertyType + " " + propertyName);
                        WriteLine("        {");
                        WriteLine("            get");
                        WriteLine("            {");
                        WriteLine("                return " + propertyFieldName + ";");
                        WriteLine("            }");
                        WriteLine("            set");
                        WriteLine("            {");
                        WriteLine("                this." + propertyFieldName + " = value;");
                        WriteLine("            }");
                        WriteLine("        }");
                        WriteLine();
                        WriteLine();

                    }
                    WriteLine("    }");
                    WriteLine();

                }
            }
        }

        private void GenerateGetByReferenceOperation(ProjectTabular tabular, ProjectTabularReference reference)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = reference.GetFieldList();
            string methodName = MethodNamesHelper.GetServiceGetByMethodName(reference);

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        private long tag;");
                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private List<" + dataClassName + "> result;");
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        long tag;");

                }
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                    WriteLine("            : base(requestId)");
                    WriteLine("        {");
                    WriteLine("            this.tag = tag;");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (tabular is ProjectTable)
            {
                ProjectTable projectTable = (ProjectTable)tabular;
                if (projectTable.IsTagValue)
                {
                    WriteLine("        [DataMember]");
                    WriteLine("        public long Tag");
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return tag;");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.tag = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                }
            }
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public List<" + dataClassName + "> Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

        }

        private void GenerateTagValueGetOperation(ProjectTable projectTable)
        {
            if (projectTable.IsTagValue)
            {
                GenerateTagValueGetForOperation(projectTable);
                GenerateTagValueGetForLastTimeStampOperation(projectTable);
                GenerateTagValueGetIntervalOperation(projectTable);
            }
        }


        private void GenerateTagValueGetForOperation(ProjectTable projectTable)
        {
            string baseName = projectTable.GetBaseName();
            string dataClassName = projectTable.GetDataTypeClassName();

            string methodName = "Get" + baseName + "ForTimeStamp";

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private long tag;");
            WriteLine("        private DateTime timeStamp;");
            WriteLine();
            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();

            WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();

            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime TimeStamp");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return timeStamp;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.timeStamp = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private " + dataClassName + " result;");
            WriteLine("        private long tag;");
            WriteLine("        private DateTime timeStamp;");
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime TimeStamp");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return timeStamp;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.timeStamp = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("    }");
            WriteLine();
        }


        private void GenerateTagValueGetForLastTimeStampOperation(ProjectTable projectTable)
        {
            string baseName = projectTable.GetBaseName();
            string dataClassName = projectTable.GetDataTypeClassName();

            string methodName = "Get" + baseName + "ForLastTimeStamp";

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private long tag;");
            WriteLine();
            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();

            WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();

            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private " + dataClassName + " result;");
            WriteLine("        private long tag;");
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("    }");
            WriteLine();
        }



        private void GenerateTagValueGetIntervalOperation(ProjectTable projectTable)
        {
            string baseName = projectTable.GetBaseName();
            string dataClassName = projectTable.GetDataTypeClassName();

            string methodName = "Get" + baseName + "ForInterval";

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private long tag;");
            WriteLine("        private DateTime startInterval;");
            WriteLine("        private DateTime endInterval;");
            WriteLine();
            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            
            WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();
            
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime StartInterval");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return startInterval;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.startInterval = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime EndInterval");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return endInterval;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.endInterval = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private List<" + dataClassName + "> result;");
            WriteLine("        private long tag;");
            WriteLine("        private DateTime startInterval;");
            WriteLine("        private DateTime endInterval;");
            WriteLine();
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("            this.tag = tag;");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public long Tag");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return tag;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.tag = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime StartInterval");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return startInterval;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.startInterval = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public DateTime EndInterval");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return endInterval;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.endInterval = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public List<" + dataClassName + "> Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            
            WriteLine("    }");
            WriteLine();
        }


        public void GenerateSaveOperation(ProjectTable projectTable)
        {
            ProjectTabularField concurrencyField = projectTable.GetConcurrencyField();
            if (concurrencyField == null)
            {
                return;
            }
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = projectTable.GetFieldList();
            string methodName = "Save" + baseName;

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            //WriteLine("        private " + dataClassName + " result;");
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        long tag;");

            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                for (int i = 0; i < fields.Count; i++)
                {
                    ProjectTabularField field = fields[i];

                    string typeName = field.PropertyType;
                    string fieldName = field.PropertyName;

                    WriteLine("        private " + typeName + " conflicting" + fieldName + ";");

                }
                WriteLine();
            }
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            /*WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();*/
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();

                for (int i = 0; i < fields.Count; i++)
                {
                    ProjectTabularField field = fields[i];
                    string propertyType = field.PropertyType;
                    string propertyName = field.PropertyName;
                    string propertyFieldName = field.PropertyName;

                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public " + propertyType + " Conflicting" + propertyName);
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return conflicting" + propertyFieldName + ";");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.conflicting" + propertyFieldName + " = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    WriteLine();

                }

                WriteLine();
            }


            WriteLine("    }");
            WriteLine();



        }
        public void GenerateInsertOperation(ProjectTable projectTable)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = projectTable.GetFieldList();
            string methodName = "Insert" + baseName;

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";
            string notificationClassName = methodName + "Notification";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            ProjectTabularField concurrencyField = projectTable.GetConcurrencyField();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + notificationClassName + " : OperationNotification");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }

            WriteLine("        public " + notificationClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + notificationClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + notificationClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            //WriteLine("        private " + dataClassName + " result;");
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        long tag;");

            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            /*WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();*/
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }


            WriteLine("    }");
            WriteLine();
        }
        public void GenerateUpdateOperation(ProjectTable projectTable)
        {
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = projectTable.GetFieldList();
            string methodName = "Update" + baseName;

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";
            string notificationClassName = methodName + "Notification";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            ProjectTabularField concurrencyField = projectTable.GetConcurrencyField();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + notificationClassName + " : OperationNotification");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                WriteLine();
            }

            WriteLine("        public " + notificationClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + notificationClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + notificationClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();


            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            //WriteLine("        private " + dataClassName + " result;");
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        long tag;");

            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine();
            if (concurrencyField != null)
            {
                WriteLine("        private ElementState " + projectTable.ElementStatefieldName + ";");
                for (int i = 0; i < fields.Count; i++)
                {
                    ProjectTabularField field = fields[i];

                    string typeName = field.PropertyType;
                    string fieldName = field.PropertyName;

                    WriteLine("        private " + typeName + " conflicting" + fieldName + ";");

                }
                WriteLine();
            }
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            /*WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public " + dataClassName + " Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();*/
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            if (concurrencyField != null)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public ElementState " + projectTable.ElementStatePropertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + projectTable.ElementStatefieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + projectTable.ElementStatefieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();

                for (int i = 0; i < fields.Count; i++)
                {
                    ProjectTabularField field = fields[i];
                    string propertyType = field.PropertyType;
                    string propertyName = field.PropertyName;
                    string propertyFieldName = field.PropertyName;

                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public " + propertyType + " Conflicting" + propertyName);
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return conflicting" + propertyFieldName + ";");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this.conflicting" + propertyFieldName + " = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    WriteLine();

                }

                WriteLine();
            }


            WriteLine("    }");
            WriteLine();
        }
        public void GenerateDeleteOperation(ProjectTable projectTable)
        {
            ProjectTabularField concurrencyField = projectTable.GetConcurrencyField();
            string baseName = tabular.GetBaseName();
            string dataClassName = tabular.GetDataTypeClassName();


            List<ProjectTabularField> fields = projectTable.GetPrimaryKeyFieldList();
            if (concurrencyField != null)
            {
                fields.Add(concurrencyField);
            }
            string methodName = "Delete" + baseName;

            string requestClassName = methodName + "Request";
            string replyClassName = methodName + "Reply";
            string notificationClassName = methodName + "Notification";

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + requestClassName + " : OperationRequest");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();

            WriteLine("        public " + requestClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + requestClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + requestClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + notificationClassName + " : OperationNotification");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        private long tag;");
            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;
                if (field.Concurrency == false)
                {
                    WriteLine("        private " + typeName + " " + fieldName + ";");
                }

            }
            WriteLine();

            WriteLine("        public " + notificationClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + notificationClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + notificationClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }
            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;
                if (field.Concurrency == false)
                {
                    WriteLine("        [DataMember(EmitDefaultValue=false)]");
                    WriteLine("        public " + propertyType + " " + propertyName);
                    WriteLine("        {");
                    WriteLine("            get");
                    WriteLine("            {");
                    WriteLine("                return " + propertyFieldName + ";");
                    WriteLine("            }");
                    WriteLine("            set");
                    WriteLine("            {");
                    WriteLine("                this." + propertyFieldName + " = value;");
                    WriteLine("            }");
                    WriteLine("        }");
                    WriteLine();
                    WriteLine();
                }
            }
            WriteLine("    }");
            WriteLine();

            WriteLine();
            WriteLine("    [DataContract(Namespace = Constants.Namespace)]");
            WriteLine("    [Serializable]");
            WriteLine("    public class " + replyClassName + " : OperationReply");
            WriteLine("    {");
            WriteLine();
            WriteLine("        private int result;");
            WriteLine("        private Guid clientId;");
            if (projectTable.IsTagValue)
            {
                WriteLine("        long tag;");

            }

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];

                string typeName = field.PropertyType;
                string fieldName = field.PropertyFieldName;

                WriteLine("        private " + typeName + " " + fieldName + ";");

            }
            WriteLine();
            WriteLine();
            
            WriteLine("        public " + replyClassName + "()");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            WriteLine("        public " + replyClassName + "(Guid requestId)");
            WriteLine("            : base(requestId)");
            WriteLine("        {");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        public " + replyClassName + "(Guid requestId, long tag )");
                WriteLine("            : base(requestId)");
                WriteLine("        {");
                WriteLine("            this.tag = tag;");
                WriteLine("        }");
                WriteLine();
            }
            WriteLine("        public override ServiceOperation ServiceOperation");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return ServiceOperation." + methodName + ";");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public Guid ClientId");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return clientId;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.clientId = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();
            if (projectTable.IsTagValue)
            {
                WriteLine("        [DataMember]");
                WriteLine("        public long Tag");
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return tag;");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this.tag = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
            }

            WriteLine("        [DataMember(EmitDefaultValue=false)]");
            WriteLine("        public int Result");
            WriteLine("        {");
            WriteLine("            get");
            WriteLine("            {");
            WriteLine("                return result;");
            WriteLine("            }");
            WriteLine("            set");
            WriteLine("            {");
            WriteLine("                this.result = value;");
            WriteLine("            }");
            WriteLine("        }");
            WriteLine();

            for (int i = 0; i < fields.Count; i++)
            {
                ProjectTabularField field = fields[i];
                string propertyType = field.PropertyType;
                string propertyName = field.PropertyName;
                string propertyFieldName = field.PropertyFieldName;

                WriteLine("        [DataMember(EmitDefaultValue=false)]");
                WriteLine("        public " + propertyType + " " + propertyName);
                WriteLine("        {");
                WriteLine("            get");
                WriteLine("            {");
                WriteLine("                return " + propertyFieldName + ";");
                WriteLine("            }");
                WriteLine("            set");
                WriteLine("            {");
                WriteLine("                this." + propertyFieldName + " = value;");
                WriteLine("            }");
                WriteLine("        }");
                WriteLine();
                WriteLine();

            }

            WriteLine("    }");
            WriteLine();
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Sea Surveillance AS
Norway Norway
Chief Architect - Sea Surveillance AS.

Specializing in integrated operations and high performance computing solutions.

I’ve been fooling around with computers since the early eighties, I’ve even done work on CP/M and MP/M.

Wrote my first “real” program on a BBC micro model B based on a series in a magazine at that time. It was fun and I got hooked on this thing called programming ...

A few Highlights:

  • High performance application server development
  • Model Driven Architecture and Code generators
  • Real-Time Distributed Solutions
  • C, C++, C#, Java, TSQL, PL/SQL, Delphi, ActionScript, Perl, Rexx
  • Microsoft SQL Server, Oracle RDBMS, IBM DB2, PostGreSQL
  • AMQP, Apache qpid, RabbitMQ, Microsoft Message Queuing, IBM WebSphereMQ, Oracle TuxidoMQ
  • Oracle WebLogic, IBM WebSphere
  • Corba, COM, DCE, WCF
  • AspenTech InfoPlus.21(IP21), OsiSoft PI


More information about what I do for a living can be found at: harlinn.com or LinkedIn

You can contact me at espen@harlinn.no

Comments and Discussions