public BL.Store GetStoreById(int id)
        {
            var store = _context.Stores.Where(s => s.StoreId == id).First();

            BL.Store searched = new BL.Store(store.StoreId, store.StoreName);
            return(searched);
        }
Ejemplo n.º 2
0
        public Store ImportStoreDataById(BL.Store store)
        {
            try
            {
                dal.sc.Open();

                dal.cmd = new SqlCommand("dbo.StoreDataById " + store.bid, dal.sc);


                while (dal.reader.Read())
                {
                    store.name = Convert.ToString(dal.reader["StoreName"]);
                    store.bid  = Convert.ToUInt32(dal.reader["StoreId"]);
                    store      = Convert.ToString(dal.reader["ManegerName"]);

                    store.Getmarketname = Convert.ToString(dal.reader["Market"]);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            finally
            {
                sc.Close();
            }

            return(stor);
        }
        public BL.Store GetStoreById(int id)
        {
            var result = _context.Stores.Where(c => c.StoreId == id).First();

            BL.Store store =
                new BL.Store(result.StoreId, result.StoreName);
            Console.WriteLine($"\n\nStore ID: {store.StoreId}\nName: {store.StoreName}");
            return(store);
        }