public Tables.tblOrder_Record GetOne_tblOrder_Record(Guid id)
        {
            Params.spS_tblOrder param = new Params.spS_tblOrder(true);

            param.SetUpConnection(string.Empty);

            param.Param_Ord_GuidID = id;

            using (SPs.spS_tblOrder sp = new SPs.spS_tblOrder(true)) {
                System.Data.SqlClient.SqlDataReader sqlDataReader = null;
                sp.Execute(ref param, out sqlDataReader);
                param.Dispose();

                if (sqlDataReader.Read())
                {
                    Tables.tblOrder_Record record = new Tables.tblOrder_Record();

                    record.Col_Ord_GuidID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_GuidID.ColumnIndex);
                    if (!record.Col_Ord_GuidID.UseNull)
                    {
                        record.Col_Ord_GuidID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_GuidID.ColumnIndex).Value;
                    }

                    record.Col_Ord_DatOrderedOn.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex);
                    if (!record.Col_Ord_DatOrderedOn.UseNull)
                    {
                        record.Col_Ord_DatOrderedOn.Value = sqlDataReader.GetSqlDateTime(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex).Value;
                    }

                    record.Col_Ord_LngCustomerID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex);
                    if (!record.Col_Ord_LngCustomerID.UseNull)
                    {
                        record.Col_Ord_LngCustomerID.Value = sqlDataReader.GetSqlInt32(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex).Value;
                    }

                    record.Col_Ord_CurTotal.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex);
                    if (!record.Col_Ord_CurTotal.UseNull)
                    {
                        record.Col_Ord_CurTotal.Value = sqlDataReader.GetSqlMoney(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex).Value;
                    }


                    sqlDataReader.Close();
                    sp.Connection.Close();

                    return(record);
                }
                else
                {
                    sqlDataReader.Close();
                    sp.Connection.Close();

                    return(null);
                }
            }
        }
        public void Edit_tblOrder_Record(Tables.tblOrder_Record record)
        {
            Params.spU_tblOrder param = new Params.spU_tblOrder(false);

            param.SetUpConnection(string.Empty);

            param.Param_Ord_GuidID = record.Col_Ord_GuidID.Value;

            if (record.Col_Ord_DatOrderedOn == null || record.Col_Ord_DatOrderedOn.UseNull)
            {
                param.Param_ConsiderNull_Ord_DatOrderedOn = true;
                param.Param_Ord_DatOrderedOn = SqlDateTime.Null;
            }
            else if (!record.Col_Ord_DatOrderedOn.UseDefault)
            {
                param.Param_Ord_DatOrderedOn = record.Col_Ord_DatOrderedOn.Value;
            }

            if (record.Col_Ord_LngCustomerID == null || record.Col_Ord_LngCustomerID.UseNull)
            {
                param.Param_ConsiderNull_Ord_LngCustomerID = true;
                param.Param_Ord_LngCustomerID = SqlInt32.Null;
            }
            else if (!record.Col_Ord_LngCustomerID.UseDefault)
            {
                param.Param_Ord_LngCustomerID = record.Col_Ord_LngCustomerID.Value;
            }

            if (record.Col_Ord_CurTotal == null || record.Col_Ord_CurTotal.UseNull)
            {
                param.Param_ConsiderNull_Ord_CurTotal = true;
                param.Param_Ord_CurTotal = SqlMoney.Null;
            }
            else if (!record.Col_Ord_CurTotal.UseDefault)
            {
                param.Param_Ord_CurTotal = record.Col_Ord_CurTotal.Value;
            }


            using (SPs.spU_tblOrder sp = new SPs.spU_tblOrder(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }