예제 #1
0
        protected void typechange(object sender, EventArgs e)
        {
            string chk = rdbtn_type.SelectedValue;
            string p_no;

            p_no = Session["user"].ToString();

            OdbcCommand cmde = conn_asset.CreateCommand();

            cmde.CommandText = "select category from ast_master where custodian ='" + p_no.Trim() + "'";
            conn_asset.Open();

            OdbcDataReader cat = cmde.ExecuteReader();
            string         typeAsset;

            typeAsset = "";
            while (cat.Read())
            {
                typeAsset = cat["category"].ToString();
            }

            conn_asset.Close();

            OdbcCommand cmdf = conn_asset.CreateCommand();

            if (chk == "SOFTWARE")
            {
                cmdf.CommandText = "select * from error_selection where (Type ='SOFTWARE' or Type = 'BOTH')";
            }
            else
            if (chk == "HARDWARE")
            {
                cmdf.CommandText = "select * from error_selection where (Type ='HARDWARE' or Type = 'BOTH')";
            }
            else
            {
                cmdf.CommandText = "select * from error_selection where (Type ='OTHER' or Type = 'BOTH') ";
            }

            OdbcDataAdapter df  = new OdbcDataAdapter(cmdf);
            DataTable       dt1 = new DataTable();

            df.Fill(dt1);

            Drp_2.DataSource     = dt1;
            Drp_2.DataValueField = "Problem";
            Drp_2.DataTextField  = "Problem";
            Drp_2.DataBind();

            Drp_2.Visible = true;
        }
        protected void SelectChanged(object sender, EventArgs e)
        {
            string      check = Drp_1.SelectedValue.Trim();
            OdbcCommand cmdb  = conn_asset.CreateCommand();

            cmdb.CommandText = " select * from spare_master where type = '" + check + "'";
            OdbcDataAdapter da2 = new OdbcDataAdapter(cmdb);
            DataTable       dt2 = new DataTable();


            da2.Fill(dt2);
            dt2.Columns.Add(new DataColumn("Desc", System.Type.GetType("System.String"), "currentStock + ' - ' + make + ' - ' + model"));
            Drp_2.DataSource           = dt2;
            Drp_2.AppendDataBoundItems = true;
            Drp_2.DataTextField        = "Desc";
            Drp_2.DataValueField       = "model";
            Drp_2.DataBind();
            Drp_2.Visible = true;
        }
예제 #3
0
        protected void dept_changed(object sender, EventArgs e)
        {
            OdbcCommand cmdb = conn_asset.CreateCommand();

            conn_asset.Open();
            cmdb.CommandText = "select * from ast_locationMaster where deptcode = '" + Drp_1.SelectedValue + "'";
            OdbcDataAdapter da1 = new OdbcDataAdapter(cmdb);
            DataTable       dt1 = new DataTable();

            da1.Fill(dt1);

            dt1.Columns.Add(new DataColumn("Title", System.Type.GetType("System.String"), "locationCode + ' - ' + locationName"));

            Drp_2.DataSource     = dt1;
            Drp_2.DataValueField = "locationCode";
            Drp_2.DataTextField  = "Title";
            Drp_2.DataBind();
            conn_asset.Close();
        }