コード例 #1
0
        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);
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        // Attributes


        public OnlineStore(string storeName, string storeAddress, StoreOwnerController owner) : base(storeName, storeAddress, owner)
        {
        }
コード例 #6
0
 public OnSiteStoreController(string storeName, string storeAddress, StoreOwnerController storeOwner)
 {
     onSiteStore = new OnSiteStore(storeName, storeAddress, storeOwner);
 }
コード例 #7
0
 public addStorePage(StoreOwnerController controllerSO)
 {
     this.controllerSO = controllerSO;
     InitializeComponent();
 }
コード例 #8
0
 public void setStoreOwner(StoreOwnerController storeOwner)
 {
     this.storeOwner = storeOwner;
 }
コード例 #9
0
 public Store(string storeName, string storeAddress, StoreOwnerController storeOwner)
 {
     this.storeName    = storeName;
     this.storeAddress = storeAddress;
     this.storeOwner   = storeOwner;
 }