private void Load_WorkCategory() { JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.Type_ID = 0; DataTable dt = BLL_JRA_Work_Category.JRA_GET_TYPE_LIST(JRALib_Data); }
protected void ClearFilter() { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 3; DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataTable dtAllChildsCloned = dtAllChilds.Clone(); dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dtAllChilds.Rows) { dtAllChildsCloned.ImportRow(row); } DataView dv = dtAllChildsCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dtAllChilds = dv.ToTable(); ddlChildWorkCateg.DataSource = dtAllChilds; ddlChildWorkCateg.DataTextField = "Work_Category_Display"; ddlChildWorkCateg.DataValueField = "Work_Categ_ID"; ddlChildWorkCateg.DataBind(); ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0")); ddlParentWorkCateg.SelectedIndex = 0; ddlChildWorkCateg.SelectedIndex = 0; }
protected void GridView_Category_RowUpdating(object sender, GridViewUpdateEventArgs e) { JRA_Lib JRALib_Data = new JRA_Lib(); try { GridViewRow row = (GridViewRow)GridView_Category.Rows[e.RowIndex]; int ID = UDFLib.ConvertToInteger(GridView_Category.DataKeys[e.RowIndex].Values[0].ToString()); GridView_Category.EditIndex = -1; JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.Work_Categ_ID = Convert.ToInt32(ID); JRALib_Data.Work_Categ_Parent_ID = Convert.ToInt32(((HiddenField)row.FindControl("hdnParent_Work_Categ_ID")).Value); JRALib_Data.Work_Category_Name = (((TextBox)row.FindControl("txtCategory_Name")).Text.Trim()); JRALib_Data.Work_Categ_Value = (((TextBox)row.FindControl("txtWork_Categ_Value")).Text.Trim()); JRALib_Data.DB_Mode = "U"; int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data); Search_WorkCategory(); Load_CategoryList(null, 0); } catch { } }
protected void Search_WorkCategory() { int rowcount = ucCustomPagerItems.isCountRecord; int SearchRows = 0; int TotalRows = 0; JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.SearchText = txtfilter.Text.Trim(); JRALib_Data.SearchCate = ddlFiter.SelectedValue == "0" ? null : ddlFiter.SelectedValue; JRALib_Data.PageNumber = ucCustomPagerItems.CurrentPageIndex; JRALib_Data.PageSize = ucCustomPagerItems.PageSize; DataTable dt = BLL_JRA_Work_Category.JRA_SEARCH_WORK_CATEGORY(JRALib_Data); GridView_Category.DataSource = dt; GridView_Category.DataBind(); if (dt.Rows.Count > 0) { SearchRows = Convert.ToInt32(dt.Rows[0]["SearchRows"]); TotalRows = Convert.ToInt32(dt.Rows[0]["TotalRows"]); } if (ucCustomPagerItems.isCountRecord == 1) { rowcount = SearchRows; ucCustomPagerItems.CountTotalRec = Convert.ToString(TotalRows); ucCustomPagerItems.BuildPager(); } }
protected void GridView_Type_RowUpdating(object sender, GridViewUpdateEventArgs e) { JRA_Lib JRALib_Data = new JRA_Lib(); try { int ID = UDFLib.ConvertToInteger(GridView_Type.DataKeys[e.RowIndex].Values[0].ToString()); GridViewRow row = (GridViewRow)GridView_Type.Rows[e.RowIndex]; JRALib_Data.Type_ID = ID; JRALib_Data.Type = ((DropDownList)row.FindControl("ddlType")).SelectedValue; JRALib_Data.Type_Value = ((TextBox)row.FindControl("txtType_Value")).Text; JRALib_Data.Type_Display_Text = ((TextBox)row.FindControl("txtType_Display_Text")).Text; JRALib_Data.Type_Description = ((TextBox)row.FindControl("txtType_Desc")).Text; JRALib_Data.Type_Color = ((DropDownList)row.FindControl("ddlGrdType_Color")).SelectedItem.Text; JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = "U"; if (ValidateType(JRALib_Data.Type, JRALib_Data.Type_Value, JRALib_Data.Type_Description, JRALib_Data.Type_Display_Text, JRALib_Data.Type_Color) == true) { int result = BLL_JRA_Work_Category.JRA_INS_TYPE(JRALib_Data); GridView_Type.EditIndex = -1; Search_Type(); } } catch { } }
protected void GridView_Ratings_RowDataBound(object sender, GridViewRowEventArgs e) { try { JRA_Lib JRALib_Data = new JRA_Lib(); DataTable dt = new DataTable(); if (e.Row.RowType == DataControlRowType.DataRow) { int ID = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.Row.RowIndex].Value.ToString()); if ((e.Row.RowState & DataControlRowState.Edit) > 0) { DropDownList ddList = (DropDownList)e.Row.FindControl("ddlDisplayText"); dt = BLL_JRA_Work_Category.JRA_GET_RISK_TYPES(JRALib_Data); ddList.DataSource = dt; ddList.DataTextField = Convert.ToString(dt.Columns["Type_Display_Text"]); ddList.DataValueField = Convert.ToString(dt.Columns["Type_ID"]); ddList.DataBind(); ddList.Items.Insert(0, new ListItem("-Select-", "0")); DataRowView dr = e.Row.DataItem as DataRowView; //ddList.SelectedValue = dr["Risk_TYPE"].ToString(); ddList.Items.FindByValue(Convert.ToString(dr["Risk_Type"])).Selected = true; } } } catch { } }
protected void ddlParentWorkCateg_SelectedIndexChanged(object sender, EventArgs e) { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = UDFLib.ConvertToInteger(ddlParentWorkCateg.SelectedValue); lObjWC.Mode = 1; DataTable dtChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataView dv = dtChilds.DefaultView; DataTable dtChildsCloned = dtChilds.Clone(); dtChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dtChilds.Rows) { dtChildsCloned.ImportRow(row); } dv = dtChildsCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dtChilds = dv.ToTable(); ddlChildWorkCateg.DataSource = dtChilds; ddlChildWorkCateg.DataTextField = "Work_Category_Display"; ddlChildWorkCateg.DataValueField = "Work_Categ_ID"; ddlChildWorkCateg.DataBind(); ddlChildWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); }
private void SearchRiskType() { JRA_Lib JRALib_Data = new JRA_Lib(); DataTable dt = BLL_JRA_Work_Category.JRA_GET_RATINGS_SEARCH(JRALib_Data); GridView_Ratings.DataSource = dt; GridView_Ratings.DataBind(); }
protected void BindCombos() { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 0; DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataView dv = dt.DefaultView; DataTable dtCloned = dt.Clone(); dtCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dt.Rows) { dtCloned.ImportRow(row); } dv = dtCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dt = dv.ToTable(); ddlParentWorkCateg.DataSource = dt; ddlParentWorkCateg.DataTextField = "Work_Category_Display"; ddlParentWorkCateg.DataValueField = "Work_Categ_ID"; ddlParentWorkCateg.DataBind(); ddlParentWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 3; DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataTable dtAllChildsCloned = dtAllChilds.Clone(); dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dtAllChilds.Rows) { dtAllChildsCloned.ImportRow(row); } dv = dtAllChildsCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dtAllChilds = dv.ToTable(); ddlChildWorkCateg.DataSource = dtAllChilds; ddlChildWorkCateg.DataTextField = "Work_Category_Display"; ddlChildWorkCateg.DataValueField = "Work_Categ_ID"; ddlChildWorkCateg.DataBind(); ddlChildWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable dtVessel = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLVessel.DataSource = dtVessel; DDLVessel.DataTextField = "Vessel_name"; DDLVessel.DataValueField = "Vessel_id"; DDLVessel.DataBind(); DDLVessel.Items.Insert(0, new ListItem("--SELECT ALL--", null)); }
protected void Load_TypeList() { JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.Type_ID = 0; DataTable dt = BLL_JRA_Work_Category.JRA_GET_TYPE_LIST(JRALib_Data); GridView_Type.DataSource = dt; GridView_Type.DataBind(); }
private void SaveRisk_Type(string DB_Mode) { JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.RiskType = ddlRiskType.SelectedValue; JRALib_Data.RatingValue = Convert.ToInt32(txtRatingVal.Text); JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = DB_Mode; int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data); }
protected void GridView_Ratings_RowDeleting(object sender, GridViewDeleteEventArgs e) { JRA_Lib JRALib_Data = new JRA_Lib(); int ID = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.RowIndex].Value.ToString()); JRALib_Data.Rating_ID = ID; JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = "D"; int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data); SearchRiskType(); }
private void LoadRisk_Type() { JRA_Lib JRALib_Data = new JRA_Lib(); DataTable dt = BLL_JRA_Work_Category.JRA_GET_RISK_TYPES(JRALib_Data); ddlRiskType.DataSource = dt; ddlRiskType.DataTextField = Convert.ToString(dt.Columns["Type_Display_Text"]); ddlRiskType.DataValueField = Convert.ToString(dt.Columns["Type_ID"]); ddlRiskType.DataBind(); ddlRiskType.Items.Insert(0, new ListItem("-Select-", "0")); ViewState["vsRiskType"] = dt; }
protected void GridView_Category_RowDeleting(object sender, GridViewDeleteEventArgs e) { JRA_Lib JRALib_Data = new JRA_Lib(); int ID = UDFLib.ConvertToInteger(GridView_Category.DataKeys[e.RowIndex].Value.ToString()); JRALib_Data.Work_Categ_ID = ID; JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = "D"; int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data); //GroupGridviewHeader(); Search_WorkCategory(); Load_CategoryList(null, 0); }
private void SaveType(string DB_Mode) { JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.Type_ID = 0; JRALib_Data.Type = ddlType.SelectedItem.Text; JRALib_Data.Type_Value = txtTypeValue.Text.Trim(); JRALib_Data.Type_Display_Text = txtDisplayText.Text.Trim(); JRALib_Data.Type_Description = txtDesc.Text.Trim(); JRALib_Data.Type_Color = ddlColors.SelectedItem.Text; JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = DB_Mode; int result = BLL_JRA_Work_Category.JRA_INS_TYPE(JRALib_Data); }
public void LoadCombos() { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 3; DataTable dtW = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); ddlParentWorkCateg.DataSource = dtW; ddlParentWorkCateg.DataTextField = "Work_Category_Display"; ddlParentWorkCateg.DataValueField = "Work_Categ_ID_TYPE"; ddlParentWorkCateg.DataBind(); ddlParentWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); ddlCTWorkCategory.DataSource = dtW; ddlCTWorkCategory.DataTextField = "Work_Category_Display"; ddlCTWorkCategory.DataValueField = "Work_Categ_ID"; ddlCTWorkCategory.DataBind(); ddlParentWorkCateg.SelectedIndex = 0; }
protected void Load_CategoryList(int?ParentCateID, int Mode) { JRA_Lib ObjJRALib = new JRA_Lib(); ObjJRALib.Mode = Mode; ObjJRALib.Work_Categ_Parent_ID = ParentCateID; DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(ObjJRALib); ddlParentCat.DataSource = dt; ddlParentCat.DataTextField = Convert.ToString(dt.Columns["Work_Category_Name"]); ddlParentCat.DataValueField = Convert.ToString(dt.Columns["Work_Categ_ID"]); ddlParentCat.DataBind(); ddlParentCat.Items.Insert(0, new ListItem("-Select-", "0")); ddlFiter.DataSource = dt; ddlFiter.DataTextField = Convert.ToString(dt.Columns["Work_Category_Name"]); ddlFiter.DataValueField = Convert.ToString(dt.Columns["Work_Categ_ID"]); ddlFiter.DataBind(); ddlFiter.Items.Insert(0, new ListItem("-Select-", "0")); }
private void SaveWorkCategory(string DB_Mode) { JRA_Lib JRALib_Data = new JRA_Lib(); JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.Work_Categ_ID = Convert.ToInt32(0); JRALib_Data.Work_Categ_Parent_ID = Convert.ToInt32(ddlParentCat.SelectedValue); JRALib_Data.Work_Categ_Value = txtCatVal.Text.Trim(); JRALib_Data.Work_Category_Name = txtCatName.Text.Trim(); JRALib_Data.DB_Mode = DB_Mode; int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data); if (result == 999)//CHECK FOR DUPLICATE WORK CATEGORY NAME { string js = ""; js = "alert('Work Category Name already exists.');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); } }
protected void ClearFilter() { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 3; DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); ddlChildWorkCateg.DataSource = dtAllChilds; ddlChildWorkCateg.DataTextField = "Work_Category_Display"; ddlChildWorkCateg.DataValueField = "Work_Categ_ID"; ddlChildWorkCateg.DataBind(); ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0")); ddlParentWorkCateg.SelectedIndex = 0; ddlChildWorkCateg.SelectedIndex = 0; ddlParentWorkCateg.SelectedIndex = 0; ddlAssessmentStatus.SelectedIndex = 0; txtFromDate.Text = ""; txtToDate.Text = ""; DDLVessel.SelectedIndex = 0; }
protected void GridView_Ratings_RowUpdating(object sender, GridViewUpdateEventArgs e) { JRA_Lib JRALib_Data = new JRA_Lib(); try { int ID = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.RowIndex].Values[0].ToString()); GridViewRow row = (GridViewRow)GridView_Ratings.Rows[e.RowIndex]; JRALib_Data.Rating_ID = ID; JRALib_Data.RiskType = ((DropDownList)row.FindControl("ddlDisplayText")).SelectedValue; JRALib_Data.RatingValue = Convert.ToInt32(((TextBox)row.FindControl("txtRisk")).Text); JRALib_Data.UserID = Convert.ToInt32(Session["USERID"]); JRALib_Data.DB_Mode = "U"; int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data); GridView_Ratings.EditIndex = -1; SearchRiskType(); } catch { } }
protected void BindCombos() { JRA_Lib lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 0; DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataView dv = dt.DefaultView; DataTable dtCloned = dt.Clone(); dtCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dt.Rows) { dtCloned.ImportRow(row); } dv = dtCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dt = dv.ToTable(); ddlParentWorkCateg.DataSource = dt; ddlParentWorkCateg.DataTextField = "Work_Category_Display"; ddlParentWorkCateg.DataValueField = "Work_Categ_ID"; ddlParentWorkCateg.DataBind(); ddlParentWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0")); lObjWC = new JRA_Lib(); lObjWC.Work_Categ_Parent_ID = null; lObjWC.Mode = 3; DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC); DataTable dtAllChildsCloned = dtAllChilds.Clone(); dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float); foreach (DataRow row in dtAllChilds.Rows) { dtAllChildsCloned.ImportRow(row); } dv = dtAllChildsCloned.DefaultView; dv.Sort = "Work_Categ_Value"; dtAllChilds = dv.ToTable(); ddlChildWorkCateg.DataSource = dtAllChilds; ddlChildWorkCateg.DataTextField = "Work_Category_Display"; ddlChildWorkCateg.DataValueField = "Work_Categ_ID"; ddlChildWorkCateg.DataBind(); ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0")); ddlParentWorkCateg.SelectedIndex = 0; ddlChildWorkCateg.SelectedIndex = 0; ddlWorkCategory.DataSource = dtAllChilds; ddlWorkCategory.DataTextField = "Work_Category_Display"; ddlWorkCategory.DataValueField = "Work_Categ_ID"; ddlWorkCategory.DataBind(); ddlWorkCategory.Items.Insert(0, new ListItem("-Select All-", "0")); ddlWorkCategory.SelectedIndex = 0; DataSet dsSev = BLL_JRA_Hazards.GET_TYPE("Severity"); ddlSeverity.DataSource = dsSev.Tables[0]; ddlSeverity.DataTextField = "Type_Display_Text"; ddlSeverity.DataValueField = "Type_ID"; ddlSeverity.DataBind(); ddlSeverity.Items.Insert(0, new ListItem("-Select All-", "0")); DataSet dsLkhd = BLL_JRA_Hazards.GET_TYPE("Likelihood"); ddlLikelihood.DataSource = dsLkhd.Tables[0]; ddlLikelihood.DataTextField = "Type_Display_Text"; ddlLikelihood.DataValueField = "Type_ID"; ddlLikelihood.DataBind(); ddlLikelihood.Items.Insert(0, new ListItem("-Select All-", "0")); DataSet dsModRis = BLL_JRA_Hazards.JRA_GET_MODIFIED_RISKS(); ddlModifiedRisk.DataSource = dsModRis.Tables[0]; ddlModifiedRisk.DataTextField = "Type_Display_Text"; ddlModifiedRisk.DataValueField = "Type_ID"; ddlModifiedRisk.DataBind(); ddlModifiedRisk.Items.Insert(0, new ListItem("-Select All-", "0")); }
private bool ValidateCategory(string CatVal, string CatName) { string js = ""; bool Validate = true; float testfloat; try { if (CatVal.Trim() == "") { js = "alert('Enter Category Code');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } if (float.TryParse(CatVal.Trim(), out testfloat) == false) { js = "alert('Category Code not valid');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } if (CatName.Trim() == "") { js = "alert('Enter Category Name');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } if (ddlParentCat.SelectedIndex == 0) { int testInt; bool res = int.TryParse(CatVal.Trim(), out testInt); if (!(res && testInt > 0)) { js = "alert('Category Code not valid');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } else { JRA_Lib ObjJRALib = new JRA_Lib(); ObjJRALib.Mode = 0; ObjJRALib.Work_Categ_Parent_ID = null; DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(ObjJRALib); if (dt.Select("Work_Categ_Value='" + CatVal.Trim() + "'").Length > 0) { js = "alert('Category value already exists');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } } } else { if (!CatVal.Contains('.')) { js = "alert('Category Code not valid');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } JRA_Lib ObjJRALib = new JRA_Lib(); ObjJRALib.Mode = 0; ObjJRALib.Work_Categ_Parent_ID = null; DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(ObjJRALib); string parentcatvalue = dt.Select("Work_Categ_ID=" + ddlParentCat.SelectedValue.ToString())[0]["Work_Categ_Value"].ToString(); if (Math.Truncate(testfloat).ToString() != parentcatvalue) { js = "alert('Category Code not valid');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } if (CatVal.Trim().Contains('.')) { if (Convert.ToInt32(CatVal.Trim().Split('.')[1]) == 0) { js = "alert('Category Code not valid');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } } ObjJRALib = new JRA_Lib(); ObjJRALib.Mode = 1; ObjJRALib.Work_Categ_Parent_ID = Convert.ToInt32(ddlParentCat.SelectedValue); DataTable dt1 = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(ObjJRALib); if (dt1.Select("Work_Categ_Value='" + CatVal.Trim() + "'").Length > 0) { js = "alert('Category value already exists');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); Validate = false; } } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } return(Validate); }