public static int GetProductID(string proName, double salePrice, string explanation) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Products.Where(x => x.proName == proName && x.salePrice == salePrice && x.Cate.explanation == explanation).FirstOrDefault().productID); } }
public static ResultSet CRUD(Cate cate, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(cate).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; if (state == EntityState.Added) { r.Message = "Kategori sisteme başarıyla eklendi!"; } else if (state == EntityState.Modified) { r.Message = null; } else if (state == EntityState.Deleted) { r.Message = "Kategori silindi!"; } r.Cate = cate; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Cate = cate; r.iconType = IconType.warning; } return(r); } }
public static int GetCustomerID(string name, string sname, string phone, string addressLine) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Customers.Where(x => x.cFirstName == name && x.cLastName == sname && x.phone == phone && x.addressLine == addressLine).FirstOrDefault().customerID); } }
public static OrderModel GetOrderModel(int orderID) { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbOrd = s.Orders.Where(x => x.orderID == orderID).FirstOrDefault(); return(ConvertToModel(dbOrd)); } }
public static string GetCustomerFullName(int customerID) { using (AccDeficitEntities s = new AccDeficitEntities()) { var cus = s.Customers.Where(x => x.customerID == customerID).FirstOrDefault(); return(cus.cFirstName + " " + cus.cLastName); } }
public static List <ProductModel> GetProductModelList() { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbList = s.Products.ToList(); return(ConvertToModelList(dbList)); } }
public static List <OrderModel> GetOrderModelList(int cusID) { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbList = s.Orders.Where(x => x.Customers.customerID == cusID).ToList(); return(ConvertToModelList(dbList)); } }
public static List <OrderModel> GetOrderModelProList(string query) { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbList = s.Orders.Where(x => x.Products.proName.Contains(query)).ToList(); return(ConvertToModelList(dbList)); } }
public static List <OrderModel> GetOrderModelCusList(string query) { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbList = s.Orders.Where(x => (x.Customers.cFirstName + " " + x.Customers.cLastName).Contains(query)).ToList(); return(ConvertToModelList(dbList)); } }
public static List <OrderModel> GetOrderModelList() { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbList = s.Orders.ToList(); return(ConvertToModelList(dbList)); } }
public static ProductModel GetProductModel(int productID) { using (AccDeficitEntities s = new AccDeficitEntities()) { var dbPro = s.Products.Where(x => x.productID == productID).FirstOrDefault(); return(ConvertToModel(dbPro)); } }
public static List <string> GetPhoneNumbers() { List <string> numbers = new List <string>(); using (AccDeficitEntities s = new AccDeficitEntities()) { foreach (var item in GetCustomerList()) { numbers.Add(item.phone); } return(numbers); } }
public static List <OrderModel> GetOrderModelCateList(string query) { using (AccDeficitEntities s = new AccDeficitEntities()) { var cateList = s.Cate.Where(x => x.cateName.Contains(query)).ToList(); List <Orders> dbOrdList = new List <Orders>(); foreach (var item in cateList) { var ordList = s.Orders.Where(x => x.Products.cateID == item.cateID).ToList(); dbOrdList.AddRange(ordList); } return(ConvertToModelList(dbOrdList)); } }
public static ResultSet CRUD(Orders ord, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(ord).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; r.Message = "Satış kaydı eklendi!"; r.Order = ord; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Order = ord; r.iconType = IconType.warning; } return(r); } }
public static ResultSet CRUD(Signin sign, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(sign).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; r.Message = "Şifre başarıyla değiştirildi!"; r.Signin = sign; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Signin = sign; r.iconType = IconType.warning; } return(r); } }
public static List <Customers> GetCustomerList() { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Customers.ToList()); } }
public static List <Cate> GetCateList() { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Cate.ToList()); } }
public static int GetCateID(string cName, string exp) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Cate.Where(x => x.cateName == cName && x.explanation == exp).FirstOrDefault().cateID); } }
public static int GetCateIDbyName(string cName) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Cate.Where(x => x.cateName == cName).FirstOrDefault().cateID); } }
public static Cate GetCate(int cateID) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Cate.Where(x => x.cateID == cateID).FirstOrDefault()); } }
public static Customers GetCustomer(int customerID) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Customers.Where(x => x.customerID == customerID).FirstOrDefault()); } }
public static int GetCustomerID(string fullName) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Customers.Where(x => x.cFirstName + " " + x.cLastName == fullName).FirstOrDefault().customerID); } }
public static Signin GetUser(int signinID) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Signin.Where(x => x.signinID == signinID).FirstOrDefault()); } }
public static Products GetProduct(int productID) { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Products.Where(x => x.productID == productID).FirstOrDefault()); } }
public static List <Signin> GetUserList() { using (AccDeficitEntities s = new AccDeficitEntities()) { return(s.Signin.ToList()); } }