コード例 #1
0
    /// <summary>
    /// Bind risk level
    /// </summary>
    public void Bind_RiskLevel()
    {
        try
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("RiskLevel");

            dt.Rows.Add("1");
            dt.Rows.Add("2");
            dt.Rows.Add("3");
            dt.Rows.Add("4");
            dt.Rows.Add("5");

            DDLRiskLevel.DataSource     = dt;
            DDLRiskLevel.DataTextField  = "RiskLevel";
            DDLRiskLevel.DataValueField = "RiskLevel";
            DDLRiskLevel.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
コード例 #2
0
    protected void btnClearAllFilter_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            DDLQuestionnaire.ClearSelection();
            DDLSection.ClearSelection();
            DDLQuestion.ClearSelection();
            rbtnType.SelectedValue = "0";
            DDLFleet.SelectedValue = "0";
            DDLVesselObs.ClearSelection();
            DDLOilMajorObs.ClearSelection();
            DDLInspectorObs.ClearSelection();
            txtObservationVessel.Text = "";
            DDLCategories.ClearSelection();
            DDLRiskLevel.ClearSelection();
            txtLObsFromDate.Text    = "";
            txtLObsToDate.Text      = "";
            chkVesselAssign.Checked = true;
            BindVesselDDLByFleet();
            UpdAdvFltrObs.Update();
            Bind_ObservationIndex();

            if (hfAdv.Value == "o")
            {
                String tgladvsearchClr = String.Format("toggleOnSearchClearFilter(advText,'" + hfAdv.Value + "');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "tgladvsearchClr", tgladvsearchClr, true);
            }
            else
            {
                String tgladvsearchClr1 = String.Format("toggleOnSearchClearFilter(advText,'" + hfAdv.Value + "');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "tgladvsearchClr1", tgladvsearchClr1, true);
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }