コード例 #1
0
 public ActionResult AddDeliveryLocation(int universities, string locationName, string address1, string address2, string city, string state, string zipCode, string phoneNumber, string DeliveryTime)
 {
     var location = new Location()
     {
         LocationName = locationName,
         BusinessName = locationName,
         FirstName = locationName,
         LastName = locationName,
         Address1 = address1,
         Address2 = address2,
         City = city,
         StateOrProvince = state,
         ZipCode = zipCode,
         PhoneNumber = phoneNumber,
         Country = "United States",
         CountryCode = "US"
     };
     db.Locations.AddObject(location);
     var deliveryLocation = new University_Delivery()
     {
         UniversityId = universities,
         Location = location,
         DeliveryTime = DateTime.Parse(DeliveryTime)
     };
     db.SaveChanges();
     return RedirectToAction("ManageDeliveryHours");
 }
コード例 #2
0
 /// <summary>
 /// Create a new University_Delivery object.
 /// </summary>
 /// <param name="universityDeliveryId">Initial value of the UniversityDeliveryId property.</param>
 /// <param name="universityId">Initial value of the UniversityId property.</param>
 /// <param name="locationId">Initial value of the LocationId property.</param>
 /// <param name="deliveryTime">Initial value of the DeliveryTime property.</param>
 public static University_Delivery CreateUniversity_Delivery(global::System.Int32 universityDeliveryId, global::System.Int32 universityId, global::System.Int32 locationId, global::System.DateTime deliveryTime)
 {
     University_Delivery university_Delivery = new University_Delivery();
     university_Delivery.UniversityDeliveryId = universityDeliveryId;
     university_Delivery.UniversityId = universityId;
     university_Delivery.LocationId = locationId;
     university_Delivery.DeliveryTime = deliveryTime;
     return university_Delivery;
 }
コード例 #3
0
 public static void SetDeliveryLocation(HttpContextBase context, University_Delivery deli_location)
 {
     HttpCookie deliveryLocation = new HttpCookie(DeliveryLocationSessionKey);
     deliveryLocation.Value = deli_location.UniversityDeliveryId.ToString();
     deliveryLocation.Expires = DateTime.Now.AddYears(2);
     context.Response.Cookies.Add(deliveryLocation);
 }
コード例 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the University_Delivery EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUniversity_Delivery(University_Delivery university_Delivery)
 {
     base.AddObject("University_Delivery", university_Delivery);
 }