public int GetMostSellingName() { List <int> high = new List <int>(); int maxvalue = int.MinValue; // int indes using (var context = new ApplesoftEntities()) { for (int x = 1; x <= context.Stores.Count(); x++) { count = context.cutomers.Where(o => o.storeID == x).Count(); high.Add(count); } foreach (var hi in high) { if (hi > maxvalue) { maxvalue = hi; } } if (high.IndexOf(maxvalue) == 0) { return(high.IndexOf(maxvalue) + 1); } else { return(high.IndexOf(maxvalue)); } } }
public List <int> GetMostSelling() { List <int> tem = new List <int>(); using (var context = new ApplesoftEntities()) { for (int x = 1; x <= context.Stores.Count(); x++) { count = context.cutomers.Where(o => o.storeID == x).Count(); tem.Add(count); } } return(tem); }
public IEnumerable <Store> GetStoreCustomer() { List <Store> tempss = new List <Store>(); using (var context = new ApplesoftEntities()) { for (int x = 1; x <= context.Stores.Count(); x++) { context.cutomers.Where(o => o.storeID == x).Count(); var blog = context.Stores .Where(b => b.storeID == x) .FirstOrDefault(); tempss.Add(blog); // tem.Add(count); } } return(tempss); }
private void button1_Click(object sender, EventArgs e) { //myspeechReader = new SpeechSynthesizer(); myspeechReader.SpeakAsync("Woohoo!!!!!!!!!"); LogFile(comboBox1.Text, DateTime.Now); // calling my logfile function // MessageBox.Show(comboBox1.SelectedIndex.ToString()); var customers = new cutomer { storeID = comboBox1.SelectedIndex + 1, Dates = DateTime.Now }; if (comboBox1.SelectedIndex >= 0) { //apllesEntity.GetAll(); var context = new ApplesoftEntities(); if (comboBox1.SelectedIndex == 0) { using (var unitofwork = new UnitOfWork(new ApplesoftEntities())) { unitofwork.customer.Add(customers); unitofwork.Complete(); } } else { using (var unitofwork = new UnitOfWork(new ApplesoftEntities())) { unitofwork.customer.Add(customers); unitofwork.Complete(); } } } }
public Customers(ApplesoftEntities context) : base(context) { }
public UnitOfWork(ApplesoftEntities contxt) { context = contxt; Store = new ShopsRepository(context); customer = new Customers(context); }
public ShopsRepository(ApplesoftEntities context) : base(context) { }