public List <StoreController> listOwnerStores(string email) { bool wasOpen = true; if (conn != null && conn.State == ConnectionState.Closed) { conn.Open(); wasOpen = false; } string strSelect = "Select * From OnlineStore where storeOwner=@email"; SqlCommand cmd = new SqlCommand(strSelect, conn); cmd.Parameters.Add("@email", email); SqlDataReader myReader = cmd.ExecuteReader(); List <StoreController> stores = new List <StoreController>(); while (myReader.Read()) { string storename = myReader["storeName"].ToString(); string storeaddress = myReader["storeAddress"].ToString(); string storeowner = myReader["storeOwner"].ToString(); StoreOwnerDataBase sodb = new StoreOwnerDataBase(); StoreOwnerController storeOwner = (StoreOwnerController)sodb.searchByEmail(storeowner); StoreController store = new OnlineStoreController(storename, storeaddress, storeOwner); stores.Add(store); } if (!wasOpen) { conn.Close(); } return(stores); }
public StoreOwnerPage(StoreOwnerController controllerSO) { this.controllerSO = controllerSO; InitializeComponent(); TuserName.Text = controllerSO.storeOwner.Data.userName; Tname.Text = controllerSO.storeOwner.Data.name; Temail.Text = controllerSO.storeOwner.Data.email; Trole.Text = controllerSO.storeOwner.Data.role; }
public StoreLayoutPage(StoreOwnerController controllerSO, StoreController controllerStore, StoreProductController controllerStoreProduct, bool b) { InitializeComponent(); this.collMode = b; this.TuserName.Text = controllerSO.storeOwner.Data.ID; this.Temail.Text = controllerSO.storeOwner.Data.email; this.Tname.Text = controllerSO.storeOwner.Data.name; this.Trole.Text = controllerSO.storeOwner.Data.role; this.controllerSO = controllerSO; this.controllerStore = controllerStore; this.controllerStoreProduct = controllerStoreProduct; this.TStoreName.Text = controllerStore.store.storeData.storeData.Name; this.TstoreType.Text = controllerStore.store.storeData.storeData.Type; this.TstoreLocation.Text = controllerStore.store.storeData.storeData.Location; if (collMode) { this.CollabHistory.Visible = false; this.BCollaborators.Visible = false; } }
public StoreController searchStoreByName(string name) { conn.Open(); string strSelect = "Select * From OnlineStore where storeName=@name"; SqlCommand cmd = new SqlCommand(strSelect, conn); cmd.Parameters.Add("@name", name); SqlDataReader myReader = cmd.ExecuteReader(); if (myReader.Read()) { string storename = myReader["storeName"].ToString(); string storeaddress = myReader["storeAddress"].ToString(); string storeowner = myReader["storeOwner"].ToString(); StoreOwnerDataBase sodb = new StoreOwnerDataBase(); StoreOwnerController storeOwner = (StoreOwnerController)sodb.searchByEmail(storeowner); StoreController store = new OnlineStoreController(storename, storeaddress, storeOwner); conn.Close(); return(store); } conn.Close(); return(null); }
// Attributes public OnlineStore(string storeName, string storeAddress, StoreOwnerController owner) : base(storeName, storeAddress, owner) { }
public OnSiteStoreController(string storeName, string storeAddress, StoreOwnerController storeOwner) { onSiteStore = new OnSiteStore(storeName, storeAddress, storeOwner); }
public addStorePage(StoreOwnerController controllerSO) { this.controllerSO = controllerSO; InitializeComponent(); }
public void setStoreOwner(StoreOwnerController storeOwner) { this.storeOwner = storeOwner; }
public Store(string storeName, string storeAddress, StoreOwnerController storeOwner) { this.storeName = storeName; this.storeAddress = storeAddress; this.storeOwner = storeOwner; }