protected void btnSaveRank_Click(object sender, EventArgs e) { int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); int k = 0; DataTable table = new DataTable(); table.Columns.Add("PID"); for (int i = 0; i < gvRankList.Rows.Count; i++) { if (((CheckBox)gvRankList.Rows[i].Cells[2].FindControl("chkRank")).Checked == true) { table.Rows.Add(UDFLib.ConvertToInteger(gvRankList.Rows[i].Cells[0].Text)); k++; } } if (k == 0) { lblError.Visible = true; lblError.Text = "Rank not selected!"; } else { BLL_JRA_Hazards.Insert_Approvar(Work_Categ_ID, 0, 0, GetSessionUserID(), 0, table); lblError.Visible = false; BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin(); LoadCombos(); string js1 = "SetWorkCategID(" + Work_Categ_ID.ToString() + ";" + "0);"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js1, true); BindApprovar(UDFLib.ConvertToInteger(hfWC.Value)); string js0 = "alert('Approver rank added Successfully and Approval has been configured to Vessel Rank');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js0, true); } }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = ViewState["SORTDIRECTION"].ToString(); } DataTable dt = BLL_JRA_Hazards.GET_HAZARD_TEMPLATE_LIST( null, ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, "", ucCustomPagerItems.CurrentPageIndex, null, sortbycoloumn, sortdirection, ref rowcount).Tables[0]; string Header = (ddlChildWorkCateg.SelectedIndex > 0 ? ddlChildWorkCateg.SelectedItem.Text : "") + " Hazard Template"; string[] HeaderCaptions = { "Work Category", "Hazard Description", "Control Measure", "Severity", "Likelihood", "Initial Risk", "Additional Control Measures", "Modified Risk" }; string[] DataColumnsName = { "Work_Category_Name", "Hazard_Description", "Control_Measure", "Severity", "Likelihood", "Initial_Risk", "Additional_Control_Measures", "Modified_Risk" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "HazardTemplate", Header, ""); }
protected bool EnableCheckboxRank(string RankID) { int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); //DataSet ds = objFMS.FMS_Get_ApprovarByLevel(FileID, ApprovalLevel); DataSet ds = BLL_JRA_Hazards.Get_ApprovarByLevel(Work_Categ_ID, 0); if (ds.Tables.Count > 0) { if (ds.Tables[1].Select("Approvar_Detail_ID='" + RankID + "'").Length > 0) { return(false); } else { return(true); } } else { return(true); } }
protected void btnCopyTo_Click(object sender, EventArgs e) { if (ddlParentWorkCateg.SelectedIndex <= 0) { return; } DataTable TO_Work_Categ_ID = new DataTable(); TO_Work_Categ_ID.Columns.Add("PID"); foreach (DataRow dr in ddlCTWorkCategory.SelectedValues.Rows) { if (hfWC.Value.ToString() != dr[0].ToString()) { TO_Work_Categ_ID.Rows.Add(dr[0].ToString()); } } if (TO_Work_Categ_ID.Rows.Count == 0) { return; } string msg = BLL_JRA_Hazards.COPY_APPROVAL(UDFLib.ConvertToInteger(ddlParentWorkCateg.SelectedValue.Split(';')[0]), TO_Work_Categ_ID, GetSessionUserID()).Tables[0].Rows[0][0].ToString(); string js0 = "alert('" + msg + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js0, true); LoadCombos(); }
protected void CalulateRisk() { if (ddlSeverity.SelectedIndex > 0 && ddlLikelihood.SelectedIndex > 0) { DataSet dsSev = BLL_JRA_Hazards.GET_TYPE("Severity"); DataSet dsLkhd = BLL_JRA_Hazards.GET_TYPE("Likelihood"); string s = dsSev.Tables[0].Select("Type_ID=" + UDFLib.ConvertToInteger(ddlSeverity.SelectedValue))[0]["Type_Value"].ToString(); string l = dsLkhd.Tables[0].Select("Type_ID=" + UDFLib.ConvertToInteger(ddlLikelihood.SelectedValue))[0]["Type_Value"].ToString(); int Rating = UDFLib.ConvertToInteger(s) * UDFLib.ConvertToInteger(l); DataSet ds = BLL_JRA_Hazards.GET_RISK_RATINGS(Rating); txtInitiakRisk.Text = ds.Tables[0].Rows[0]["Type_Display_Text"].ToString(); txtInitiakRiskValue.Text = ds.Tables[0].Rows[0]["Type_ID"].ToString(); txtInitialRiskColor.Text = ds.Tables[0].Rows[0]["Type_Color"].ToString(); } else { txtInitiakRiskValue.Text = ""; txtInitiakRisk.Text = ""; txtInitialRiskColor.Text = ""; } string AddPort = String.Format("showModal('divadd',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddPort", AddPort, true); }
protected void BindCombos() { DataTable dtAllChilds = BLL_JRA_Hazards.GET_WORK_CATEGORY_LIST(null, 3, 2); ddlWorkCategory.DataSource = dtAllChilds; ddlWorkCategory.DataTextField = "Work_Category_Display"; ddlWorkCategory.DataValueField = "Work_Categ_ID"; ddlWorkCategory.DataBind(); ddlWorkCategory.Items.Insert(0, new ListItem("-Select All-", "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")); }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = ViewState["SORTDIRECTION"].ToString(); } DataTable dt = BLL_JRA_Hazards.GET_ASSESSMENT_SEARCH(DDLVessel.SelectedIndex <= 0 ? null : DDLVessel.SelectedValue, null, ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, ddlAssessmentStatus.SelectedIndex <= 0 ? null : ddlAssessmentStatus.SelectedValue.ToString(), UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), "", GetSessionUserID(), null, null, sortbycoloumn, sortdirection, ref rowcount).Tables[0]; string Header = (ddlChildWorkCateg.SelectedIndex > 0 ? ddlChildWorkCateg.SelectedItem.Text : "") + " Risk Assessment"; string[] HeaderCaptions = { "Vessel Name ", "Assessment No.", "Job Assessed", "Current Assessment Date", "Last Assessment Date", "Assessment Status", }; string[] DataColumnsName = { "Vessel_Name", "Work_Categ_Value", "Work_Category_Name", "Current_Assessment_Date", "Last_Assessment_Date", "Assessment_Status" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "JobRiskAssessmentIndex", Header, ""); }
protected void btnDel_OnClick(object sender, EventArgs e) { if (hfAns.Value.ToString() == "true") { BLL_JRA_Hazards.DEL_HAZARD_TRMPLATE(Convert.ToInt32(hfHzID.Value), Convert.ToInt32(Session["USERID"].ToString())); } BindHazardTemplateGrid(); }
protected void onDelete(object source, CommandEventArgs e) { int AssessmentDtlID = UDFLib.ConvertToInteger(e.CommandArgument.ToString().Split(';')[0]); int OfficeID = UDFLib.ConvertToInteger(e.CommandArgument.ToString().Split(';')[1]); BLL_JRA_Hazards.DEL_ASSESSMENT_DETAILS(AssessmentDtlID, UDFLib.ConvertToInteger(hfVessel_ID.Value), OfficeID, GetSessionUserID()); BindAssessmentDetails(); }
protected void btnSave_Click(object sender, EventArgs e) { if (ddlSeverity.SelectedIndex > 0 && ddlCons.SelectedIndex > 0) { BLL_JRA_Hazards.INSUPD_Sev_Cons(UDFLib.ConvertToInteger(ddlSeverity.SelectedValue), UDFLib.ConvertToInteger(ddlCons.SelectedValue), txtDesc.Text, UDFLib.ConvertToInteger(Session["UserID"])); string js0 = "alert('Description added Successfully, check the matrix to see effects!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js0, true); } }
protected void btnsave_Click(object sender, EventArgs e) { string ModifiedRiskColor = null; string ModifiedRiskValue = null; string ModifiedRisk = null; if (ddlModifiedRisk.SelectedIndex > 0) { DataSet dsModRis = BLL_JRA_Hazards.JRA_GET_MODIFIED_RISKS(); ModifiedRiskColor = dsModRis.Tables[0].Select("Type_ID=" + ddlModifiedRisk.SelectedValue)[0]["Type_Color"].ToString(); ModifiedRisk = ddlModifiedRisk.SelectedItem.Text; ModifiedRiskValue = ddlModifiedRisk.SelectedValue; } if (ddlSeverity.SelectedIndex > 0 && ddlLikelihood.SelectedIndex > 0) { DataSet dsSev = BLL_JRA_Hazards.GET_TYPE("Severity"); DataSet dsLkhd = BLL_JRA_Hazards.GET_TYPE("Likelihood"); string s = dsSev.Tables[0].Select("Type_ID=" + UDFLib.ConvertToInteger(ddlSeverity.SelectedValue))[0]["Type_Value"].ToString(); string l = dsLkhd.Tables[0].Select("Type_ID=" + UDFLib.ConvertToInteger(ddlLikelihood.SelectedValue))[0]["Type_Value"].ToString(); int Rating = UDFLib.ConvertToInteger(s) * UDFLib.ConvertToInteger(l); DataSet ds = BLL_JRA_Hazards.GET_RISK_RATINGS(Rating); txtInitiakRisk.Text = ds.Tables[0].Rows[0]["Type_Display_Text"].ToString(); txtInitiakRiskValue.Text = ds.Tables[0].Rows[0]["Type_ID"].ToString(); txtInitialRiskColor.Text = ds.Tables[0].Rows[0]["Type_Color"].ToString(); } if (HiddenFlag.Value == "Add") { //BLL_JRA_Hazards.INSUPD_ASSESSMENT(UDFLib.ConvertToInteger(hfAssessment_ID.Value), // null, UDFLib.ConvertToInteger(hfVessel_ID.Value), // GetSessionUserID(), null, txtHazardDesc.Text,txtControlMeasure.Text, // ddlSeverity.SelectedValue, ddlLikelihood.SelectedValue, ddlSeverity.SelectedItem.Text, // ddlLikelihood.SelectedItem.Text, txtInitiakRisk.Text, txtInitiakRiskValue.Text, txtInitialRiskColor.Text, // txtAdditionalCntrolMeasure.Text, ModifiedRisk, ModifiedRiskValue, ModifiedRiskColor, 1); BLL_JRA_Hazards.INSUPD_ASSESSMENT(UDFLib.ConvertToInteger(hfAssessment_ID.Value), null, UDFLib.ConvertToInteger(hfVessel_ID.Value), GetSessionUserID(), null, txtHazardDesc.Text, txtControlMeasure.Text, ddlSeverity.SelectedValue, ddlLikelihood.SelectedValue, ddlSeverity.SelectedItem.Text, ddlLikelihood.SelectedItem.Text, txtInitiakRisk.Text, txtInitiakRiskValue.Text, txtInitialRiskColor.Text, txtAdditionalCntrolMeasure.Text, ModifiedRisk, ModifiedRiskValue, ModifiedRiskColor, 1); } else { BLL_JRA_Hazards.INSUPD_ASSESSMENT(UDFLib.ConvertToInteger(hfAssessment_ID.Value), UDFLib.ConvertToInteger(ViewState["Assessment_Dtl_ID"]), UDFLib.ConvertToInteger(hfVessel_ID.Value), GetSessionUserID(), UDFLib.ConvertToInteger(ViewState["Hazard_ID"]), txtHazardDesc.Text, txtControlMeasure.Text, ddlSeverity.SelectedValue, ddlLikelihood.SelectedValue, ddlSeverity.SelectedItem.Text, ddlLikelihood.SelectedItem.Text, txtInitiakRisk.Text, txtInitiakRiskValue.Text, txtInitialRiskColor.Text, txtAdditionalCntrolMeasure.Text, ModifiedRisk, ModifiedRiskValue, ModifiedRiskColor, UDFLib.ConvertToInteger(ViewState["Office_ID"])); } BindAssessmentDetails(); string hidemodal = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true); }
protected void btnRework_Click(object sender, EventArgs e) { BLL_JRA_Hazards.UPD_ASSESSMENT_STATUS(UDFLib.ConvertToInteger(hfAssessment_ID.Value), UDFLib.ConvertToInteger(hfWork_Categ_ID.Value), UDFLib.ConvertToInteger(hfVessel_ID.Value), "Rework", txtRemark.Text, GetSessionUserID()); txtRemark.Text = ""; string AddHazardTemplate = String.Format("hideModal('divApv',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddHazardTemplate", AddHazardTemplate, true); imgBtnApproveReject.Visible = false; BindAssessmentDetails(); }
protected void btnSaveFollowup_Click(object sender, EventArgs e) { BLL_JRA_Hazards.Insert_REMARKS(UDFLib.ConvertToInteger(hfAssessment_ID.Value), UDFLib.ConvertToInteger(hfVessel_ID.Value), GetSessionUserID(), txtFWRemark.Text); string divFollow = String.Format("hideModal('divFollow',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "divFollow", divFollow, true); LoadFollowups(); }
protected void LoadSevCon() { if (ddlSeverity.SelectedIndex > 0 && ddlCons.SelectedIndex > 0) { DataTable dT = BLL_JRA_Hazards.GET_Sev_Cons(UDFLib.ConvertToInteger(ddlSeverity.SelectedValue), UDFLib.ConvertToInteger(ddlCons.SelectedValue)); if (dT.Rows.Count > 0) { txtDesc.Text = dT.Rows[0]["SC_Description"].ToString(); } } }
protected void LoadFollowups() { txtFWRemark.Text = ""; DataSet dsFW = BLL_JRA_Hazards.GET_REMARKS(UDFLib.ConvertToInteger(hfAssessment_ID.Value), UDFLib.ConvertToInteger(hfVessel_ID.Value)); if (dsFW.Tables[0].Rows.Count > 0) { grdFollowUps.DataSource = dsFW.Tables[0]; grdFollowUps.DataBind(); } }
protected void btnRework_Click(object sender, EventArgs e) { int Assement_ID = UDFLib.ConvertToInteger(hfAssessentKey.Value.ToString().Split(';')[0]); int Vessel_ID = UDFLib.ConvertToInteger(hfAssessentKey.Value.ToString().Split(';')[1]); int Work_Categ_ID = UDFLib.ConvertToInteger(hfAssessentKey.Value.ToString().Split(';')[2]); BLL_JRA_Hazards.UPD_ASSESSMENT_STATUS(Assement_ID, Work_Categ_ID, Vessel_ID, "Rework", txtRemark.Text, GetSessionUserID()); txtRemark.Text = ""; string AddHazardTemplate = String.Format("hideModal('divadd',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddHazardTemplate", AddHazardTemplate, true); BindAssessmentTemplateGrid(); }
protected void btnSave_Click(object sender, EventArgs e) { int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); int ApprovalLevel = UDFLib.ConvertToInteger(ViewState["ApprovalLevel"].ToString()); DataSet ds = BLL_JRA_Hazards.Get_ApprovarByLevel(Work_Categ_ID, ApprovalLevel); int CreatedBy = GetSessionUserID(); BLL_JRA_Hazards.UPD_Approvar(Work_Categ_ID, ApprovalLevel); for (int i = 0; i < grdUser.Rows.Count; i++) { if (((CheckBox)grdUser.Rows[i].Cells[2].FindControl("chkUser")).Checked == true) { DataTable table = new DataTable(); table.Columns.Add("PID"); BLL_JRA_Hazards.Insert_Approvar(Work_Categ_ID, ApprovalLevel, UDFLib.ConvertToInteger(grdUser.Rows[i].Cells[0].Text), CreatedBy, 1, table); //objFMS.FMS_Insert_FileApprovar(FileID, ApprovalLevel, UDFLib.ConvertToInteger(grdUser.Rows[i].Cells[0].Text), CreatedBy); } } if (!string.IsNullOrEmpty(txtSearch.Text)) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataTable table = new DataTable(); table.Columns.Add("PID"); BLL_JRA_Hazards.Insert_Approvar(Work_Categ_ID, ApprovalLevel, UDFLib.ConvertToInteger(ds.Tables[0].Rows[i]["Approvar_Detail_ID"]), CreatedBy, 1, table); } } LoadCombos(); string js2 = "SetWorkCategID(" + Work_Categ_ID.ToString() + ";" + "1);"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js2, true); BindApprovar(Work_Categ_ID); string js0 = "alert('Approver Added Successfully and Approval has been configured to office user');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js0, true); string js1 = "hideModal('dvAppLevelUser');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsApprrovar", js1, true); // BindApprovar(Work_Categ_ID); }
protected void btnsave_Click(object sender, EventArgs e) { if (HiddenFlag.Value == "Add") { BLL_JRA_Hazards.INSUPD_HAZARD_TRMPLATE(null, UDFLib.ConvertToInteger(ddlWorkCategory.SelectedValue), txtHazardDesc.Text, txtControlMeasure.Text, UDFLib.ConvertToInteger(ddlSeverity.SelectedValue), UDFLib.ConvertToInteger(ddlLikelihood.SelectedValue), UDFLib.ConvertToInteger(txtInitiakRiskValue.Text), txtAdditionalCntrolMeasure.Text, ddlModifiedRisk.SelectedItem.Value, GetSessionUserID()); } else { BLL_JRA_Hazards.INSUPD_HAZARD_TRMPLATE(UDFLib.ConvertToInteger(txtHazardID.Text), UDFLib.ConvertToInteger(ddlWorkCategory.SelectedValue), txtHazardDesc.Text, txtControlMeasure.Text, UDFLib.ConvertToInteger(ddlSeverity.SelectedValue), UDFLib.ConvertToInteger(ddlLikelihood.SelectedValue), UDFLib.ConvertToInteger(txtInitiakRiskValue.Text), txtAdditionalCntrolMeasure.Text, ddlModifiedRisk.SelectedItem.Value, GetSessionUserID()); } BindHazardTemplateGrid(); string hidemodal = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true); }
protected void LoadCombo() { 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 dsCon = BLL_JRA_Hazards.GET_TYPE("Consequences"); ddlCons.DataSource = dsCon.Tables[0]; ddlCons.DataTextField = "Type_Display_Text"; ddlCons.DataValueField = "Type_ID"; ddlCons.DataBind(); ddlCons.Items.Insert(0, new ListItem("-Select All-", "0")); }
protected void ImgAdd_Click(object sender, EventArgs e) { //this.SetFocus("ctl00_MainContent_txtPortName"); ddlWorkCategory.SelectedValue = ViewState["Work_Categ_ID"].ToString(); if (hfTblMode.Value != "Edit") { BLL_JRA_Hazards.UPD_ASSESSMENT_STATUS(Convert.ToInt32(hfAssessment_ID.Value), Convert.ToInt32(hfWork_Categ_ID.Value), Convert.ToInt32(hfVessel_ID.Value), "Edit", "", GetSessionUserID()); hfTblMode.Value = "Edit"; } HiddenFlag.Value = "Add"; OperationMode = "Add Hazard"; ClearFields(); string AddPort = String.Format("showModal('divadd',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddPort", AddPort, true); }
public void BindAssessmentTemplateGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = ViewState["SORTDIRECTION"].ToString(); } DataTable dt = BLL_JRA_Hazards.GET_ASSESSMENT_SEARCH(DDLVessel.SelectedIndex <= 0?null:DDLVessel.SelectedValue, null, ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, ddlAssessmentStatus.SelectedIndex <= 0?null:ddlAssessmentStatus.SelectedValue.ToString(), UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), "", GetSessionUserID(), ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, sortbycoloumn, sortdirection, ref rowcount).Tables[0]; if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvAssessment.DataSource = dt; gvAssessment.DataBind(); } else { gvAssessment.DataSource = dt; gvAssessment.DataBind(); } }
protected bool SelectRank(string Rank) { int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); DataSet ds = BLL_JRA_Hazards.Get_ApprovarByLevel(Work_Categ_ID, 0); if (ds.Tables.Count > 0) { if (ds.Tables[0].Select("Approvar_Detail_ID='" + Rank + "'").Length > 0) { return(true); } else { return(false); } } else { return(false); } }
protected bool SelectCheckbox(string UserID) { int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); int ApprovalLevel = UDFLib.ConvertToInteger(ViewState["ApprovalLevel"].ToString()); DataSet ds = BLL_JRA_Hazards.Get_ApprovarByLevel(Work_Categ_ID, ApprovalLevel); if (ds.Tables.Count > 0) { if (ds.Tables[0].Select("Approvar_Detail_ID='" + UserID + "'").Length > 0) { return(true); } else { return(false); } } else { return(false); } }
public void BindHazardTemplateGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = ViewState["SORTDIRECTION"].ToString(); } DataTable dt = BLL_JRA_Hazards.GET_HAZARD_TEMPLATE_LIST( null, ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, "", ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, sortbycoloumn, sortdirection, ref rowcount).Tables[0]; if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvHazard.DataSource = dt; gvHazard.DataBind(); } else { gvHazard.DataSource = dt; gvHazard.DataBind(); } }
protected void btnAddLevel_Click(object sender, EventArgs e) { if (hfWC.Value.ToString() == "") { string js0 = "alert('Select work category!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsMsg", js0, true); return; } int Work_Categ_ID = UDFLib.ConvertToInteger(hfWC.Value.ToString()); if (UDFLib.ConvertToInteger(ViewState["TotalApprovalLevel"].ToString()) == 5) { lblError.Visible = true; lblError.Text = "Can not Add More Approval Level. Max Approval Level Set!!"; } else { int CreatedBy = GetSessionUserID(); BLL_JRA_Hazards.Insert_ApprovalLevels(Work_Categ_ID, CreatedBy); } BindApprovar(Work_Categ_ID); }
protected void btnUpd_OnClick(object sender, EventArgs e) { HiddenFlag.Value = "Edit"; OperationMode = "Edit Hazard Template"; int cnt = 0; DataSet dt = BLL_JRA_Hazards.GET_HAZARD_TEMPLATE_LIST(hfHzID.Value, null, null, null, null, null, null, ref cnt); txtHazardID.Text = dt.Tables[0].Rows[0]["Hazard_ID"].ToString(); txtHazardDesc.Text = dt.Tables[0].Rows[0]["Hazard_Description"].ToString(); txtControlMeasure.Text = dt.Tables[0].Rows[0]["Control_Measure"].ToString(); txtInitiakRisk.Text = dt.Tables[0].Rows[0]["Initial_Risk"].ToString(); txtInitiakRiskValue.Text = dt.Tables[0].Rows[0]["Initial_Risk_Value"].ToString(); ddlSeverity.SelectedValue = dt.Tables[0].Rows[0]["Severity_ID"].ToString(); ddlLikelihood.SelectedValue = dt.Tables[0].Rows[0]["Likelihood_ID"].ToString(); txtAdditionalCntrolMeasure.Text = dt.Tables[0].Rows[0]["Additional_Control_Measures"].ToString(); ddlWorkCategory.SelectedValue = dt.Tables[0].Rows[0]["Work_Categ_ID"].ToString(); ddlModifiedRisk.SelectedValue = dt.Tables[0].Rows[0]["Modified_Risk_Value"].ToString(); string AddHazardTemplate = String.Format("showModal('divadd',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddHazardTemplate", AddHazardTemplate, true); BindHazardTemplateGrid(); }
protected void onDelete(object source, CommandEventArgs e) { BLL_JRA_Hazards.DEL_HAZARD_TRMPLATE(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session["USERID"].ToString())); BindAssessmentTemplateGrid(); }
public void BindApprovar(int Work_Categ_ID) { DataSet ds = new DataSet(); ds = BLL_JRA_Hazards.Get_Approvar(Work_Categ_ID); lblWC.Text = hfIDName.Value; //if (ds.Tables[0].Rows.Count>0) // lblWC.Text = ds.Tables[0].Rows[0]["Work_Categ_ID_Name"].ToString()+" :- "; if (ds.Tables[1].Rows.Count > 0) { ViewState["TotalApprovalLevel"] = ds.Tables[1].Rows[0]["LevelCount"].ToString(); } else { ViewState["TotalApprovalLevel"] = 1; } if (hfType.Value == "0") { BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin(); DataTable dt = objCrewAdmin.Get_RankList(); gvRankList.DataSource = dt; gvRankList.DataBind(); pnlOffice.Visible = false; pnlVessel.Visible = true; rdblstAppType.SelectedIndex = 1; } else { grdLevel.DataSource = null; grdLevel.DataBind(); grdLevel.DataSource = ds.Tables[0]; grdLevel.DataBind(); pnlOffice.Visible = true; pnlVessel.Visible = false; rdblstAppType.SelectedIndex = 0; } //if (ds.Tables[2].Rows[0]["Type"].ToString() == "1" && (hfType.Value == "0" )) //{ // BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin(); // DataTable dt = objCrewAdmin.Get_RankList(); // gvRankList.DataSource = dt; // gvRankList.DataBind(); // pnlOffice.Visible = true; // pnlVessel.Visible = false; //} //else //{ // grdLevel.DataSource = null; // grdLevel.DataBind(); // grdLevel.DataSource = ds.Tables[0]; // grdLevel.DataBind(); // pnlOffice.Visible = true; // pnlVessel.Visible = false; //} //if (ds.Tables[2].Rows[0]["Type"].ToString() == "0") //{ // lblWorkCateg.Text = ds.Tables[2].Rows[0]["Work_Category_Name"].ToString(); // try // { // ddlRank.SelectedValue = ds.Tables[3].Rows[0]["Approvar_Detail_ID"].ToString(); // } // catch (Exception) // { // ddlRank.SelectedIndex = 0; // } // pnlOffice.Visible = false; // rdblstAppType.SelectedValue = "0"; //} //else //{ // //GridViewHelper helper = new GridViewHelper(grdLevel); // //helper.RegisterGroup("Approval_Level", true, true); // //helper.GroupHeader += new GroupEvent(helper_GroupHeader); // grdLevel.DataSource = null; // grdLevel.DataBind(); // grdLevel.DataSource = ds.Tables[0]; // grdLevel.DataBind(); // pnlOffice.Visible = true; // pnlVessel.Visible = false; // rdblstAppType.SelectedValue = "1"; //} }
protected void onUpdate(object source, CommandEventArgs e) { ddlWorkCategory.SelectedValue = ViewState["Work_Categ_ID"].ToString(); if (hfTblMode.Value != "Edit") { BLL_JRA_Hazards.UPD_ASSESSMENT_STATUS(Convert.ToInt32(hfAssessment_ID.Value), Convert.ToInt32(hfWork_Categ_ID.Value), Convert.ToInt32(hfVessel_ID.Value), "Edit", "", GetSessionUserID()); hfTblMode.Value = "Edit"; } HiddenFlag.Value = "Edit"; OperationMode = "Edit Hazard Template"; int cnt = 0; int AssessmentDtlID = UDFLib.ConvertToInteger(e.CommandArgument.ToString().Split(';')[0]); int OfficeID = UDFLib.ConvertToInteger(e.CommandArgument.ToString().Split(';')[1]); ViewState["Assessment_Dtl_ID"] = AssessmentDtlID; ViewState["Office_ID"] = OfficeID; DataSet dt = BLL_JRA_Hazards.GET_ASSESSMENT(UDFLib.ConvertToInteger(hfAssessment_ID.Value), UDFLib.ConvertToInteger(hfVessel_ID.Value), GetSessionUserID(), AssessmentDtlID, OfficeID); ViewState["Hazard_ID"] = txtHazardID.Text = dt.Tables[0].Rows[0]["Hazard_ID"].ToString(); if (dt.Tables[0].Rows[0]["Hazard_ID"].ToString() == "") { txtHazardDesc.ReadOnly = false; } else { txtHazardDesc.ReadOnly = true; } txtHazardDesc.Text = dt.Tables[0].Rows[0]["Hazard_Description"].ToString(); txtControlMeasure.Text = dt.Tables[0].Rows[0]["Control_Measure"].ToString(); txtInitiakRisk.Text = dt.Tables[0].Rows[0]["Initial_Risk"].ToString(); txtInitiakRiskValue.Text = dt.Tables[0].Rows[0]["Initial_Risk_Value"].ToString(); txtAdditionalCntrolMeasure.Text = dt.Tables[0].Rows[0]["Additional_Control_Measures"].ToString(); txtInitialRiskColor.Text = dt.Tables[0].Rows[0]["Initial_Risk_Color"].ToString(); try { ddlSeverity.SelectedValue = dt.Tables[0].Rows[0]["Severity_ID"].ToString(); } catch (Exception) { ddlSeverity.SelectedIndex = 0; } try { ddlLikelihood.SelectedValue = dt.Tables[0].Rows[0]["Likelihood_ID"].ToString(); } catch (Exception) { ddlLikelihood.SelectedIndex = 0; } try { ddlWorkCategory.SelectedValue = dt.Tables[0].Rows[0]["Work_Categ_ID"].ToString(); } catch (Exception) { ddlWorkCategory.SelectedIndex = 0; } try { ddlModifiedRisk.SelectedValue = dt.Tables[0].Rows[0]["Modified_Risk_Value"].ToString(); } catch (Exception) { ddlModifiedRisk.SelectedIndex = 0; } string AddHazardTemplate = String.Format("showModal('divadd',true);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddHazardTemplate", AddHazardTemplate, true); }
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")); }