protected void Page_Load(object sender, EventArgs e) { bool vaild_session = true; string session; session = Request.QueryString["session"]; List <SqlParameter> sparams = new List <SqlParameter>(); sparams.Add(new SqlParameter("@session", session)); DataSet ds_session = BookDBProvider.getDataSet("uspGetEmailQuoteSession", sparams); //Get quote id from the url Int32.TryParse(Request.QueryString["quoteid"], out quoteid); if (ds_session.Tables.Count == 0 || ds_session.Tables[0].Rows.Count == 0) //Wrong request { vaild_session = false; } else { int qid = int.Parse(ds_session.Tables[0].Rows[0]["emailquoteid"].ToString()); if (qid != quoteid) //Wrong request { vaild_session = false; } } if (vaild_session == false) { if (!AuthenticationManager.IfAuthenticated || !User.Identity.IsAuthenticated) { FormsAuthentication.SignOut(); } } inquiryinfo = BookDBProvider.getQuoteInfo(quoteid); if (inquiryinfo.IfReplied == 1) { Response.Redirect("/Error.aspx?error=You've already responded."); } if (inquiryinfo.PropertyID == 0) { Response.Redirect("/Error.aspx?error=Wrong Inquiry number"); } if ((inquiryinfo.PropertyOwnerID != userid) && !AuthenticationManager.IfAdmin && vaild_session == false) { Response.Redirect("/Error.aspx?error=You try to see the other info"); } countryinfo = BookDBProvider.getCountryInfo(inquiryinfo.PropertyID); }
protected void saveLog() { transitem = new Transaction_Item(); PropertyInfo[] props = transitem.GetType().GetProperties(); foreach (PropertyInfo prop in props) { prop.SetValue(transitem, Convert.ChangeType(Request[prop.Name], prop.PropertyType), null); } /* * int item_number = Convert.ToInt32(Request["item_number"]); * decimal mc_gross = Convert.ToDecimal(Request["mc_gross"]); * decimal mc_fee = Convert.ToDecimal(Request["mc_fee"]); * string txn_id = Request["txn_id"]; * string paydate = Request["payment_date"]; * string business = Request["business"]; * string payer_email = Request["payer_email"]; * string payer_id = Request["payer_id"]; * string mc_currency = Request["mc_currency"]; * string txn_type = Request["txn_type"]; * string payment_status = Request["payment_status"]; * string payment_type = Request["payment_type"]; * string pending_reason = Request["pending_reason"]; * string item_name = Request["item_name"]; * */ email_resp = BookResponseEmail.getResponseInfo(transitem.item_number); //respid // if (email_resp.ID == 0 || email_resp.IsValid < 1) Response.Redirect("/Error.aspx?error=Wrong Response number or not valid"); inquiryinfo = BookDBProvider.getQuoteInfo(email_resp.QuoteID); countryinfo = BookDBProvider.getCountryInfo(inquiryinfo.PropertyID); owner_info = BookDBProvider.getUserInfo(inquiryinfo.PropertyOwnerID); traveler_info = BookDBProvider.getUserInfo(inquiryinfo.UserID); prop_info = BookDBProvider.getPropertyInfo(inquiryinfo.PropertyID); PaymentHelper.addPaymentLog(transitem); }
protected void Page_Load(object sender, EventArgs e) { /* * if (!AuthenticationManager.IfAuthenticated || !User.Identity.IsAuthenticated) * { * FormsAuthentication.SignOut(); * } */ string param = AjaxProvider.Base64Decode(Request.QueryString["respid"]); if (!Int32.TryParse(param, out respid)) { respid = 0; } // if (respid == 0) respid = Convert.ToInt32(resp_number.Value); email_resp = BookResponseEmail.getResponseInfo(respid); if (email_resp.ID == 0) { Response.Redirect("/Error.aspx?error=Wrong Response number or not valid"); } // resp_number.Value = respid.ToString(); inquiryinfo = BookDBProvider.getQuoteInfo(email_resp.QuoteID); countryinfo = BookDBProvider.getCountryInfo(inquiryinfo.PropertyID); // _total_sum = email_resp.NightRate * inquiryinfo.Nights; _total_sum = email_resp.NightRate; _lodgingval = _total_sum * email_resp.LoadingTax / 100; _balance = _lodgingval + email_resp.CleaningFee + email_resp.SecurityDeposit; _total = _total_sum + _balance; url = String.Format("https://www.vacations-abroad.com/{0}/{1}/{2}/{3}/default.aspx", countryinfo.country, countryinfo.state, countryinfo.city, inquiryinfo.PropertyID); }