Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (User.Identity.IsAuthenticated)
     {
         TravelAgencyService service = new TravelAgencyService();
         using (service.ToDisposable())
         {
             offerIdToReservedMap = service.GetOfferIdToReservedMap(service.GetClientId(User.Identity.Name));
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns Client ID for the logged user.
 /// </summary>
 /// <param name="user">the logged user</param>
 /// <returns>the Client ID or null when it is not found</returns>
 public static int?GetLoggerClientID(IPrincipal user)
 {
     if (user.Identity.IsAuthenticated)
     {
         TravelAgencyService service = new TravelAgencyService();
         using (service.ToDisposable())
         {
             int?userId = service.GetClientId(user.Identity.Name);
             return(userId);
         }
     }
     return(null);
 }
Ejemplo n.º 3
0
        protected void btnOfferHistory_Click(object sender, EventArgs e)
        {
            int aid;

            if (int.TryParse(Request.QueryString["aid"], out aid))
            {
                TravelAgencyService service = new TravelAgencyService();
                using (service.ToDisposable())
                {
                    int?offerId = service.GetOfferHistoryIdByAttractionId(aid);
                    if (offerId.HasValue)
                    {
                        Response.Redirect(String.Format("/Logged/OfferHistoryDetails?oid={0}", offerId.Value));
                    }
                }
            }
        }