public void TextItemName_TextChanged(object sender, EventArgs e) { try{ if (!string.IsNullOrEmpty(TextItemName.Text)) { alert_box.Visible = false; OracleConnection conn = new OracleConnection(strConnString); conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "select * from IT_ASSET_ITEMS where ITEM_NAME = '" + TextItemName.Text + "'"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { CheckItemName.Text = "<label class='control-label'><i class='fa fa-times-circle-o'></i> Item name is already exist</label>"; CheckItemName.ForeColor = System.Drawing.Color.Red; TextItemName.Focus(); BtnAdd.Attributes.Add("aria-disabled", "false"); BtnAdd.Attributes.Add("class", "btn btn-primary disabled"); } else { CheckItemName.Text = "<label class='control-label'><i class='fa fa fa-check'></i> Item name is available</label>"; CheckItemName.ForeColor = System.Drawing.Color.Green; CheckIsActive.Focus(); BtnAdd.Attributes.Add("aria-disabled", "true"); BtnAdd.Attributes.Add("class", "btn btn-primary active"); } } else { CheckItemName.Text = "<label class='control-label'><i class='fa fa-hand-o-left'></i> Item name is not blank</label>"; CheckItemName.ForeColor = System.Drawing.Color.Red; TextItemName.Focus(); } } catch { Response.Redirect("~/ParameterError.aspx"); } }
public void TextItemSalesName_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TextItemSalesDescription.Text)) { alert_box.Visible = false; OracleConnection conn = new OracleConnection(strConnString); conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "select * from PF_SALES_ITEM where ITEM_SALES_DESCRIPTION = '" + TextItemSalesDescription.Text + "'"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { CheckItemSalesName.Text = "<label class='control-label'><i class='fa fa-times-circle-o'></i> Sales Item description is already entry</label>"; CheckItemSalesName.ForeColor = System.Drawing.Color.Red; TextItemSalesDescription.Focus(); BtnAdd.Attributes.Add("aria-disabled", "false"); BtnAdd.Attributes.Add("class", "btn btn-primary disabled"); } else { CheckItemSalesName.Text = "<label class='control-label'><i class='fa fa fa-check'></i> Sales Item description is available</label>"; CheckItemSalesName.ForeColor = System.Drawing.Color.Green; CheckIsActive.Focus(); BtnAdd.Attributes.Add("aria-disabled", "true"); BtnAdd.Attributes.Add("class", "btn btn-primary active"); } } else { CheckItemSalesName.Text = "<label class='control-label'><i class='fa fa-hand-o-left'></i> Sales Item description is not blank</label>"; CheckItemSalesName.ForeColor = System.Drawing.Color.Red; TextItemSalesDescription.Focus(); } }
public void TextPayTerms_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TextPayTerms.Text)) { alert_box.Visible = false; OracleConnection conn = new OracleConnection(strConnString); conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "select * from NRC_PAYMENT_TERMS where PAY_TERMS_NAME = '" + TextPayTerms.Text + "'"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { CheckPayTerms.Text = "<label class='control-label'><i class='fa fa-times-circle-o'></i> Payment Terms name is already entry</label>"; CheckPayTerms.ForeColor = System.Drawing.Color.Red; TextPayTerms.Focus(); BtnAdd.Attributes.Add("aria-disabled", "false"); BtnAdd.Attributes.Add("class", "btn btn-primary disabled"); } else { CheckPayTerms.Text = "<label class='control-label'><i class='fa fa fa-check'></i> Payment Terms name is available</label>"; CheckPayTerms.ForeColor = System.Drawing.Color.Green; CheckIsActive.Focus(); BtnAdd.Attributes.Add("aria-disabled", "true"); BtnAdd.Attributes.Add("class", "btn btn-primary active"); } } else { CheckPayTerms.Text = "<label class='control-label'><i class='fa fa-hand-o-left'></i> Payment Terms name is not blank</label>"; CheckPayTerms.ForeColor = System.Drawing.Color.Red; TextPayTerms.Focus(); } }
public void TextProGarEstName_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TextProGarEstName.Text)) { alert_box.Visible = false; OracleConnection conn = new OracleConnection(strConnString); conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "select * from PF_PRODUCTION_GARBAGE_EST where PGE_PERCENT = '" + TextProGarEstName.Text + "'"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { CheckMachineName.Text = "<label class='control-label'><i class='fa fa-times-circle-o'></i> Garbage Estimation Percent of Production is already entry</label>"; CheckMachineName.ForeColor = System.Drawing.Color.Red; TextProGarEstName.Focus(); BtnAdd.Attributes.Add("aria-disabled", "false"); BtnAdd.Attributes.Add("class", "btn btn-primary disabled"); } else { CheckMachineName.Text = "<label class='control-label'><i class='fa fa fa-check'></i> Garbage Estimation Percent of Production is available</label>"; CheckMachineName.ForeColor = System.Drawing.Color.Green; CheckIsActive.Focus(); BtnAdd.Attributes.Add("aria-disabled", "true"); BtnAdd.Attributes.Add("class", "btn btn-primary active"); } } else { CheckMachineName.Text = "<label class='control-label'><i class='fa fa-hand-o-left'></i> Garbage Estimation Percent of Production is not blank</label>"; CheckMachineName.ForeColor = System.Drawing.Color.Red; TextProGarEstName.Focus(); } }