コード例 #1
0
        /// <summary>
        /// Create a new RESTAURANT object.
        /// </summary>
        /// <param name="address">Initial value of the address property.</param>
        /// <param name="city">Initial value of the city property.</param>
        /// <param name="name">Initial value of the name property.</param>
        /// <param name="state">Initial value of the state property.</param>
        /// <param name="storeid">Initial value of the storeid property.</param>
        /// <param name="zip">Initial value of the zip property.</param>
        public static RESTAURANT CreateRESTAURANT(global::System.String address, global::System.String city, global::System.String name, global::System.String state, global::System.Int32 storeid, global::System.Int32 zip)
        {
            RESTAURANT rESTAURANT = new RESTAURANT();

            rESTAURANT.address = address;
            rESTAURANT.city    = city;
            rESTAURANT.name    = name;
            rESTAURANT.state   = state;
            rESTAURANT.storeid = storeid;
            rESTAURANT.zip     = zip;
            return(rESTAURANT);
        }
コード例 #2
0
        /// <summary>
        /// Increments the Nay Vote for the selected restaurant and adds a cookie to remember the vote.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void NoButton_Click(object sender, EventArgs e)
        {
            RESTAURANT restaurant = restaurantDB.RESTAURANTS.Single(p => p.address == RestaurantStreetLabel.Text);

            restaurant.nayvotes++;
            restaurantDB.SaveChanges();
            ThanksLabel.Visible = true;
            refreshing          = true;
            search();
            refreshing = false;
            HttpCookie vote = new HttpCookie(RestaurantStreetLabel.Text, "no");

            vote.Expires = DateTime.Now.AddMonths(1);
            Response.Cookies.Add(vote);
            YesButton.Enabled = false;
            NoButton.Enabled  = false;
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RESTAURANTS EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRESTAURANTS(RESTAURANT rESTAURANT)
 {
     base.AddObject("RESTAURANTS", rESTAURANT);
 }