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); } } }
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); } } }
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 Tables.Supplier GetOne_Supplier(Guid id) { Params.spS_tblSupplier param = new Params.spS_tblSupplier(true); param.SetUpConnection(string.Empty); param.Param_Sup_GuidID = id; using (SPs.spS_tblSupplier sp = new SPs.spS_tblSupplier(true)) { System.Data.SqlClient.SqlDataReader sqlDataReader = null; sp.Execute(ref param, out sqlDataReader); param.Dispose(); if (sqlDataReader.Read()) { Tables.Supplier record = new Tables.Supplier(); record.Col_Sup_GuidID.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblSupplier.Resultset1.Fields.Column_Sup_GuidID.ColumnIndex); if (!record.Col_Sup_GuidID.UseNull) { record.Col_Sup_GuidID.Value = sqlDataReader.GetSqlGuid(SPs.spS_tblSupplier.Resultset1.Fields.Column_Sup_GuidID.ColumnIndex).Value; } record.Col_Sup_StrName.UseNull = sqlDataReader.IsDBNull(SPs.spS_tblSupplier.Resultset1.Fields.Column_Sup_StrName.ColumnIndex); if (!record.Col_Sup_StrName.UseNull) { record.Col_Sup_StrName.Value = sqlDataReader.GetSqlString(SPs.spS_tblSupplier.Resultset1.Fields.Column_Sup_StrName.ColumnIndex).Value; } sqlDataReader.Close(); sp.Connection.Close(); return(record); } else { sqlDataReader.Close(); sp.Connection.Close(); return(null); } } }