Csla.Data.ConnectionManager.GetManager(string, bool, string)

Here are the examples of the csharp api Csla.Data.ConnectionManager.GetManager(string, bool, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2391 Examples 7

19 View Source File : ProductTypeItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeItemDto Update(ProductTypeItemDto productTypeItem)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateProductTypeItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeItem.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", productTypeItem.Name).DbType = DbType.String;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductTypeItem");
                }
            }
            return productTypeItem;
        }

19 View Source File : ProductTypeListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetProductTypeList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductTypeNVLDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeNVLItemDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetProductTypeNVL", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductTypeRODal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeRODto Fetch(int productTypeId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetProductTypeRO", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : ProductTypeUpdatedByRootListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeUpdatedByRootInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetProductTypeUpdatedByRootList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierEditDto Fetch(int supplierId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetSupplierEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : SupplierEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierEditDto Insert(SupplierEditDto supplierEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddSupplierEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierEdit.SupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", supplierEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine1", supplierEdit.AddressLine1 == null ? (object)DBNull.Value : supplierEdit.AddressLine1).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine2", supplierEdit.AddressLine2 == null ? (object)DBNull.Value : supplierEdit.AddressLine2).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ZipCode", supplierEdit.ZipCode == null ? (object)DBNull.Value : supplierEdit.ZipCode).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@State", supplierEdit.State == null ? (object)DBNull.Value : supplierEdit.State).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Country", supplierEdit.Country == null ? (object)DBNull.Value : supplierEdit.Country.Value).DbType = DbType.Byte;
                    cmd.ExecuteNonQuery();
                }
            }
            return supplierEdit;
        }

19 View Source File : SupplierEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierEditDto Update(SupplierEditDto supplierEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateSupplierEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierEdit.SupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", supplierEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine1", supplierEdit.AddressLine1 == null ? (object)DBNull.Value : supplierEdit.AddressLine1).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine2", supplierEdit.AddressLine2 == null ? (object)DBNull.Value : supplierEdit.AddressLine2).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ZipCode", supplierEdit.ZipCode == null ? (object)DBNull.Value : supplierEdit.ZipCode).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@State", supplierEdit.State == null ? (object)DBNull.Value : supplierEdit.State).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Country", supplierEdit.Country == null ? (object)DBNull.Value : supplierEdit.Country.Value).DbType = DbType.Byte;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("SupplierEdit");
                }
            }
            return supplierEdit;
        }

19 View Source File : SupplierInfoDetailDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierInfoDetailDto Fetch(int supplierId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetSupplierInfoDetal", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : SupplierListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<SupplierInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetSupplierList();
                using (var cmd = new SqlCommand(getSupplierListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierProductItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierProducreplacedemDto Update(SupplierProducreplacedemDto supplierProducreplacedem)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateSupplierProducreplacedem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", supplierProducreplacedem.ProductSupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ProductId", supplierProducreplacedem.ProductId).DbType = DbType.Guid;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("SupplierProducreplacedem");
                }
            }
            return supplierProducreplacedem;
        }

19 View Source File : CustomerEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public CustomerEditDto Insert(CustomerEditDto customerEdit)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                GetQueryAddCustomerEdit(customerEdit);
                using (var cmd = new FbCommand(addCustomerEditInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@CustomerId", customerEdit.CustomerId).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@Name", customerEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@FiscalNumber", customerEdit.FiscalNumber == null ? (object)DBNull.Value : customerEdit.FiscalNumber).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine1", customerEdit.AddressLine1 == null ? (object)DBNull.Value : customerEdit.AddressLine1).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@AddressLine2", customerEdit.AddressLine2 == null ? (object)DBNull.Value : customerEdit.AddressLine2).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ZipCode", customerEdit.ZipCode == null ? (object)DBNull.Value : customerEdit.ZipCode).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@State", customerEdit.State == null ? (object)DBNull.Value : customerEdit.State).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Country", customerEdit.Country == null ? (object)DBNull.Value : customerEdit.Country.Value).DbType = DbType.Byte;
                    cmd.ExecuteNonQuery();
                }
            }
            return customerEdit;
        }

19 View Source File : InvoiceEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceEditDto Fetch(Guid invoiceId)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.GetInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceId).DbType = DbType.Guid;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : InvoiceLineItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceLineItemDto Insert(InvoiceLineItemDto invoiceLineItem)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.AddInvoiceLineItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceLineItem.Parent_InvoiceId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceLineId", invoiceLineItem.InvoiceLineId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductId", invoiceLineItem.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@Cost", invoiceLineItem.Cost).DbType = DbType.Decimal;
                    cmd.Parameters.AddWithValue("@PercentDiscount", invoiceLineItem.PercentDiscount).DbType = DbType.Byte;
                    cmd.ExecuteNonQuery();
                }
            }
            return invoiceLineItem;
        }

19 View Source File : InvoiceLineItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceLineItemDto Update(InvoiceLineItemDto invoiceLineItem)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.UpdateInvoiceLineItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceLineId", invoiceLineItem.InvoiceLineId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductId", invoiceLineItem.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@Cost", invoiceLineItem.Cost).DbType = DbType.Decimal;
                    cmd.Parameters.AddWithValue("@PercentDiscount", invoiceLineItem.PercentDiscount).DbType = DbType.Byte;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("InvoiceLineItem");
                }
            }
            return invoiceLineItem;
        }

19 View Source File : ProductTypeCachedNVLDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeCachedNVLItemDto> Fetch()
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.GetProductTypeCachedNVL", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductTypeCollDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeItemDto> Fetch()
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.GetProductTypeColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductTypeDynaItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeDynaItemDto Insert(ProductTypeDynaItemDto productTypeDynaItem)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.AddProductTypeDynaItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeDynaItem.ProductTypeId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@Name", productTypeDynaItem.Name).DbType = DbType.String;
                    cmd.ExecuteNonQuery();
                    productTypeDynaItem.ProductTypeId = (int)cmd.Parameters["@ProductTypeId"].Value;
                }
            }
            return productTypeDynaItem;
        }

19 View Source File : ProductTypeDynaItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeDynaItemDto Update(ProductTypeDynaItemDto productTypeDynaItem)
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.UpdateProductTypeDynaItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeDynaItem.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", productTypeDynaItem.Name).DbType = DbType.String;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductTypeDynaItem");
                }
            }
            return productTypeDynaItem;
        }

19 View Source File : ProductTypeNVLDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeNVLItemDto> Fetch()
        {
            using (var ctx = ConnectionManager<FbConnection>.GetManager("Invoices"))
            {
                using (var cmd = new FbCommand("dbo.GetProductTypeNVL", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : CustomerListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<CustomerInfoDto> Fetch(string name)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetCustomerList(name);
                using (var cmd = new MySqlCommand(getCustomerListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@Name", name).DbType = DbType.String;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : InvoiceListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<InvoiceInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetInvoiceList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductEditDto Fetch(Guid productId)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetProductEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductId", productId).DbType = DbType.Guid;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : ProductEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductEditDto Update(ProductEditDto productEdit)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.UpdateProductEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductId", productEdit.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductCode", productEdit.ProductCode == null ? (object)DBNull.Value : productEdit.ProductCode).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@Name", productEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productEdit.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@UnitCost", productEdit.UnitCost).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@StockByteNull", productEdit.StockByteNull == null ? (object)DBNull.Value : productEdit.StockByteNull.Value).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockByte", productEdit.StockByte).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockShortNull", productEdit.StockShortNull == null ? (object)DBNull.Value : productEdit.StockShortNull.Value).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockShort", productEdit.StockShort).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockIntNull", productEdit.StockIntNull == null ? (object)DBNull.Value : productEdit.StockIntNull.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockInt", productEdit.StockInt).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockLongNull", productEdit.StockLongNull == null ? (object)DBNull.Value : productEdit.StockLongNull.Value).DbType = DbType.Int64;
                    cmd.Parameters.AddWithValue("@StockLong", productEdit.StockLong).DbType = DbType.Int64;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductEdit");
                }
            }
            return productEdit;
        }

19 View Source File : ProductSupplierItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductSupplierItemDto Update(ProductSupplierItemDto productSupplierItem)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.UpdateProductSupplierItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", productSupplierItem.ProductSupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@SupplierId", productSupplierItem.SupplierId).DbType = DbType.Int32;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductSupplierItem");
                }
            }
            return productSupplierItem;
        }

19 View Source File : ProductTypeCachedNVLDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeCachedNVLItemDto> Fetch()
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetProductTypeCachedNVL", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : ProductTypeDynaItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeDynaItemDto Insert(ProductTypeDynaItemDto productTypeDynaItem)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.AddProductTypeDynaItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeDynaItem.ProductTypeId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@Name", productTypeDynaItem.Name).DbType = DbType.String;
                    cmd.ExecuteNonQuery();
                    productTypeDynaItem.ProductTypeId = (int)cmd.Parameters["@ProductTypeId"].Value;
                }
            }
            return productTypeDynaItem;
        }

19 View Source File : ProductTypeEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeEditDto Fetch(int productTypeId)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetProductTypeEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : ProductTypeEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeEditDto Insert(ProductTypeEditDto productTypeEdit)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.AddProductTypeEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeEdit.ProductTypeId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@Name", productTypeEdit.Name).DbType = DbType.String;
                    cmd.ExecuteNonQuery();
                    productTypeEdit.ProductTypeId = (int)cmd.Parameters["@ProductTypeId"].Value;
                }
            }
            return productTypeEdit;
        }

19 View Source File : ProductTypeEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductTypeEditDto Update(ProductTypeEditDto productTypeEdit)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.UpdateProductTypeEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeEdit.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", productTypeEdit.Name).DbType = DbType.String;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductTypeEdit");
                }
            }
            return productTypeEdit;
        }

19 View Source File : ProductTypeUpdatedByRootListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeUpdatedByRootInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetProductTypeUpdatedByRootList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<SupplierInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetSupplierList();
                using (var cmd = new MySqlCommand(getSupplierListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<SupplierInfoDto> Fetch(string name)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetSupplierListByName(name);
                using (var cmd = new MySqlCommand(getSupplierListByNameInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@Name", name).DbType = DbType.String;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierProductCollDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<SupplierProducreplacedemDto> Fetch(int supplierId)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.GetSupplierProductColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : SupplierProductItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public SupplierProducreplacedemDto Insert(SupplierProducreplacedemDto supplierProducreplacedem)
        {
            using (var ctx = ConnectionManager<MySqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new MySqlCommand("dbo.AddSupplierProducreplacedem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SupplierId", supplierProducreplacedem.Parent_SupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", supplierProducreplacedem.ProductSupplierId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@ProductId", supplierProducreplacedem.ProductId).DbType = DbType.Guid;
                    cmd.ExecuteNonQuery();
                    supplierProducreplacedem.ProductSupplierId = (int)cmd.Parameters["@ProductSupplierId"].Value;
                }
            }
            return supplierProducreplacedem;
        }

19 View Source File : ProductTypeDynaItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Update(int productTypeId, string name)
        {
            using (var ctx = ConnectionManager<SQLiteConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SQLiteCommand("dbo.UpdateProductTypeDynaItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Name", name).DbType = DbType.String;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductTypeDynaItem");
                }
            }
        }

19 View Source File : ProductTypeItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Delete(int productTypeId)
        {
            using (var ctx = ConnectionManager<SQLiteConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SQLiteCommand("dbo.DeleteProductTypeItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productTypeId).DbType = DbType.Int32;
                    cmd.ExecuteNonQuery();
                }
            }
        }

19 View Source File : SupplierProductItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Update(int productSupplierId, Guid productId)
        {
            using (var ctx = ConnectionManager<SQLiteConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SQLiteCommand("dbo.UpdateSupplierProducreplacedem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", productSupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ProductId", productId).DbType = DbType.Guid;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("SupplierProducreplacedem");
                }
            }
        }

19 View Source File : SupplierProductItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Delete(int productSupplierId)
        {
            using (var ctx = ConnectionManager<SQLiteConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SQLiteCommand("dbo.DeleteSupplierProducreplacedem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", productSupplierId).DbType = DbType.Int32;
                    cmd.ExecuteNonQuery();
                }
            }
        }

19 View Source File : CustomerListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<CustomerInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetCustomerList();
                using (var cmd = new SqlCommand(getCustomerListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

19 View Source File : InvoiceEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceEditDto Fetch(Guid invoiceId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceId).DbType = DbType.Guid;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : InvoiceEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceEditDto Insert(InvoiceEditDto invoiceEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceEdit.InvoiceId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceNumber", invoiceEdit.InvoiceNumber).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@CustomerId", invoiceEdit.CustomerId).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@InvoiceDate", invoiceEdit.InvoiceDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@CreateDate", invoiceEdit.CreateDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@CreateUser", invoiceEdit.CreateUser).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ChangeDate", invoiceEdit.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUser", invoiceEdit.ChangeUser).DbType = DbType.Int32;
                    cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output;
                    cmd.ExecuteNonQuery();
                    invoiceEdit.RowVersion = (byte[])cmd.Parameters["@NewRowVersion"].Value;
                }
            }
            return invoiceEdit;
        }

19 View Source File : InvoiceEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceEditDto Update(InvoiceEditDto invoiceEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceEdit.InvoiceId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceNumber", invoiceEdit.InvoiceNumber).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@CustomerId", invoiceEdit.CustomerId).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@InvoiceDate", invoiceEdit.InvoiceDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@ChangeDate", invoiceEdit.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUser", invoiceEdit.ChangeUser).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RowVersion", invoiceEdit.RowVersion).DbType = DbType.Binary;
                    cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("InvoiceEdit");

                    invoiceEdit.RowVersion = (byte[])cmd.Parameters["@NewRowVersion"].Value;
                }
            }
            return invoiceEdit;
        }

19 View Source File : InvoiceLineItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceLineItemDto Insert(InvoiceLineItemDto invoiceLineItem)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddInvoiceLineItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceLineItem.Parent_InvoiceId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceLineId", invoiceLineItem.InvoiceLineId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductId", invoiceLineItem.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@Cost", invoiceLineItem.Cost).DbType = DbType.Decimal;
                    cmd.Parameters.AddWithValue("@PercentDiscount", invoiceLineItem.PercentDiscount).DbType = DbType.Byte;
                    cmd.ExecuteNonQuery();
                }
            }
            return invoiceLineItem;
        }

19 View Source File : InvoiceLineItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceLineItemDto Update(InvoiceLineItemDto invoiceLineItem)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateInvoiceLineItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceLineId", invoiceLineItem.InvoiceLineId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductId", invoiceLineItem.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@Cost", invoiceLineItem.Cost).DbType = DbType.Decimal;
                    cmd.Parameters.AddWithValue("@PercentDiscount", invoiceLineItem.PercentDiscount).DbType = DbType.Byte;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("InvoiceLineItem");
                }
            }
            return invoiceLineItem;
        }

19 View Source File : InvoiceViewDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public InvoiceViewDto Fetch(Guid invoiceId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetInvoiceView", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceId).DbType = DbType.Guid;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : ProductEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductEditDto Insert(ProductEditDto productEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddProductEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductId", productEdit.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductCode", productEdit.ProductCode == null ? (object)DBNull.Value : productEdit.ProductCode).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@Name", productEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productEdit.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@UnitCost", productEdit.UnitCost).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@StockByteNull", productEdit.StockByteNull == null ? (object)DBNull.Value : productEdit.StockByteNull.Value).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockByte", productEdit.StockByte).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockShortNull", productEdit.StockShortNull == null ? (object)DBNull.Value : productEdit.StockShortNull.Value).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockShort", productEdit.StockShort).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockIntNull", productEdit.StockIntNull == null ? (object)DBNull.Value : productEdit.StockIntNull.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockInt", productEdit.StockInt).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockLongNull", productEdit.StockLongNull == null ? (object)DBNull.Value : productEdit.StockLongNull.Value).DbType = DbType.Int64;
                    cmd.Parameters.AddWithValue("@StockLong", productEdit.StockLong).DbType = DbType.Int64;
                    cmd.ExecuteNonQuery();
                }
            }
            return productEdit;
        }

19 View Source File : ProductEditDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductEditDto Update(ProductEditDto productEdit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateProductEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductId", productEdit.ProductId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductCode", productEdit.ProductCode == null ? (object)DBNull.Value : productEdit.ProductCode).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@Name", productEdit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ProductTypeId", productEdit.ProductTypeId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@UnitCost", productEdit.UnitCost).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@StockByteNull", productEdit.StockByteNull == null ? (object)DBNull.Value : productEdit.StockByteNull.Value).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockByte", productEdit.StockByte).DbType = DbType.Byte;
                    cmd.Parameters.AddWithValue("@StockShortNull", productEdit.StockShortNull == null ? (object)DBNull.Value : productEdit.StockShortNull.Value).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockShort", productEdit.StockShort).DbType = DbType.Int16;
                    cmd.Parameters.AddWithValue("@StockIntNull", productEdit.StockIntNull == null ? (object)DBNull.Value : productEdit.StockIntNull.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockInt", productEdit.StockInt).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@StockLongNull", productEdit.StockLongNull == null ? (object)DBNull.Value : productEdit.StockLongNull.Value).DbType = DbType.Int64;
                    cmd.Parameters.AddWithValue("@StockLong", productEdit.StockLong).DbType = DbType.Int64;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductEdit");
                }
            }
            return productEdit;
        }

19 View Source File : ProductSupplierItemDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public ProductSupplierItemDto Update(ProductSupplierItemDto productSupplierItem)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateProductSupplierItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ProductSupplierId", productSupplierItem.ProductSupplierId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@SupplierId", productSupplierItem.SupplierId).DbType = DbType.Int32;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("ProductSupplierItem");
                }
            }
            return productSupplierItem;
        }

19 View Source File : ProductTypeCachedListDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public List<ProductTypeCachedInfoDto> Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetProductTypeCachedList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var dr = cmd.ExecuteReader();
                    return LoadCollection(dr);
                }
            }
        }

See More Examples