private void CheckQueryString() { bool blnFlag = false; string strPID = Request.QueryString["PID"]; if (string.IsNullOrEmpty(strPID)) { blnFlag = false; } else { if (UTLUtilities.IsNumeric(strPID)) { blnFlag = true; } else { blnFlag = false; } } if (blnFlag == true) { intProductID = Convert.ToInt32(Request.QueryString["PID"]); } else { Response.Redirect("Default.aspx"); } }
//public string DeliveryOption //{ // get // { // object obj = ViewState["DeliveryOption"]; // if (obj != null) // { // return obj.ToString(); // } // return ""; // } // set // { // ViewState["DeliveryOption"] = value; // } //} //private UserControl_ContactSeller_Link_Ctrl ClOrderCtrl = null; #endregion PROPERTY #region CHECKQUERYSTRING METHOD /// <summary> /// Checks the query string. /// </summary> /// <returns></returns> private void CheckQueryString() { bool blnFlag = false; object objPID = Request.QueryString["PID"]; object objLocation = Request.QueryString["Location"]; //strCID = Request.QueryString["CID"]; //strSCID = Request.QueryString["SCID"]; //strSSCID = Request.QueryString["SSCID"]; //strProductSellerDetailID = Request.QueryString["PSID"]; if (objPID != null) { if (UTLUtilities.IsNumeric(objPID)) { ProductID = Convert.ToInt32(objPID); blnFlag = true; } else { blnFlag = false; } } else { blnFlag = false; } if (!blnFlag) { Response.Redirect("../Default.aspx", false); } }
protected void btnUpload_Click(object sender, EventArgs e) { string productID = string.Empty; string imagePath = string.Empty; int intActionResult = 0; productID = Request.QueryString["PID"]; imagePath = @"ImageHolder/Classifieds/" + productID + ".jpg"; if (!string.IsNullOrEmpty(productID)) { if (UTLUtilities.IsNumeric(productID)) { if (FileUpload1.HasFile) { if (FileUpload1.PostedFile.ContentLength > 204800) { lblSystemMessage.Text = "File size must be less than 200KB."; Page.RegisterStartupScript("Validation", "<script language=\"javascript\">window.alert(\"File size must be less than 200KB.\");</script>"); return; } else { string strExtension = ""; String UploadedFile = FileUpload1.PostedFile.FileName; if (UploadedFile.Trim() == "") { btnUpload.Enabled = true; return; } int ExtractPos = UploadedFile.LastIndexOf("."); strExtension = UploadedFile.Substring(ExtractPos, UploadedFile.Length - ExtractPos); if ((strExtension.ToUpper() == ".BMP")) { Page.RegisterStartupScript("Validation", "<script language=\"javascript\">window.alert(\"Bmp format is not allowed. Please choose any other format.\");</script>"); lblSystemMessage.Text = "Bmp format is not allowed. Please choose any other format."; return; } FileUpload1.SaveAs(Server.MapPath(@"../ImageHolder/Classifieds/") + productID + ".jpg"); using (BOC_Classifieds_ProductProfile bocProductProfile = new BOC_Classifieds_ProductProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Classifieds_ProductProfile_ProductID = Convert.ToInt32(productID); eocPropertyBean.Classifieds_ProductProfile_ProductImage = imagePath; intActionResult = bocProductProfile.UpdateRecord_ProductImage(eocPropertyBean); if (intActionResult > 0) { Response.Redirect("ControlPanel.aspx"); } } } } } } }
private void CheckQueryString() { bool blnFlag = false; string strPageMode = Request.QueryString["mode"]; string strPID = Request.QueryString["pi"]; //string strCID = Request.QueryString["CID"]; if (string.IsNullOrEmpty(strPageMode) || string.IsNullOrEmpty(strPID)) { blnFlag = false; } else { if (strPageMode == "0" || strPageMode == "1") { if (strPageMode == "0") { if (strPID != "-1") { blnFlag = false; } else { blnFlag = true; } } else { if (UTLUtilities.IsNumeric(strPID)) { blnFlag = true; } else { blnFlag = false; } } } else { blnFlag = false; } } if (blnFlag == true) { intPageMode = Convert.ToInt32(Request.QueryString["mode"]); intProductID = Convert.ToInt32(Request.QueryString["pi"]); } else { Response.Redirect("Default.aspx"); } }
/// <summary> /// Checks the query string and returns the pagemode. /// </summary> /// <returns></returns> private string CheckQueryString() { bool blnFlag = false; strPageMode = Request.QueryString["PageMode"]; strCID = Request.QueryString["CID"]; strSCID = Request.QueryString["SCID"]; author = Request.QueryString["Author"]; strSSCID = Request.QueryString["SSCID"]; strPublisher = Request.QueryString["Publisher"]; location = Request.QueryString["Location"]; //string strSSCID = Request.QueryString["SSCID"]; //TODO: //here we need to check the validation of Author and Publisher . if (string.IsNullOrEmpty(strPageMode) || string.IsNullOrEmpty(strCID) || string.IsNullOrEmpty(strSCID)) { blnFlag = false; } else { if (strPageMode == "0" || strPageMode == "1" || strPageMode == "2" || strPageMode == "3") { if (strCID == "-1" || strSCID == "-1") { blnFlag = false; } else if (UTLUtilities.IsNumeric(strCID) && UTLUtilities.IsNumeric(strSCID)) { blnFlag = true; } else { blnFlag = false; } } else { blnFlag = false; } } if (blnFlag == true) { intPageMode = Convert.ToInt32(Request.QueryString["PageMode"]); intCategoryID = Convert.ToInt32(strCID); intSubcategoryID = Convert.ToInt32(strSCID); intSecondSubcatID = Convert.ToInt32(strSSCID); } else { Response.Redirect("../Default.aspx"); } return(strPageMode); }
protected void Page_Load(object sender, EventArgs e) { this.ProductID = Request.QueryString["ItemKey"]; this.ProfileID = Request.QueryString["ProfKey"]; this.CategoryID = Request.QueryString["CID"]; this.SubcategoryID = Request.QueryString["SCID"]; this.Location = Request.QueryString["Location"]; this.AdvertisementType = Request.QueryString["AdType"]; string strHtml = ""; if (UTLUtilities.IsNumeric(this.ProductID) && UTLUtilities.IsNumeric(this.ProfileID) && UTLUtilities.IsNumeric(this.CategoryID) && UTLUtilities.IsNumeric(this.SubcategoryID)) { this.IsProfileFound = this.SelectRecord_ProductProfile(Convert.ToInt32(this.ProductID), Convert.ToInt32(this.ProfileID)); //lblLocationn.Text = this.Location; txtProductID.Text = this.ProductID; string strAdvertisementType = string.Empty; //strAdvertisementType = GetOfferType(this.CategoryID, dtProductProfile.Rows[0]["AdvertiseMentType"].ToString()); if (IsProfileFound) { this.LoadRecord_ProductReview(Convert.ToInt32(this.ProductID)); if (CategoryID == "9") { pnlPrice.Visible = false; pnlAlternatePriceOffer.Visible = false; } else { pnlPrice.Visible = true; } } else { strHtml = "This product may have been removed by the administrator."; strHtml = UTLUtilities.Encrypt(strHtml); Response.Redirect("Error.aspx?data=" + strHtml); } } else { Response.Redirect("Default.aspx"); } }
private void CheckQueryString() { try { if (Request.QueryString["data"] != null) { string strEncryptedUrl = Request.QueryString["data"].ToString(); string strDecryptedUrl = UTLUtilities.Decrypt(strEncryptedUrl); string[] strSplitUrl = strDecryptedUrl.Split('&', '='); strOrderID = strSplitUrl[1]; strProfileID = strSplitUrl[3]; userType = strSplitUrl[5] == "BS" ? true : false;; strPaymentOption = strSplitUrl[7]; //strPaymentOption = Server.UrlDecode(strSplitUrl[7]); strTotalAmount = strSplitUrl[9]; strCurrency = strSplitUrl[11]; } //strOrderID = Request.QueryString["oi"]; //strProfileID = Request.QueryString["pfi"]; //strPaymentOption = Server.UrlDecode(Request.QueryString["po"]); //strTotalAmount = Request.QueryString["total"]; //strCurrency = Request.QueryString["curr"]; //userType = Request.QueryString["ut"].ToString() == "BS" ? true : false; if (!string.IsNullOrEmpty(strOrderID) || !UTLUtilities.IsNumeric(strOrderID)) { blnFlag = true; } else { blnFlag = false; } } catch (Exception ex) { lblSystemMessage.Text = "Error: " + ex.Message; } }
/// <summary> /// Checks the Query Strings And Retrieves Value. /// </summary> private void CheckQueryString() { bool blnFlag = true; strPageMode = Request.QueryString["PageMode"]; categoryID = Request.QueryString["CID"]; strProvinceID = Request.QueryString["ProvKey"]; location = Request.QueryString["Location"]; string strPriceRangeID = Request.QueryString["PriceKey"]; if (strPageMode != null) { //strPageMode = Request.QueryString["PageMode"].ToString(); if (strPageMode == "0" || strPageMode == "1" || strPageMode == "2" || strPageMode == "3" && categoryID != null) { if (UTLUtilities.IsNumeric(categoryID)) { CategoryID = Convert.ToInt32(categoryID); if (strPageMode == "0" && location != null) { if (!(CategoryID > 0)) { blnFlag = false; } location = Request.QueryString["Location"].ToString(); } else if (strPageMode == "1" && strProvinceID != null && strProvinceID != "-1") { intProvinceID = Convert.ToInt32(strProvinceID); } else if (strPageMode == "2") { blnFlag = true; } else { blnFlag = false; } } else { blnFlag = false; } } else { blnFlag = false; } } else { blnFlag = false; } if (!blnFlag) { Response.Redirect("Default.aspx"); } }
protected void btnUpload_Click(object sender, EventArgs e) { string productID = string.Empty; string imagePath = string.Empty; string itemType = string.Empty; int intActionResult = 0; productID = Request.QueryString["PID"]; itemType = Request.QueryString["ItemType"]; if (!string.IsNullOrEmpty(productID) && !string.IsNullOrEmpty(itemType)) { if (UTLUtilities.IsNumeric(productID)) { //GENERAL ITEMS: if (itemType == "GenItem") { imagePath = @"ImageHolder\GeneralItems\" + productID + ".jpg"; if (FileUpload1.HasFile) { FileUpload1.SaveAs(Server.MapPath(@"..\ImageHolder\GeneralItems\") + productID + ".jpg"); } using (BOC_Corporate_ProdProf_GeneralItems bocProductProfile1 = new BOC_Corporate_ProdProf_GeneralItems()) { EOC_PropertyBean eocPropertyBean1 = new EOC_PropertyBean(); eocPropertyBean1.Business_ProductProfile_GeneralItems_ProductID = Convert.ToInt32(productID); eocPropertyBean1.Business_ProductProfile_GeneralItems_ProductImage = imagePath; intActionResult = bocProductProfile1.UpdateRecord_ProductImage(eocPropertyBean1); if (intActionResult > 0) { Response.Redirect("ProductProfile_General.aspx"); } } } //BOOKS: if (itemType == "Book") { imagePath = @"ImageHolder\Books\" + productID + ".jpg"; if (FileUpload1.HasFile) { FileUpload1.SaveAs(Server.MapPath(@"..\ImageHolder\Books\") + productID + ".jpg"); } using (BOC_Corporate_ProdProf_Book bocProductProfile2 = new BOC_Corporate_ProdProf_Book()) { EOC_PropertyBean eocPropertyBean2 = new EOC_PropertyBean(); eocPropertyBean2.Business_ProductProfile_Books_ProductID = Convert.ToInt32(productID); eocPropertyBean2.Business_ProductProfile_Books_ProductImage = imagePath; intActionResult = bocProductProfile2.UpdateRecord_ProductImage(eocPropertyBean2); if (intActionResult > 0) { Response.Redirect("ProductProfile_Books.aspx"); } } } } } }