Ejemplo n.º 1
0
        public Tables.tblOrderItem_Record GetOne_tblOrderItem_Record(Guid id)
        {
            Params.spS_tblOrderItem param = new Params.spS_tblOrderItem(true);

            param.SetUpConnection(string.Empty);

            param.Param_Oit_GuidID = id;

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

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

                    record.Col_Oit_GuidID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidID.ColumnIndex);
                    if (!record.Col_Oit_GuidID.UseNull)
                    {
                        record.Col_Oit_GuidID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidID.ColumnIndex).Value;
                    }

                    record.Col_Oit_GuidOrderID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidOrderID.ColumnIndex);
                    if (!record.Col_Oit_GuidOrderID.UseNull)
                    {
                        record.Col_Oit_GuidOrderID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidOrderID.ColumnIndex).Value;
                    }

                    record.Col_Oit_GuidProductID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidProductID.ColumnIndex);
                    if (!record.Col_Oit_GuidProductID.UseNull)
                    {
                        record.Col_Oit_GuidProductID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_GuidProductID.ColumnIndex).Value;
                    }

                    record.Col_Oit_LngAmount.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_LngAmount.ColumnIndex);
                    if (!record.Col_Oit_LngAmount.UseNull)
                    {
                        record.Col_Oit_LngAmount.Value = sqlDataReader.GetSqlInt32(SPs.spS_tblOrderItem.Resultset1.Fields.Column_Oit_LngAmount.ColumnIndex).Value;
                    }


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

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

                    return(null);
                }
            }
        }
Ejemplo n.º 2
0
        public Tables.Product GetOne_Product(Guid id)
        {
            Params.spS_tblProduct param = new Params.spS_tblProduct(true);

            param.SetUpConnection(string.Empty);

            param.Param_Pro_GuidID = id;

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

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

                    record.Col_Pro_GuidID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_GuidID.ColumnIndex);
                    if (!record.Col_Pro_GuidID.UseNull)
                    {
                        record.Col_Pro_GuidID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_GuidID.ColumnIndex).Value;
                    }

                    record.Name.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_StrName.ColumnIndex);
                    if (!record.Name.UseNull)
                    {
                        record.Name.Value = sqlDataReader.GetSqlString(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_StrName.ColumnIndex).Value;
                    }

                    record.Col_Pro_CurPrice.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_CurPrice.ColumnIndex);
                    if (!record.Col_Pro_CurPrice.UseNull)
                    {
                        record.Col_Pro_CurPrice.Value = sqlDataReader.GetSqlMoney(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_CurPrice.ColumnIndex).Value;
                    }

                    record.CategoryID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_LngCategoryID.ColumnIndex);
                    if (!record.CategoryID.UseNull)
                    {
                        record.CategoryID.Value = sqlDataReader.GetSqlInt32(SPs.spS_tblProduct.Resultset1.Fields.Column_Pro_LngCategoryID.ColumnIndex).Value;
                    }


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

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

                    return(null);
                }
            }
        }
Ejemplo n.º 3
0
        public Tables.tblCustomer_Record GetOne_tblCustomer_Record(Int32 id)
        {
            Params.spS_tblCustomer param = new Params.spS_tblCustomer(true);

            param.SetUpConnection(string.Empty);

            param.Param_Cus_LngID = id;

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

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

                    record.Col_Cus_LngID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_LngID.ColumnIndex);
                    if (!record.Col_Cus_LngID.UseNull)
                    {
                        record.Col_Cus_LngID.Value = sqlDataReader.GetSqlInt32(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_LngID.ColumnIndex).Value;
                    }

                    record.Customer_Surname.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrLastName.ColumnIndex);
                    if (!record.Customer_Surname.UseNull)
                    {
                        record.Customer_Surname.Value = sqlDataReader.GetSqlString(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrLastName.ColumnIndex).Value;
                    }

                    record.Col_Cus_StrFirstName.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrFirstName.ColumnIndex);
                    if (!record.Col_Cus_StrFirstName.UseNull)
                    {
                        record.Col_Cus_StrFirstName.Value = sqlDataReader.GetSqlString(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrFirstName.ColumnIndex).Value;
                    }

                    record.Col_Cus_StrEmail.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrEmail.ColumnIndex);
                    if (!record.Col_Cus_StrEmail.UseNull)
                    {
                        record.Col_Cus_StrEmail.Value = sqlDataReader.GetSqlString(SPs.spS_tblCustomer.Resultset1.Fields.Column_Cus_StrEmail.ColumnIndex).Value;
                    }


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

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

                    return(null);
                }
            }
        }
        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);
                }
            }
        }
Ejemplo n.º 5
0
        public Tables.Category GetOne_Category(Int32 id)
        {
            Params.spS_tblCategory param = new Params.spS_tblCategory(true);

            param.SetUpConnection(string.Empty);

            param.Param_Cat_LngID = id;

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

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

                    record.Col_Cat_LngID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCategory.Resultset1.Fields.Column_Cat_LngID.ColumnIndex);
                    if (!record.Col_Cat_LngID.UseNull)
                    {
                        record.Col_Cat_LngID.Value = sqlDataReader.GetSqlInt32(SPs.spS_tblCategory.Resultset1.Fields.Column_Cat_LngID.ColumnIndex).Value;
                    }

                    record.Col_Cat_StrName.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblCategory.Resultset1.Fields.Column_Cat_StrName.ColumnIndex);
                    if (!record.Col_Cat_StrName.UseNull)
                    {
                        record.Col_Cat_StrName.Value = sqlDataReader.GetSqlString(SPs.spS_tblCategory.Resultset1.Fields.Column_Cat_StrName.ColumnIndex).Value;
                    }


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

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

                    return(null);
                }
            }
        }