protected void Page_Load(object sender, EventArgs e) { length = Convert.ToString(Request.QueryString["Keyword"]).Length; PMMYA.WebServices.validateHtml objvalid = new WebServices.validateHtml(); bool flg = true; HttpUtility.HtmlDecode(Convert.ToString(Request.QueryString["Keyword"])); if (!objvalid.ValidateHTML(Convert.ToString(Request.QueryString["Keyword"]).ToLower())) { flg = false; } if (!objvalid.ValidateHTML(HttpUtility.HtmlDecode(Convert.ToString(Request.QueryString["Keyword"])))) { flg = false; } if (flg) { if (Convert.ToString(Request.QueryString["Keyword"]) == "" || Convert.ToString(Request.QueryString["Keyword"]) == string.Empty) { return; } if (Convert.ToString(Request.QueryString["Keyword"]).ToLower().Contains("Hacked") || Convert.ToString(Request.QueryString["Keyword"]).ToLower().Contains("Compromise")) { return; } if (Convert.ToString(Request.QueryString["Keyword"]).Length == 2) { return; } if (Convert.ToString(Request.QueryString["Keyword"]).Contains(";") || Convert.ToString(Request.QueryString["Keyword"]).Contains("/") || Convert.ToString(Request.QueryString["Keyword"]).Contains("(") || Convert.ToString(Request.QueryString["Keyword"]).Contains("<") || Convert.ToString(Request.QueryString["Keyword"]).Contains(")") || Convert.ToString(Request.QueryString["Keyword"]).Contains(">")) { return; } msgtext = _mahaitUC.GetResourceValue("Common", "lblSearchword", ""); if (System.Threading.Thread.CurrentThread.CurrentCulture.ToString().ToLower() == Convert.ToString("mr-IN").ToLower()) { LangID = 2; lblSearchword.Text = msgtext + Keyword + " "; } else if (System.Threading.Thread.CurrentThread.CurrentCulture.ToString().ToLower() == Convert.ToString("en-IN").ToLower()) { LangID = 1; lblSearchword.Text = msgtext + Keyword + " "; } else { LangID = 3; lblSearchword.Text = msgtext + Keyword + " "; } ViewState["keyword"] = Convert.ToString(Request.QueryString["Keyword"]); if (!IsPostBack) { Keyword = Convert.ToString(Request.QueryString["Keyword"]); } } }
protected void btn_Save_Click(object sender, EventArgs e) { try { PMMYA.WebServices.validateHtml objvalid = new WebServices.validateHtml(); bool flg = true; if (txtEditor3.Text.ToString() == "" || txtEditor3.Text.ToString() == string.Empty || txtEditor4.Text.ToString() == "" || txtEditor4.Text.ToString() == string.Empty || txtEditor6.Text.ToString() == "" || txtEditor6.Text.ToString() == string.Empty) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert(' Please Long Description !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); return; } if ((!objvalid.ValidateHTML(txtEditor1.Text)) || (!objvalid.ValidateHTML(txtEditor2.Text)) || (!objvalid.ValidateHTML(txtEditor3.Text)) || (!objvalid.ValidateHTML(txtEditor4.Text)) || (!objvalid.ValidateHTML(txtEditor5.Text)) || (!objvalid.ValidateHTML(txtEditor6.Text))) { flg = false; txtEditor4.Text = ""; } if (flg) { if (UploadFile.HasFile) { if (SaveUpload() == false) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Invalid Files !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); Clear(); return; } } SqlCommand t_SQLCmd = new SqlCommand(); ObjmenuContentSchema.PageTitle = txtPageTitle.Text; ObjmenuContentSchema.PageTitle_LL = txtPageTitle_LL.Text; ObjmenuContentSchema.PageTitle_UL = txtPageTitle_UL.Text; ObjmenuContentSchema.ShortDescription = txtEditor2.Text; ObjmenuContentSchema.ShortDescription_LL = txtEditor1.Text; ObjmenuContentSchema.ShortDescription_UL = txtEditor5.Text; ObjmenuContentSchema.LongDescription = txtEditor3.Text; ObjmenuContentSchema.LongDescription_LL = txtEditor4.Text; ObjmenuContentSchema.LongDescription_UL = txtEditor6.Text; if (txtSequenceNo.Text.ToString() != "" || txtSequenceNo.Text.ToString() != string.Empty) { ObjmenuContentSchema.SequenceNo = Convert.ToInt32(txtSequenceNo.Text); } else { ObjmenuContentSchema.SequenceNo = 0; } ObjmenuContentSchema.MenuID = Convert.ToInt32(Request.QueryString["MenuID"]); if (Request.QueryString["Mode"] == "Edit") { ObjmenuContentSchema.UpdatedBy = ""; } else { ObjmenuContentSchema.CreatedBy = ""; } ObjmenuContentSchema.IsApprove = chkIsApprove.Checked; ObjmenuContentSchema.IsActive = chkActive.Checked; if (Request.QueryString["Mode"] == "Edit") { ObjmenuContentSchema.MenuContentID = Convert.ToInt32(Request.QueryString["shvid"]); ObjmenuContentSchema.ActionType = "Edit"; } else { ObjmenuContentSchema.ActionType = "Insert"; } int result = objmenuContentBL.SaveMenuContentDeatails(ObjmenuContentSchema); if (result != 0) { string MenuId = Request.QueryString["MenuID"].ToString(); Clear(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Data saved Successfully !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Data Not Saved !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Invalid input !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Please Insert Data !!!');window.location.href='MenuContentList.aspx?MenuID=" + Request.QueryString["MenuID"] + "';", true); } }
protected void btn_Save_Click(object sender, EventArgs e) { try { PMMYA.WebServices.validateHtml objvalid = new WebServices.validateHtml(); if (txtEditor1.Text.ToString() == "" || txtEditor1.Text.ToString() == string.Empty || txtEditor2.Text.ToString() == "" || txtEditor2.Text.ToString() == string.Empty) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Please Fill All Data !!!');window.location.href='PlaceHolderList.aspx';", true); return; } if (!objvalid.ValidateHTML(txtEditor1.Text) || (!objvalid.ValidateHTML(txtEditor2.Text))) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Invalid Input !!!');window.location.href='PlaceHolderList.aspx';", true); return; } if (UploadFile.HasFile) { if (SaveUpload() == false) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Invalid Files !!!');window.location.href='PlaceHolderList.aspx';", true); Clear(); return; } } objPlaceHolderSchema.PlaceHolderName = txtPageTitle.Text; objPlaceHolderSchema.ShortDescription = txtEditor1.Text; objPlaceHolderSchema.ShortDescription_LL = txtEditor2.Text; objPlaceHolderSchema.ShortDescription_UL = txtEditor3.Text; if (Request.QueryString["Mode"] == "Edit") { objPlaceHolderSchema.UpdatedBy = ""; } else { objPlaceHolderSchema.CreatedBy = ""; } objPlaceHolderSchema.IsApprove = chkIsApprove.Checked; objPlaceHolderSchema.IsActive = chkActive.Checked; if (Request.QueryString["Mode"] == "Edit") { objPlaceHolderSchema.PlaceholderId = Convert.ToInt32(Request.QueryString["shvid"]); objPlaceHolderSchema.ActionType = "Edit"; } else { objPlaceHolderSchema.ActionType = "Insert"; } int result = objPlaceholderBAL.SavePlaceHolderContentDeatails(objPlaceHolderSchema); if (result != 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Message", "alert('Data saved Successfully !!!');window.location.href='PlaceHolderList.aspx'", true); Clear(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Message", "alert('Data Not saved !!!')window.location.href='PlaceHolderList.aspx';", true); } } catch (Exception ex) { throw ex; } }