private void LenVal() { if ((!PubEntAdminManager.LenVal(this.TxtPubid.Text, 50))) { Response.Redirect("InvalidInput.aspx"); } }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { string strConfid = ((Label)e.Item.Cells[0].Controls[1]).Text; int confid = Convert.ToInt32(strConfid); string confname = ((TextBox)e.Item.Cells[1].Controls[1]).Text; string strsDate = ((TextBox)e.Item.Cells[2].Controls[1]).Text; DateTime sDate = Convert.ToDateTime(strsDate); string streDate = ((TextBox)e.Item.Cells[3].Controls[1]).Text; DateTime eDate = Convert.ToDateTime(streDate); string strMaxOrder = ((TextBox)e.Item.Cells[4].Controls[1]).Text; int maxOrder = Convert.ToInt32(strMaxOrder); Boolean valid = false; Boolean validnum = false; Boolean validlen = false; if (confname.Length > 0) { valid = PubEntAdminManager.OtherVal(confname); validnum = PubEntAdminManager.SpecialVal2(confname); validlen = PubEntAdminManager.LenVal(confname, 10); } if ((valid == false) && (validnum == false) && (validlen == true)) { this.UpdateConfData(confid, confname, maxOrder, sDate, eDate); } else { Response.Redirect("InvalidInput.aspx"); } }
protected void NewPubCreateVal() { if ((!PubEntAdminManager.LenVal(this.ProdID, 10))) { Response.Redirect("InvalidInput.aspx"); } //------------------------ if ((PubEntAdminManager.OtherVal(this.ProdID))) { Response.Redirect("InvalidInput.aspx"); } foreach (string s in this.sarr) { if ((PubEntAdminManager.OtherVal(s))) { Response.Redirect("InvalidInput.aspx"); } } //------------------------ if ((PubEntAdminManager.SpecialVal2(this.ProdID.Replace(" ", "")))) { Response.Redirect("InvalidInput.aspx"); } foreach (string s in this.sarr) { if ((PubEntAdminManager.SpecialVal2(s))) { Response.Redirect("InvalidInput.aspx"); } } }
private void LenVal() { if ((!PubEntAdminManager.LenVal(this.txtNewPub.Text, 10)) || (!PubEntAdminManager.LenVal(this.txtNewQty.Text, 8))) { Response.Redirect("InvalidInput.aspx"); } }
private void LenVal() { if ((!PubEntAdminManager.LenVal(this.txtKitID.Text, 10)) || (!PubEntAdminManager.LenVal(this.HiddenIsVK.Value, 1)) || (!PubEntAdminManager.LenVal(this.HiddenVal.Value, 1))) { Response.Redirect("InvalidInput.aspx"); } }
protected void btQuery_Click(object sender, EventArgs e) { KwGridView.Visible = false; ButtonExcel_Click.Visible = false; Label8.Visible = false; /****EAC BAD CODE int Singlequote=0;*/ Message.Visible = false; string[] split = null; string iProdId = null; string delimStr = ","; char[] delimiter = delimStr.ToCharArray(); Boolean valid = false; Boolean validnum = false; Boolean validlen = false; iProdId = TxtPubid.Text; if (iProdId.Length != 0) { valid = PubEntAdminManager.OtherVal(iProdId); validnum = PubEntAdminManager.SpecialVal2(iProdId); validlen = PubEntAdminManager.LenVal(iProdId, 50); /****EAC BAD CODE Singlequote = iProdId.IndexOf(",");*/ } if ((valid == false) && (validnum == false) && (validlen == true) /****EAC BAD CODE & Singlequote==0*/) { split = iProdId.Split(delimiter); ArrayList list = strQuery(split); if (iProdId == "") { Message.Visible = true; } else if (list.Count == 0) { ButtonExcel_Click.Visible = false; Label8.Visible = false; Message.Text = "Invalid Publication ID(s)"; Message.Visible = true; } else { KwGridView.DataSource = list; KwGridView.DataBind(); KwGridView.Visible = true; Label8.Visible = true; ButtonExcel_Click.Visible = true; } } else { Response.Redirect("InvalidInput.aspx"); } }
public string[] GetProdInterfaceByProdID(string ProdID, int IsVK) { string [] ret = new string[1]; ret[0] = "InvalidInput"; bool pass = true; if ((!PubEntAdminManager.LenVal(ProdID, 10)) || (!PubEntAdminManager.LenVal(IsVK.ToString(), 1))) { pass = false; } if (!PubEntAdminManager.ContentVal(IsVK.ToString(), @"^\d{1}$")) { pass = false; } if ((PubEntAdminManager.OtherVal(ProdID))) { pass = false; } if ((PubEntAdminManager.SpecialVal2(ProdID.Replace(" ", "")))) { pass = false; } if (pass) { if (ProdID.Length > 0 && (IsVK == 0 || IsVK == 1)) { return(PE_DAL.GetProdInt(ProdID, IsVK).ToArray()); } else { return(ret); } } else { return(ret); } }
private void LenVal() { if (txtConfName.Text.Length > 0) { if (!PubEntAdminManager.LenVal(this.txtConfName.Text, 10)) { Response.Redirect("InvalidInput.aspx"); } } if (txtRotateTime.Text.Length > 0 || txtPageTime.Text.Length > 0 || txtSessionTime.Text.Length > 0) { if (!PubEntAdminManager.LenVal(this.txtRotateTime.Text, 5) && !PubEntAdminManager.LenVal(this.txtPageTime.Text, 5) && !PubEntAdminManager.LenVal(this.txtSessionTime.Text, 5)) { Response.Redirect("InvalidInput.aspx"); } } }
//Security Check public void SecurityCheck(int CaseNum, object Ctrl) { switch (CaseNum) { case 1: //Hidden Field HiddenField hidField = (HiddenField)Ctrl; if (!PubEntAdminManager.ContentNumVal(hidField.Value)) { Response.Redirect("InvalidInput.aspx"); } break; case 2: //Dropdown DropDownList ddlField = (DropDownList)Ctrl; foreach (ListItem li in ddlField.Items) { if (!PubEntAdminManager.ContentNumVal(li.Value)) { Response.Redirect("InvalidInput.aspx"); } } break; case 3: //Textbox TextBox txtField = (TextBox)Ctrl; txtField.Text = txtField.Text.Trim(); if (!PubEntAdminManager.LenVal(txtField.Text, 500)) { Response.Redirect("InvalidInput.aspx"); } if (PubEntAdminManager.OtherVal(txtField.Text)) { Response.Redirect("InvalidInput.aspx"); } if (PubEntAdminManager.SpecialVal2(txtField.Text)) { Response.Redirect("InvalidInput.aspx"); } break; } }