public static Order GetByCashierID(int cashierID) { using (SatisEntities se = new SatisEntities()) { return(se.Order.Find(cashierID)); } }
public static OrderDetail GetByID(int orderID) { using (SatisEntities se = new SatisEntities()) { return(se.OrderDetail.Find(orderID)); } }
public static List <Category> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.Category.ToList()); } }
public static Customer GetByID(int customerId) { using (SatisEntities se = new SatisEntities()) { return(se.Customer.Find(customerId)); } }
public static Cashier GetByName(string _userName) { using (SatisEntities se = new SatisEntities()) { return(se.Cashier.Where(x => x.userName == _userName).FirstOrDefault()); } }
public static Cashier GetByID(int cashierId) { using (SatisEntities se = new SatisEntities()) { return(se.Cashier.Find(cashierId)); } }
public static List <Supplier> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.Supplier.ToList()); } }
public static Product GetByID(int productId) { using (SatisEntities se = new SatisEntities()) { return(se.Product.Find(productId)); } }
public static Supplier GetByID(int supplierId) { using (SatisEntities se = new SatisEntities()) { return(se.Supplier.Find(supplierId)); } }
public static List <Customer> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.Customer.ToList()); } }
public static List <Product> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.Product.ToList()); } }
public static List <OrderDetail> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.OrderDetail.ToList()); } }
public static Category GetByID(int categoryId) { using (SatisEntities se = new SatisEntities()) { return(se.Category.Find(categoryId)); } }
public static Stock GetByID(int stockId) { using (SatisEntities se = new SatisEntities()) { return(se.Stock.Find(stockId)); } }
public static List <Stock> GetList() { using (SatisEntities se = new SatisEntities()) { return(se.Stock.ToList()); } }
public static List <ProductModel> GetProductModelList() { List <ProductModel> pml = new List <ProductModel>(); using (SatisEntities se = new SatisEntities()) { var ff = se.Product.ToList(); foreach (var item in ff) { ProductModel pm = new ProductModel(); pm.productID = item.productID; pm.productName = item.productName; pm.unitPrice = item.unitPrice; pm.IsActive = item.IsActive; pm.discount = item.discount; pm.dateOfAdded = item.dateOfAdded; pm.stock = item.stock; if (item.discontinued == false) { pm.stringDiscounted = "hayır"; } else { pm.stringDiscounted = "evet"; } pm.category.categoryID = item.Category.categoryID; pm.category.categoryName = item.Category.categoryName; pm.Supplier.supplierID = item.Supplier.supplierID; pm.Supplier.companyName = item.Supplier.companyName; pml.Add(pm); } return(pml); } }
public static List <Stock> GetUniqStock() { using (SatisEntities se = new SatisEntities()) { var a = se.Stock.GroupBy(x => x.productID).Select(x => x.FirstOrDefault()).ToList(); return(a); } }
public static int GetTotalStockByProductID(int _productID) { int stock = 0; using (SatisEntities se = new SatisEntities()) { var a = se.Stock.Where(x => x.productID == _productID); foreach (var item in a) { stock += item.count; } return(stock); } }
public static (Stock, bool) CUD(Stock s, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(s).State = state; if (se.SaveChanges() > 0) { return(s, true); } else { return(s, false); } } }
public static (Product, bool) CUD(Product p, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(p).State = state; if (se.SaveChanges() > 0) { return(p, true); } else { return(p, false); } } }
public static (OrderDetail, bool) CUD(OrderDetail ord, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(ord).State = state; if (se.SaveChanges() > 0) { return(ord, true); } else { return(ord, false); } } }
public static (Supplier, bool) CUD(Supplier sp, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(sp).State = state; if (se.SaveChanges() > 0) { return(sp, true); } else { return(sp, false); } } }
public static (Customer, bool) CUD(Customer cm, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(cm).State = state; if (se.SaveChanges() > 0) { return(cm, true); } else { return(cm, false); } } }
public static int GetStockByProductID(int productID) { //kasiyer ekranında stoğu olmayan ürünleri getirmemek için int stock = 0; using (SatisEntities se = new SatisEntities()) { var a = se.Stock.Where(x => x.productID == productID); foreach (var item in a) { stock += item.count; } return(stock); } }
public static (Category, bool) CUD(Category cg, EntityState state) { using (SatisEntities se = new SatisEntities()) { se.Entry(cg).State = state; if (se.SaveChanges() > 0) { return(cg, true); } else { return(cg, false); } } }
public static List <Product> GetListByProductName(string productName) { using (SatisEntities se = new SatisEntities()) { List <Product> products = new List <Product>(); List <Product> products2 = GetList(); foreach (var item in products2) { if (item.productName.ToLower().Contains(productName.ToLower())) { products.Add(item); } } return(products); } }
public static List <Supplier> GetListByCompanyName(string _companyName) { using (SatisEntities se = new SatisEntities()) { List <Supplier> supplier = new List <Supplier>(); List <Supplier> supplier2 = GetList(); foreach (var item in supplier2) { if (item.companyName.ToLower().Contains(_companyName.ToLower())) { supplier.Add(item); } } return(supplier); } }
public static List <Product> GetListByProdutID(int productID) { using (SatisEntities se = new SatisEntities()) { List <Product> products = new List <Product>(); List <Product> products2 = GetList(); foreach (var item in products2) { if (item.IsActive == true && item.productID == productID) { products.Add(item); } } return(products); } }
public static List <Category> GetListByCategoryName(string _categoryName) { using (SatisEntities se = new SatisEntities()) { List <Category> categories = new List <Category>(); List <Category> categories2 = GetList(); foreach (var item in categories2) { if (item.categoryName.ToLower().Contains(_categoryName.ToLower())) { categories.Add(item); } } return(categories); } }
public static List <OrderDetail> GetListByOrderID(int orderID) { using (SatisEntities se = new SatisEntities()) { List <OrderDetail> orderDetails = new List <OrderDetail>(); List <OrderDetail> orderDetails2 = GetList(); foreach (var item in orderDetails2) { if (item.orderID == orderID) { orderDetails.Add(item); } } return(orderDetails); } }