protected void btnClearFilter_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            DDLModule.SelectedValue = "0";
            DDLVeseelType.ClearSelection();
            DDLVetType.ClearSelection();
            DDLStatus.ClearSelection();
            Add_Status();
            txtNumber.Text        = "";
            txtVersion.Text       = "";
            txtQuestionnaire.Text = "";
            UpdAdvFltr.Update();
            BindQuestionnaire();

            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);
        }
    }
    /// <summary>
    /// Bind status to status dropdown
    /// </summary>
    public void Add_Status()
    {
        try
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Value");

            dt.Rows.Add("Published");
            dt.Rows.Add("Draft");
            dt.Rows.Add("Archived");

            DDLStatus.DataSource     = dt;
            DDLStatus.DataTextField  = "Value";
            DDLStatus.DataValueField = "Value";
            DDLStatus.DataBind();
            DDLStatus.Select("Published");
            DDLStatus.Select("Draft");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
Ejemplo n.º 3
0
 protected void GetIndexStatus()
 {
     DDLStatus.DataValueField = "ID";
     DDLStatus.DataTextField  = "Adi";
     DDLStatus.DataSource     = clSsql.getDT("Select * from SiyahiOlkeBeynelxalq");
     DDLStatus.DataBind();
     DDLStatus.Items.Insert(0, new ListItem("Seçin", "0"));
 }
Ejemplo n.º 4
0
    public void FillFollowup()
    {
        string         str = "select Name as Id from [Come2myCityDB].[dbo].[tbl_Main_ID] where Sub_Id='5'";
        SqlDataAdapter da  = new SqlDataAdapter(str, con);
        DataSet        ds  = new DataSet();

        da.Fill(ds);
        DDLStatus.DataSource = ds;

        if (ds.Tables[0].Rows.Count > 0)
        {
            DDLStatus.DataValueField = "Id";
        }
        DDLStatus.DataBind();
        DDLStatus.Items.Add("Select");
    }
Ejemplo n.º 5
0
    public void txtchange(DropDownList ddl, TextBox tb)
    {
        string  str1 = "select Name,ID from [Come2myCityDB].[dbo].[tbl_Main_ID] where UserId='" + Session["User"].ToString() + "' and Sub_ID='5'";
        DataSet ds   = cc.ExecuteDataset(str1);

        //string str = Convert.ToString(ds.Tables[0].Rows[0]["Name"]);
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (Convert.ToString(txtStatus.Text) == Convert.ToString(ds.Tables[0].Rows[i]["Name"]))
            {
                //string abc = txtStatus.Text;
                ViewState["abc"] = txtStatus.Text;
            }
        }
        if (Convert.ToString(txtStatus.Text) == Convert.ToString(ViewState["abc"]))
        {
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('this type of Status Already Present')", true);
            DDLStatus.Visible = true;
            txtStatus.Visible = false;
            ViewState["abc"]  = null;
        }

        else
        {
            string st   = txtStatus.Text.ToUpper();
            string str3 = "insert into [Come2myCityDB].[dbo].[tbl_Main_ID](Sub_ID,Name,UserId)values('5','" + st + "','" + Session["User"].ToString() + "')";
            int    row  = cc.ExecuteNonQuery(str3);

            string  str2 = "select Name,ID from [Come2myCityDB].[dbo].[tbl_Main_ID] where UserId='" + Session["User"].ToString() + "'";
            DataSet ds1  = cc.ExecuteDataset(str2);

            DDLStatus.DataSource     = ds;
            DDLStatus.DataTextField  = "Name";
            DDLStatus.DataValueField = "ID";
            DDLStatus.DataBind();

            DDLStatus.Items.Insert(0, new ListItem("select", "0"));
            DDLStatus.SelectedIndex = 0;

            ddl.Visible = true;
            tb.Visible  = false;
        }
    }
Ejemplo n.º 6
0
    public void fill()
    {
        string         str = "select Name as Id from [Come2myCityDB].[dbo].[tbl_Main_ID] where UserId='" + Session["User"].ToString() + "'";
        DataSet        ds  = new DataSet();
        SqlDataAdapter da  = new SqlDataAdapter(str, con);

        da.Fill(ds);
        DDLStatus.DataSource = ds;
        if (ds.Tables[0].Rows.Count > 0)
        {
            DDLStatus.DataValueField = "Id";
        }
        DDLStatus.DataBind();
        DDLStatus.Items.Add("Add New");
        DDLStatus.Items.Add("Select");

        DDLStatus.Items.Insert(0, new ListItem("select", "0"));
        DDLStatus.SelectedIndex = 0;
    }
Ejemplo n.º 7
0
 public void QueryTypesDdl()
 {
     try
     {
         MySqlConnection con = new MySqlConnection(connectionString);
         con.Open();
         String           query2  = @"SELECT * FROM TYPES";
         MySqlCommand     com2    = new MySqlCommand(query2, con);
         MySqlDataAdapter adapter = new MySqlDataAdapter(com2);
         DataTable        dt      = new DataTable();
         adapter.Fill(dt);
         DDLStatus.DataSource = dt;
         DDLStatus.DataBind();
         DDLStatus.DataTextField  = "TYPEV";
         DDLStatus.DataValueField = "TYPEN";
         DDLStatus.DataBind();
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Ejemplo n.º 8
0
 protected void btnClearFilter_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         DDLVessel.ClearSelection();
         DDLVetType.ClearSelection();
         DDLStatus.ClearSelection();
         DDLJobStatus.ClearSelection();
         txtDueDays.Text               = "";
         rbtnValid.Checked             = false;
         rbtnObservation.SelectedValue = "0";
         DDLOilMajor.ClearSelection();
         DDLInspector.ClearSelection();
         txtLVetFromDate.Text    = "";
         txtLVetToDate.Text      = "";
         txtVessel.Text          = "";
         chkVesselAssign.Checked = true;
         BindVesselDDL();
         UpdAdvFltr.Update();
         Bind_VettingIndex();
         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);
     }
 }
Ejemplo n.º 9
0
    /// <summary>
    /// Bind status to status dropdown
    /// </summary>
    public void Add_VettingStatus()
    {
        try
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Value");

            dt.Rows.Add("Planned");
            dt.Rows.Add("In-Progress");
            dt.Rows.Add("Completed");
            dt.Rows.Add("Failed");

            DDLStatus.DataSource     = dt;
            DDLStatus.DataTextField  = "Value";
            DDLStatus.DataValueField = "Value";
            DDLStatus.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }