示例#1
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        public new tblOrder_Record MemberwiseClone()
        {
            tblOrder_Record newRecord = new tblOrder_Record();

            newRecord.recordWasLoadedFromDB = this.recordWasLoadedFromDB;
            newRecord.recordIsLoaded        = this.recordIsLoaded;
            newRecord.connectionString      = this.connectionString;

            newRecord.col_Ord_GuidID = this.col_Ord_GuidID;


            newRecord.col_Ord_DatOrderedOnWasSet     = this.col_Ord_DatOrderedOnWasSet;
            newRecord.col_Ord_DatOrderedOnWasUpdated = this.col_Ord_DatOrderedOnWasUpdated;
            newRecord.col_Ord_DatOrderedOn           = this.col_Ord_DatOrderedOn;

            newRecord.col_Ord_LngCustomerIDWasSet     = this.col_Ord_LngCustomerIDWasSet;
            newRecord.col_Ord_LngCustomerIDWasUpdated = this.col_Ord_LngCustomerIDWasUpdated;
            newRecord.col_Ord_LngCustomerID           = this.col_Ord_LngCustomerID;

            newRecord.col_Ord_LngCustomerID_Record = this.col_Ord_LngCustomerID_Record.MemberwiseClone();

            newRecord.col_Ord_CurTotalWasSet     = this.col_Ord_CurTotalWasSet;
            newRecord.col_Ord_CurTotalWasUpdated = this.col_Ord_CurTotalWasUpdated;
            newRecord.col_Ord_CurTotal           = this.col_Ord_CurTotal;

            newRecord.displayName = this.displayName;

            return(newRecord);
        }
示例#2
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            tblOrder_Record recordToDelete = record as tblOrder_Record;

            if (recordToDelete == null)
            {
                throw new ArgumentException("Invalid record type. Must be 'OlymarsDemo.BusinessComponents.tblOrder_Record'.", "record");
            }

            bool alreadyOpened = false;

            Params.spD_tblOrder Param = new Params.spD_tblOrder(true);
            Param.CommandTimeOut = this.deleteCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_Ord_GuidID = recordToDelete.Col_Ord_GuidID;

            SPs.spD_tblOrder Sp = new SPs.spD_tblOrder(true);

            Sp.Execute(ref Param);
            CloseConnection(Sp.Connection, alreadyOpened);

            if (internalRecords != null)
            {
                internalRecords.Remove(recordToDelete);
            }
        }
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="col_Oit_GuidOrderID">[To be supplied.]</param>
        /// <param name="parent">[To be supplied.]</param>
        internal void LoadFrom_Oit_GuidOrderID(System.Data.SqlTypes.SqlGuid col_Oit_GuidOrderID, tblOrder_Record parent)
        {
            if (col_Oit_GuidOrderID.IsNull)
            {
                throw new ArgumentException("Parameter can not be null", "col_Oit_GuidOrderID");
            }

            if (parent == null)
            {
                throw new ArgumentException("Parameter can not be null", "parent");
            }

            this.col_Oit_GuidOrderID = col_Oit_GuidOrderID;
            this.parent     = parent;
            this.parentType = tblOrderItem_CollectionParentType.Col_Oit_GuidOrderID;
        }
示例#4
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        public void Refresh()
        {
            internalRecords = new System.Collections.ArrayList();

            bool alreadyOpened = false;

            Params.spS_tblOrder_Display Param = new Params.spS_tblOrder_Display(true);
            Param.CommandTimeOut = this.selectCollectionCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            if (!this.col_Ord_LngCustomerID.IsNull)
            {
                Param.Param_Ord_LngCustomerID = this.col_Ord_LngCustomerID;
            }

            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_tblOrder_Display            Sp            = new SPs.spS_tblOrder_Display(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                while (sqlDataReader.Read())
                {
                    tblOrder_Record record = null;

                    switch (this.lastKnownConnectionType)
                    {
                    case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                        record = new tblOrder_Record(this.connectionString, sqlDataReader.GetSqlGuid(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_ID1.ColumnIndex));
                        break;

                    case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                        record = new tblOrder_Record(this.sqlConnection, sqlDataReader.GetSqlGuid(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_ID1.ColumnIndex));
                        break;

                    case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                        record = new tblOrder_Record(this.sqlTransaction, sqlDataReader.GetSqlGuid(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_ID1.ColumnIndex));
                        break;
                    }


                    record.UpdateCommandTimeOut = this.updateCommandTimeOut;
                    record.SelectCommandTimeOut = this.selectCommandTimeOut;

                    if (sqlDataReader.GetFieldType(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_Display.ColumnIndex) == typeof(string))
                    {
                        record.displayName = sqlDataReader.GetString(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_Display.ColumnIndex);
                    }
                    else
                    {
                        record.displayName = sqlDataReader.GetValue(SPs.spS_tblOrder_Display.Resultset1.Fields.Column_Display.ColumnIndex).ToString();
                    }

                    internalRecords.Add(record);
                }

                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                this.recordsAreLoaded = true;
            }
            else
            {
                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                this.recordsAreLoaded = false;
                throw new OlymarsDemo.DataClasses.CustomException(Param, "OlymarsDemo.BusinessComponents.tblOrder_Collection", "Refresh");
            }
        }
示例#5
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        /// <returns>[To be supplied.]</returns>
        public IBusinessComponentRecord Add(IBusinessComponentRecord record)
        {
            tblOrder_Record recordToAdd = record as tblOrder_Record;

            if (recordToAdd == null)
            {
                throw new ArgumentException("Invalid record type. Must be 'OlymarsDemo.BusinessComponents.tblOrder_Record'.", "record");
            }

            switch (this.parentType)
            {
            case tblOrder_CollectionParentType.Col_Ord_LngCustomerID:
                recordToAdd.Col_Ord_LngCustomerID = ((tblCustomer_Record)this.parent).Col_Cus_LngID;
                break;
            }

            bool alreadyOpened = false;

            Params.spI_tblOrder Param = new Params.spI_tblOrder(true);
            Param.CommandTimeOut = this.insertCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_Ord_GuidID        = recordToAdd.Col_Ord_GuidID;
            Param.Param_Ord_DatOrderedOn  = recordToAdd.Col_Ord_DatOrderedOn;
            Param.Param_Ord_LngCustomerID = recordToAdd.Col_Ord_LngCustomerID;
            Param.Param_Ord_CurTotal      = recordToAdd.Col_Ord_CurTotal;

            SPs.spI_tblOrder Sp = new SPs.spI_tblOrder(false);
            if (Sp.Execute(ref Param))
            {
                tblOrder_Record newRecord = null;

                switch (this.lastKnownConnectionType)
                {
                case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                    newRecord = new tblOrder_Record(this.connectionString, Param.Param_Ord_GuidID);
                    break;

                case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                    newRecord = new tblOrder_Record(this.sqlConnection, Param.Param_Ord_GuidID);
                    break;

                case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                    newRecord = new tblOrder_Record(this.sqlTransaction, Param.Param_Ord_GuidID);
                    break;
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                if (internalRecords != null)
                {
                    internalRecords.Add(newRecord);
                }

                if (this.addedRecords == null)
                {
                    this.addedRecords = new System.Collections.ArrayList();
                }
                this.addedRecords.Add(newRecord);

                return(newRecord);
            }
            else
            {
                throw new OlymarsDemo.DataClasses.CustomException(Param, "OlymarsDemo.BusinessComponents.tblOrder_Collection", "Add");
            }
        }