public static String GetCountryToRedirect(String ipaddress) { Int64 ipno = Int64.Parse(IPAddressToNumber(ipaddress).ToString()); String c = AdminDAO.GetCountryForIpNumber(ipno); if (c != null) { Country temp = AdminDAO.GetCountryByID(c); IList <Country> fclist = AdminDAO.GetFranchiseCountries(); if (fclist.Contains(temp)) { return(temp.CountryID); } else { foreach (Country cr in fclist) { if (cr.Continent.Equals(temp.Continent)) { return(cr.CountryID); } } return("US"); } } else { return("US"); } }
public static String GetRedirectionUrlWithParams(Uri url, String country) { IList <Country> countries = AdminDAO.GetFranchiseCountries(); String domain = "www"; switch (country) { case "US": domain = "www"; break; case "GB": domain = "eu"; break; default: domain = "www"; foreach (Country c in countries) { if (c.Continent.Equals(AdminDAO.GetCountryByID(country).Continent)) { domain = c.CountryID.ToLower(); } } break; } String newurl = ""; newurl += "http://" + domain + ".airnetzcharter.com"; newurl += url.PathAndQuery; return(newurl); }
protected void Page_Load(object sender, EventArgs e) { Country c = AdminDAO.GetCountryByID(Session["Country"].ToString()); copyright = c.CopyRight; /*if (selectedtab == "myaircrafts") * myaircrafts.Attributes.Add("class", "selected"); * if (selectedtab == "requests") * requests.Attributes.Add("class", "selected"); * if (selectedtab == "settings") * settings.Attributes.Add("class", "selected");*/ }
protected void Page_Load(object sender, EventArgs e) { Country c = AdminDAO.GetCountryByID(Session["Country"].ToString()); copyright = c.CopyRight; pricingdisclaimer = c.PricingDisclaimer; if (selectedtab == "home") { home.Attributes.Add("class", "selected"); } if (selectedtab == "agent") { agents.Attributes.Add("class", "selected"); } if (selectedtab == "operator") { operators.Attributes.Add("class", "selected"); } }
public EmailBO(String subject, String content, String domain) { Country c = AdminDAO.GetCountryByID(domain); this.content = content; this.subject = subject; signature = c.Signature; MailAddress m; email.MailServerName = "mail.airnetzcharter.com"; email.MailServerUserName = "******"; email.MailServerPassword = "******"; m = new MailAddress("*****@*****.**", "Airnetz Charter"); email.From = m; email.Subject = subject; Send = true; foreach (String s in Default.adminemails.Split(",".ToCharArray())) { email.BCCs.Add(s.Trim()); } }
public EmailBO(String ID, String domain) { EmailSetting es = AdminDAO.GetEmailSettingByID(ID); Country c = AdminDAO.GetCountryByID(domain); content = es.EmailContent; subject = es.Subject; signature = c.Signature; country = c; Send = es.Send; MailAddress m; email.MailServerName = "mail.airnetzcharter.com"; email.MailServerUserName = "******"; email.MailServerPassword = "******"; m = new MailAddress("*****@*****.**", "Airnetz Charter"); email.From = m; email.Subject = subject; foreach (String s in Default.adminemails.Split(",".ToCharArray())) { email.BCCs.Add(s.Trim()); } }
protected void Page_Load(object sender, EventArgs e) { try { Int32 nooflegs = Int32.Parse(Request.Params.Get("nooflegs")); BookRequest b = new BookRequest(); Customer check = CustomerBO.GetLoggedInCustomer(); Agent agentcheck = AgentBO.GetLoggedInAgent(); b.IsAgent = false; Contact c = new Contact(); if (check != null) { c.Name = check.Name; c.Email = check.Email; c.Phone = check.ContactNo; } else { c.Name = Request.Params.Get("Name"); c.Email = Request.Params.Get("Email"); c.Phone = Request.Params.Get("ContactNo"); if (agentcheck != null) { b.IsAgent = true; b.Agent = agentcheck; } else if (Session["AgentID"] != null) { b.IsAgent = true; Agent a = AgentDAO.FindAgentByID((long)Session["AgentID"]); b.Agent = a; } else { Customer custemail = CustomerDAO.CheckCustomerByEmail(Request.Params.Get("Email")); if (custemail == null) { Customer cust = new Customer(); cust.Email = Request.Params.Get("Email");; cust.ContactNo = Request.Params.Get("ContactNo"); cust.Name = Request.Params.Get("Name"); cust.Password = CustomerBO.GeneratePassword(); cust.Status = 1; CustomerDAO.MakePersistent(cust); check = cust; EmailBO em = new EmailBO("NewCustomer", Session["Country"].ToString()); em.SendEmailToCustomer(check); } else { check = custemail; } } } if (Request.Params.Get("fixedpricecharter") != null) { FixedPriceCharter el = BookRequestDAO.FindFixedPriceCharterByID(Int64.Parse(Request.Params.Get("fixedpricecharter"))); b.FixedPriceCharter = el; } c.Description = Request.Params.Get("OtherDetails"); b.PAX = Int32.Parse(Request.Params.Get("PAX")); b.Budget = Double.Parse(Request.Params.Get("budget")); b.FinalBudget = BookRequestBO.GetFinalBudget(b.Budget, AdminBO.GetCountry()); b.ContactDetails = c; b.TimeofCreation = DateTime.Now; b.TripType = Request.Params.Get("TripType"); AirplaneType apt = OperatorDAO.FindAircraftTypeByID(Request.Params.Get("aircrafttype")); b.PlaneType = apt; b.Status = 0; b.Domain = AdminDAO.GetCountryByID(Session["Country"].ToString()); for (int i = 1; i <= nooflegs; i++) { Leg l = new Leg(); l.Sequence = i; ListSet fromairfields = AirfieldBO.GetAirfields(Request.Params.Get("fromleg" + i)); ListSet toairfields = AirfieldBO.GetAirfields(Request.Params.Get("toleg" + i)); foreach (Airfield a in fromairfields) { if (l.Source == null) { l.Source = a; } } if (l.Source.IsTemporary()) { l.Source = AirfieldBO.SaveAirfield(l.Source); } foreach (Airfield a in toairfields) { if (l.Destination == null) { l.Destination = a; } } if (l.Destination.IsTemporary()) { l.Destination = AirfieldBO.SaveAirfield(l.Destination); } l.Date = DateTime.Parse(Request.Params.Get("dateleg" + i) + " " + Request.Params.Get("timeleg" + i)); b.AddLeg(l); } b = BookRequestBO.AcceptBookRequest(b); if (b.FixedPriceCharter == null) { OperatorResolver opr = new OperatorResolver(OperatorBO.OperatorResolve); opr.BeginInvoke(b, null, null); } else { EmailBO em = new EmailBO("FixedPriceCharterNotificationToOperator", Session["Country"].ToString()); em.SendEmailToOperator(b.FixedPriceCharter.Aircraft.Vendor); } if (b.IsAgent) { EmailBO em = new EmailBO("AgentThanksRequest", Session["Country"].ToString()); em.SendEmailToAgent(b.Agent); } else { EmailBO em = new EmailBO("CustomerThanksRequest", Session["Country"].ToString()); em.SendEmailToCustomer(check); } Session.Add("bid", b.BookID); } catch (AifieldNotFoundException ax) { Response.Redirect(Request.UrlReferrer.OriginalString + "?" + Serialize(Request.QueryString)); } catch (Exception ex) { Response.Redirect("QuickQuote.aspx"); } Response.Redirect("RequestSent.aspx"); }
protected void Page_Load(object sender, EventArgs e) { AdminMaster m = (AdminMaster)Page.Master; m.selectedtab = "rates"; if (Request.Params.Get("searchratebtn") != null) { NameValueCollection nvc = new NameValueCollection(); String tempkey = null; String tempval = null; Boolean flag = true; for (int i = 0; i < Request.QueryString.Count; i++) { tempkey = Request.QueryString.GetKey(i); tempval = Request.QueryString.Get(i); if (tempkey != "searchratebtn") { if (tempval != "all") { flag = true; } else { flag = false; } } else { flag = false; } if (flag) { nvc.Add(tempkey, tempval); } } if (AdminBO.Serialize(nvc) != "") { Response.Redirect("AirplaneTypeRates.aspx?" + AdminBO.Serialize(nvc)); } else { Response.Redirect("AirplaneTypeRates.aspx"); } } if (Request.Params.Get("addairplanetype") != null) { AirplaneType at = OperatorDAO.FindAircraftTypeByID(Request.Params.Get("aircrafttype_add")); Country c = AdminDAO.GetCountryByID(Request.Params.Get("country_add")); if (OperatorDAO.GetRateForCountryAndAirplaneType(at, c).Count > 0) { Session["alreadypresent"] = "1"; } else { AirplaneTypeRate atr = new AirplaneTypeRate(); atr.Country = c; atr.PlaneType = at; atr.HourlyRate = Double.Parse(Request.Params.Get("hourlyrate")); atr.NightHalt = Double.Parse(Request.Params.Get("nighthalt")); atr.WaitingCharge = Double.Parse(Request.Params.Get("waitingcharge")); atr.WatchHour = Double.Parse(Request.Params.Get("watchhour")); atr.FuelPositioning = Double.Parse(Request.Params.Get("fuelpositioning"));; atr.Crew = Double.Parse(Request.Params.Get("crew")); at.AirplaneTypeRates.Add(atr); OperatorDAO.SaveAirplaneType(at); } Response.Redirect(Request.UrlReferrer.OriginalString); } if (Request.Params.Get("removerate") != null) { AirplaneTypeRate atr = OperatorDAO.GetAirplaneTypeRateByID(Int64.Parse(Request.Params.Get("rid"))); NHibernateHelper.GetCurrentSession().Delete(atr); Response.Redirect(Request.UrlReferrer.OriginalString); } }