예제 #1
0
    private void BindDropDownList7()
    {
        DataSet        ds      = new DataSet();
        DatabaseHelper DbQuery = new DatabaseHelper();
        DataTable      dt      = new DataTable();
        DataRow        ndr     = dt.NewRow();

        dt.Columns.Add("Filed1", typeof(String));
        dt.Columns.Add("Filed2", typeof(String));
        //1.二聯式、2.三聯式、3.二聯式收銀機發票、4.三聯式收銀機發票、5.電子計算機發票、6.免用統一發票、7.電子發票

        dt.Rows.Add(new Object[] { "7", "7電子發票" });
        dt.Rows.Add(new Object[] { "1", "1二聯式" });
        dt.Rows.Add(new Object[] { "2", "2三聯式" });
        dt.Rows.Add(new Object[] { "3", "3二聯式收銀機發票" });
        dt.Rows.Add(new Object[] { "4", "4三聯式收銀機發票" });
        dt.Rows.Add(new Object[] { "5", "5電子計算機發票" });
        dt.Rows.Add(new Object[] { "6", "6免用統一發票" });



        DropDownList7.DataSource     = dt;
        DropDownList7.DataTextField  = "Filed2";
        DropDownList7.DataValueField = "Filed1";
        DropDownList7.DataBind();
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        cnn.Open();
        DropDownList3.Items.Clear();
        SqlCommand    cmd = new SqlCommand("select Subject from sub where Ptype='" + DropDownList1.SelectedItem.ToString() + "'", cnn);
        SqlDataReader dr  = cmd.ExecuteReader();

        dr.Read();
        DataTable dt = new DataTable("sub");

        dt.Load(dr);
        DropDownList3.DataSource    = dt;
        DropDownList3.DataTextField = "Subject";
        DropDownList3.DataBind();
        DropDownList4.DataSource    = dt;
        DropDownList4.DataTextField = "Subject";
        DropDownList4.DataBind();
        DropDownList5.DataSource    = dt;
        DropDownList5.DataTextField = "Subject";
        DropDownList5.DataBind();
        DropDownList6.DataSource    = dt;
        DropDownList6.DataTextField = "Subject";
        DropDownList6.DataBind();
        DropDownList7.DataSource    = dt;
        DropDownList7.DataTextField = "Subject";
        DropDownList7.DataBind();
        DropDownList8.DataSource    = dt;
        DropDownList8.DataTextField = "Subject";
        DropDownList8.DataBind();
        dr.Close();
    }
예제 #3
0
 protected void insertcity_Click(object sender, EventArgs e)
 {
     if ((TextBox1.Text != ""))
     {
         int t = controllerObj.insertcity(TextBox1.Text, Convert.ToInt32(DropDownList6.SelectedValue));
         if (t == 0)
         {
             Label1.Text = "this city is already exist .";
         }
         else
         {
             Label1.Text = "this city inserts corectly .";
         }
         DropDownList7.DataBind();
         DropDownList6.DataBind();
         DropDownList5.DataBind();
         DropDownList4.DataBind();
         DropDownList3.DataBind();
         DropDownList2.DataBind();   // to make change which happens when delete and insert apeare in other droplists
         DropDownList11.DataBind();
         DropDownList12.DataBind();
         DropDownList13.DataBind();
     }
     else
     {
         Label1.Text = "You enter missing data !!.";
     }
 }
예제 #4
0
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string         str  = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["constring"].ToString();
        SqlConnection  conn = new SqlConnection(str);
        SqlDataAdapter sda  = new SqlDataAdapter(" select sensor.sensorName,sensor.stationId from sensor,station where sensor.stationId= station.id and station.stationName = '" + DropDownList1.SelectedItem + "' ", conn);
        DataSet        ds   = new DataSet();

        sda.Fill(ds);
        DropDownList3.DataTextField = "sensorName";
        //  DropDownList2.DataValueField = "stationId";
        DropDownList3.DataSource = ds.Tables[0].DefaultView;
        DropDownList3.DataBind();
        DropDownList4.DataTextField = "sensorName";
        //  DropDownList2.DataValueField = "stationId";
        DropDownList4.DataSource = ds.Tables[0].DefaultView;
        DropDownList4.DataBind();
        DropDownList5.DataTextField = "sensorName";
        //  DropDownList2.DataValueField = "stationId";
        DropDownList5.DataSource = ds.Tables[0].DefaultView;
        DropDownList5.DataBind();
        DropDownList6.DataTextField = "sensorName";
        //  DropDownList2.DataValueField = "stationId";
        DropDownList6.DataSource = ds.Tables[0].DefaultView;
        DropDownList6.DataBind();
        DropDownList7.DataTextField = "sensorName";
        //  DropDownList2.DataValueField = "stationId";
        DropDownList7.DataSource = ds.Tables[0].DefaultView;
        DropDownList7.DataBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SqlCommand cmd = new SqlCommand("Select distinct boarding_point from Trip", con);

                con.Open();

                DropDownList7.DataSource     = cmd.ExecuteReader();
                DropDownList7.DataTextField  = "boarding_point";
                DropDownList7.DataValueField = "boarding_point";
                DropDownList7.DataBind();

                con.Close();
            }

            if (!IsPostBack)
            {
                SqlCommand cmd = new SqlCommand("Select distinct arrival_point from Trip", con);

                con.Open();

                DropDownList8.DataSource     = cmd.ExecuteReader();
                DropDownList8.DataTextField  = "arrival_point";
                DropDownList8.DataValueField = "arrival_point";
                DropDownList8.DataBind();

                con.Close();
            }
        }
예제 #6
0
 protected void insertcountry_Click(object sender, EventArgs e)
 {
     if (TextBox2.Text != "")
     {
         int t = controllerObj.insertcountry(TextBox2.Text);
         if (t == 0)
         {
             Label2.Text = "this country is already exist .";
         }
         else
         {
             Label2.Text = "this country inserts corectly .";
         }
         DropDownList7.DataBind();
         DropDownList6.DataBind();
         DropDownList5.DataBind();
         DropDownList4.DataBind();
         DropDownList3.DataBind();
         DropDownList2.DataBind();
         DropDownList11.DataBind();
         DropDownList12.DataBind();
         DropDownList13.DataBind();
     }
     else
     {
         Label2.Text = "You enter missing data !!.";
     }
 }
 protected void Button3_Click(object sender, EventArgs e)
 {
     Katastasi_Emvast_Old.Insert();
     DropDownList7.ClearSelection();
     Katastasi_Emvasmaton_dates.DataBind();
     DropDownList7.DataBind();
 }
예제 #8
0
        private void BindDropDown6()
        {
            try
            {
                using (OracleConnection sqlConn = new OracleConnection(strConn))
                {
                    using (OracleCommand sqlCmd = new OracleCommand())
                    {
                        sqlCmd.CommandText = "select * from TB_POSITION_WORK";
                        sqlCmd.Connection  = sqlConn;
                        sqlConn.Open();
                        OracleDataAdapter da = new OracleDataAdapter(sqlCmd);
                        DataTable         dt = new DataTable();
                        da.Fill(dt);
                        DropDownList7.DataSource     = dt;
                        DropDownList7.DataValueField = "POSITION_WORK_ID";
                        DropDownList7.DataTextField  = "POSITION_WORK_NAME";
                        DropDownList7.DataBind();

                        DropDownList8.DataSource     = dt;
                        DropDownList8.DataValueField = "POSITION_WORK_ID";
                        DropDownList8.DataTextField  = "POSITION_WORK_NAME";
                        DropDownList8.DataBind();

                        sqlConn.Close();

                        DropDownList7.Items.Insert(0, new ListItem("-- กรุณาเลือก --", "0"));
                        DropDownList8.Items.Insert(0, new ListItem("-- กรุณาเลือก --", "0"));
                    }
                }
            }
            catch { }
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            //        SqlDataSource1.Insert();
            DropDownList7.ClearSelection();

            DropDownList7.DataBind();
        }
예제 #10
0
        protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string DBHost     = "127.0.0.1";
                string DBName     = "bibledb";
                string DBUserName = "******";
                string DBPassword = "******";

                string Conn_String = "server=" + DBHost + ";uid=" + DBUserName + ";password="******";database=" + DBName + ";";


                MySqlConnection Conn = new MySqlConnection(Conn_String);
                Conn.Open();

                x = DropDownList5.SelectedValue.ToString();

                y = DropDownList6.SelectedValue.ToString();
                MySqlCommand cmd;
                cmd             = new MySqlCommand("select distinct versenum from bibledb.nivdb where book='" + x + "'and chapternum='" + y + "'", Conn);
                cmd.CommandType = CommandType.Text;
                Label1.Text     = Label1.Text + ":" + y;
                MySqlDataReader ddlValues;
                ddlValues = cmd.ExecuteReader();

                DropDownList7.DataSource    = ddlValues;
                DropDownList7.DataTextField = "versenum";
                //  DropDownList1.DataValueField = "id";
                DropDownList7.DataBind();
                Conn.Close();
            }
            catch (Exception ex) { }
        }
예제 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lanrepo  = new LanguageRepository();
                qualrepo = new QualityRepository();
                genrepo  = new GenreRepository();

                List <LanguageTable> lan  = lanrepo.GetAllLanguages();
                List <GenreTable>    gen  = genrepo.GetAllGenres();
                List <QualityTable>  qual = qualrepo.GetAllQualities();

                DropDownList6.DataSource     = lan;
                DropDownList6.DataTextField  = "LanguageName";
                DropDownList6.DataValueField = "LanguageID";
                DropDownList6.DataBind();

                DropDownList7.DataSource     = qual;
                DropDownList7.DataTextField  = "QualityName";
                DropDownList7.DataValueField = "QualityID";
                DropDownList7.DataBind();

                DropDownList8.DataSource     = gen;
                DropDownList8.DataTextField  = "GenreName";
                DropDownList8.DataValueField = "GenreID";
                DropDownList8.DataBind();
            }
        }
        private void BindAreaDP()
        {
            List <RSSMWeb.Code.Utils.CustomClass> mylist = Utils.GetUserList();

            RSSMWeb.Code.Utils.CustomClass tmp = new RSSMWeb.Code.Utils.CustomClass("0", "无", "0");
            List <RSSMWeb.Code.Utils.CustomClassForDropdownlist> mylist_username_dpt = Utils.GetUserListForDropdownlist_dpt();

            mylist.Insert(0, tmp);

            DropDownList7.EnableSimulateTree         = true;
            DropDownList7.DataTextField              = "Name";
            DropDownList7.DataValueField             = "ID";
            DropDownList7.DataSource                 = mylist;
            DropDownList7.DataSimulateTreeLevelField = "Group";
            DropDownList7.DataEnableSelectField      = "Enableselect";
            DropDownList7.DataSource                 = mylist_username_dpt;
            DropDownList7.DataBind();
            DropDownList7.SelectedValue = "0";

            DropDownList6.EnableSimulateTree         = true;
            DropDownList6.DataTextField              = "Name";
            DropDownList6.DataValueField             = "ID";
            DropDownList6.DataSimulateTreeLevelField = "Group";
            DropDownList6.DataEnableSelectField      = "Enableselect";

            DropDownList6.DataSource = mylist_username_dpt;
            DropDownList6.DataBind();
            DropDownList6.SelectedValue = "0";
        }
예제 #13
0
        protected void Button14_Click(object sender, EventArgs e)
        {
            int dt = controllerObj.DeleteHOTEL(DropDownList6.Text.ToString());

            DropDownList6.DataBind();
            DropDownList7.DataBind();
            DropDownList8.DataBind();
        }
 public void drop7()
 {
     ds.Clear();
     ds = db.discont("select sub_main_role from tb_Sub_main_role where role='" + DropDownList6.Text + "'");
     DropDownList7.DataSource    = ds;
     DropDownList7.DataTextField = "sub_main_role";
     DropDownList7.DataBind();
     DropDownList7.Items.Insert(0, "Select sub_main_role............");
 }
예제 #15
0
        private void dataProject()
        {
            DataTable dt = TaskSystem.tools.GetData("SELECT [id], [project] FROM [project] ORDER BY [id]");

            DropDownList1.DataTextField  = "project";
            DropDownList1.DataValueField = "id";
            DropDownList1.DataSource     = dt;
            DropDownList1.DataBind();

            DataTable dt2 = TaskSystem.tools.GetData("SELECT [id], [username] FROM [users] ORDER BY [id]");

            DropDownList7.DataTextField  = "username";
            DropDownList7.DataValueField = "id";
            DropDownList7.DataSource     = dt2;
            DropDownList7.DataBind();

            DataTable dt3 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [type] ORDER BY [id]");

            DropDownList2.DataTextField  = "name";
            DropDownList2.DataValueField = "id";
            DropDownList2.DataSource     = dt3;
            DropDownList2.DataBind();

            DataTable dt4 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [priority] ORDER BY [id]");

            DropDownList3.DataTextField  = "name";
            DropDownList3.DataValueField = "id";
            DropDownList3.DataSource     = dt4;
            DropDownList3.DataBind();

            DataTable dt5 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [sprint] WHERE status='open' OR sprint.status='active' ORDER BY [id]");

            DropDownList4.DataTextField  = "name";
            DropDownList4.DataValueField = "id";
            DropDownList4.DataSource     = dt5;
            DropDownList4.DataBind();

            DataTable dt6 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='released' ORDER BY [id]");

            DropDownList5.Items.Clear();
            DropDownList5.DataTextField  = "version";
            DropDownList5.DataValueField = "id";
            DropDownList5.DataSource     = dt6;
            DropDownList5.DataBind();
            DropDownList5.Items.Insert(0, new ListItem("", ""));

            DataTable dt7 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='open' ORDER BY [id]");

            DropDownList6.Items.Clear();
            DropDownList6.DataTextField  = "version";
            DropDownList6.DataValueField = "id";
            DropDownList6.DataSource     = dt7;
            DropDownList6.DataBind();
            DropDownList6.Items.Insert(0, new ListItem("", ""));
        }
예제 #16
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int ID_class = Convert.ToInt32(e.CommandArgument);

            ID_class = ID_class % GridView1.PageSize;
            string database = Session["DatabaseName"].ToString();

            if (e.CommandName == "Select")
            {
                Pnl_SC.Visible = true;
                int UID = (int)GridView1.DataKeys[ID_class].Value;

                Label SBID             = (Label)GridView1.Rows[ID_class].FindControl("SBID");
                Label SB_MID           = (Label)GridView1.Rows[ID_class].FindControl("SB_MID");
                Label SB_Code          = (Label)GridView1.Rows[ID_class].FindControl("SB_Code");
                Label SB_Name          = (Label)GridView1.Rows[ID_class].FindControl("SB_Name");
                Label BookInTime       = (Label)GridView1.Rows[ID_class].FindControl("BookInTime");
                Label BookContractDate = (Label)GridView1.Rows[ID_class].FindControl("BookContractDate");
                Label LastContractDate = (Label)GridView1.Rows[ID_class].FindControl("LastContractDate");
                Label BudgetPrice      = (Label)GridView1.Rows[ID_class].FindControl("BudgetPrice");
                Label ContractWay      = (Label)GridView1.Rows[ID_class].FindControl("ContractWay");
                Label LbWorkManDep     = (Label)GridView1.Rows[ID_class].FindControl("LbWorkManDep");
                Label LbWorkManName    = (Label)GridView1.Rows[ID_class].FindControl("LbWorkManName");
                Label LbBudgetPrice1   = (Label)GridView1.Rows[ID_class].FindControl("LbBudgetPrice1");


                RadioButtonList1.SelectedValue = ContractWay.Text;
                TxSubNum.Text      = SB_Code.Text;
                TxSubItemName.Text = SB_Name.Text;
                LbSBID.Text        = SBID.Text;
                //DropDownList7.DataSourceID = "SqlDataSource5";
                //DropDownList7.DataBind();
                DropDownList7.DataBind();
                DropDownList7.SelectedValue = LbWorkManDep.Text;
                //DropDownList8.AutoPostBack = true;
                DropDownList8.DataSourceID = "SqlDataSource6";
                DropDownList8.DataBind();



                TxBookInTime.Text            = BookInTime.Text;
                TxBookContractDate.Text      = BookContractDate.Text;
                TxLastContractDate.Text      = LastContractDate.Text;
                LbBudgetPrice.Text           = LbBudgetPrice1.Text != ""?decimal.Parse(LbBudgetPrice1.Text).ToString("N0"):"";
                DropDownList8.SelectedValue  = LbWorkManName.Text.Trim();
                SqlDataSource2.SelectCommand = "Select * From SubBudget_Item Where SBID=" + SBID.Text + " And DelTemp=0";
                ViewState["SqlDataSource2"]  = SqlDataSource2.SelectCommand;

                DataTable Dtvs = WebModel.LoadSetContentData(database, SqlDataSource2.SelectCommand);
                Dtvs.Columns.Add("BKID");
                ViewState["Dtvs"]    = Dtvs;
                Repeater1.DataSource = Dtvs;
                Repeater1.DataBind();
            }
        }
 protected void Button11_Click(object sender, EventArgs e)
 {
     Dnsi.Insert();
     Dnsi.DataBind();
     DropDownList3.DataBind();
     DropDownList4.DataBind();
     DropDownList5.DataBind();
     DropDownList6.DataBind();
     DropDownList7.DataBind();
     DropDownList8.DataBind();
     TextBox4.Text = "";
 }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MultiView1.SetActiveView(View2);
            SqlCommand cmd = new SqlCommand();


            cmd.CommandText              = "select * from auditorium ";
            DropDownList7.DataSource     = a.getdata(cmd);
            DropDownList7.DataTextField  = "aname";
            DropDownList7.DataValueField = "aid";
            DropDownList7.DataBind();
            DropDownList7.Items.Insert(0, "--select--");
            for (int i = 1; i <= 31; i++)
            {
                DropDownList1.Items.Add(i.ToString());
            }
            DropDownList1.Items.Insert(0, "Day");
            for (int i = 1; i <= 12; i++)
            {
                DropDownList2.Items.Add(i.ToString());
            }
            DropDownList2.Items.Insert(0, "Month");

            for (int i = 2018; i <= 2050; i++)
            {
                DropDownList3.Items.Add(i.ToString());
            }
            DropDownList3.Items.Insert(0, "Year");
            for (int i = 1; i <= 31; i++)
            {
                DropDownList4.Items.Add(i.ToString());
            }
            DropDownList4.Items.Insert(0, "Day");
            for (int i = 1; i <= 12; i++)
            {
                DropDownList5.Items.Add(i.ToString());
            }
            DropDownList5.Items.Insert(0, "Month");
            for (int i = 2018; i <= 2050; i++)
            {
                DropDownList6.Items.Add(i.ToString());
            }
            DropDownList6.Items.Insert(0, "Year");


            cmd.CommandText      = "select * from bookingreg where uid=" + Session["id"] + " and status='pending'";
            DataGrid2.DataSource = a.getdata(cmd);
            DataGrid2.DataBind();
        }
    }
예제 #19
0
 protected void delcity_Click(object sender, EventArgs e)
 {
     controllerObj.deletecity(Convert.ToInt32(DropDownList12.SelectedValue));
     DropDownList7.DataBind();
     DropDownList6.DataBind();
     DropDownList5.DataBind();
     DropDownList4.DataBind();
     DropDownList3.DataBind();
     DropDownList2.DataBind();
     DropDownList11.DataBind();
     DropDownList12.DataBind();
     DropDownList13.DataBind();
 }
예제 #20
0
        protected void Button9_Click(object sender, EventArgs e)
        {
            string        connectionString = @"Server=Localhost;Database=Consultorio;Trusted_Connection=true";
            SqlConnection conexao2         = new SqlConnection(connectionString);

            conexao2.Open();

            SqlCommand acha = new SqlCommand("select distinct DtConsulta,Dia_Consulta from Paciente_Clinica_Ilha where hora ='" + DropDownList2.Text + "' ", conexao2);

            DropDownList7.DataTextField  = "Dia_Consulta";
            DropDownList7.DataValueField = "Dia_Consulta";
            DropDownList7.DataSource     = acha.ExecuteReader();
            DropDownList7.DataBind();
        }
    private void batch()
    {
        SqlCommand cmd = new SqlCommand("prc_dispbatch", con);

        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataReader rd = cmd.ExecuteReader();

        DropDownList7.DataTextField  = "batch";
        DropDownList7.DataValueField = "batchid";
        DropDownList7.DataSource     = rd;
        DropDownList7.DataBind();
        rd.Close();
        cmd.Dispose();
    }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "";
            if (!Page.IsPostBack)
            {
                DropDownList3.DataValueField = "Brn_No";
                DropDownList3.DataTextField  = "Brn_NmAr";
                DropDownList3.DataSource     = db.MainBranch.ToList();
                DropDownList3.DataBind();

                DropDownList4.DataValueField = "ACC_No";
                DropDownList4.DataTextField  = "Acc_NmAr";
                DropDownList4.DataSource     = db.GLAstbank.ToList();
                DropDownList4.DataBind();

                DropDownList5.DataValueField = "Sup_No";
                DropDownList5.DataTextField  = "Sup_NmAr";
                DropDownList5.DataSource     = db.MtsSuplir.ToList();
                DropDownList5.DataBind();

                DropDownList6.DataValueField = "Cntry_No";
                DropDownList6.DataTextField  = "Cntry_NmAr";
                DropDownList6.DataSource     = db.InvAstCntry.ToList();
                DropDownList6.DataBind();


                DropDownList7.DataValueField = "Pym_No";
                DropDownList7.DataTextField  = "Pym_Nmar";
                DropDownList7.DataSource     = db.LcPymwys.ToList();
                DropDownList7.DataBind();



                DropDownList1.DataValueField = "Curncy_No";
                DropDownList1.DataTextField  = "Curncy_Nmar";
                DropDownList1.DataSource     = db.InvAstCurncy.ToList();
                DropDownList1.DataBind();


                DropDownList2.DataValueField = "Curncy_No";
                DropDownList2.DataTextField  = "Curncy_Nmar";
                DropDownList2.DataSource     = db.InvAstCurncy.ToList();
                DropDownList2.DataBind();


                TextBox1.Enabled = false;
                TextBox1.Text    = (db.MtsLC.Max(o => o.Doc_No) + 1).ToString();
            }
        }
예제 #23
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.ToString().Trim() == "" || TextBox7.Text.ToString().Trim() == "" || TextBox8.Text.ToString().Trim() == "")
     {
         Label75.Text = "Please Enter all the values ,it's required.";
     }
     else
     {
         int dt = controllerObj.InsertHotel(TextBox1.Text.ToString(), Convert.ToChar(DropDownList2.Text.ToString()), TextBox7.Text.ToString(), DropDownList1.Text.ToString(), Session["Email"].ToString(), TextBox8.Text.ToString());
         Label75.Text = "";
     }
     DropDownList6.DataBind();
     DropDownList7.DataBind();
     DropDownList8.DataBind();
 }
예제 #24
0
        protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList7.Items.Clear();
            int ch        = Convert.ToInt32(DropDownList6.SelectedValue);
            var stateid   = from Tbl_chapter in db.Tbl_chapter where Tbl_chapter.Subject_ID.Equals(ch) select new { Tbl_chapter.Name_Ar, Tbl_chapter.Chapter_ID };
            var statename = stateid.ToList();

            if (statename.Count > 0)
            {
                DropDownList7.DataValueField = "Chapter_ID";
                DropDownList7.DataTextField  = "Name_Ar";
                DropDownList7.DataSource     = statename;
                DropDownList7.DataBind();
                DropDownList7.Items.Insert(0, "--- أختر الفصل ----");
            }
        }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session["UserName"] == null) || (Session["CompanyName"] == null))
            {
                Response.Redirect("Login.aspx");
            }
            else if (Session["ProjectCode"] == null || Session["ProjectCode"] == "")
            {
                Response.Write("<script>alert('尚未選擇專案或是您的權限不足');location.href='Main.aspx';</script>");
            }
            else
            {
                SqlDataSource1.SelectCommand = "SELECT SBID, PID, SB_Code, SB_Name, BookInTime, BookContractDate, LastContractDate, ContractWay, WorkManDep, WorkManName, BudgetPrice, BudgetLockNY, SC_Code FROM SubBudgetList WHERE PID = " + Session["ProjectCode"].ToString();//And ExecuteNY=1
            }

            string database = Session["DatabaseName"].ToString();

            SqlDataSource1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            SqlDataSource2.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());

            SqlDataSource5.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            SqlDataSource6.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());


            if (!IsPostBack)
            {
                DropDownList7.DataSourceID = "SqlDataSource5";
                DropDownList7.DataBind();
                DropDownList8.DataSourceID = "SqlDataSource6";
                DropDownList8.DataBind();
                //DropDownList8.AutoPostBack = true;

                string SQLETotal = "select SUM(ETotal) as total from EBUDGET where Pid=" + Session["ProjectCode"].ToString();
                if (WebModel.SItemName(database, SQLETotal, "total") != "")
                {
                    LbExeTatal.Text = decimal.Parse(WebModel.SItemName(database, SQLETotal, "total")).ToString("N0");
                    //string SQLItemAmount = "select SUM(ItemAmount) as total from EBudget_ResourceBK where Pid=" + Session["ProjectCode"].ToString();
                    string SQLSubTotal = "select SUM(LastAmount) as total from EBudget_ResourceBK where Pid=" + Session["ProjectCode"].ToString();

                    LbSubTotal.Text = decimal.Parse(WebModel.SItemName(database, SQLSubTotal, "total")).ToString("N0");
                }
                ViewState["Dtvs"] = "";
                Session["Dtvs1"]  = "";
                flag = false;
            }
        }
    protected void loadDropDownList7()
    {
        if (DropDownList1.Text.Equals("--select--"))
        {
            category = "Clip";
        }
        else
        {
            category = DropDownList1.Text;
        }
        List <Item> ilist = eM.PopulateCatDropDownList(category);

        DropDownList7.DataSource     = ilist;
        DropDownList7.DataValueField = "itemcode";
        DropDownList7.DataTextField  = "itemdescription";
        DropDownList7.DataBind();
    }
 protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
 {
     MultiView2.ActiveViewIndex = 1;
     MultiView1.Visible         = false;
     DropDownList3.Enabled      = false;
     DropDownList1.Enabled      = true;
     DropDownList2.Enabled      = true;
     DropDownList10.Enabled     = true;
     DropDownList3.ClearSelection();
     DropDownList7.ClearSelection();
     GridView1.Visible = false;
     GridView2.Visible = false;
     GridView3.Visible = false;
     DropDownList7.ClearSelection();
     myCal.SelectedDates.Clear();
     Button10.Visible = true;
 }
예제 #28
0
    private void show_employee()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
        SqlCommand    cmd = new SqlCommand("Select * from representative where Com_Id='" + company_id + "' ORDER BY rep_id asc", con);

        con.Open();
        DataSet        ds = new DataSet();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(ds);

        DropDownList7.DataSource     = ds;
        DropDownList7.DataTextField  = "rep_name";
        DropDownList7.DataValueField = "rep_id";
        DropDownList7.DataBind();
        DropDownList7.Items.Insert(0, new ListItem("Select Representative", "0"));
        con.Close();
    }
예제 #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     empno = Convert.ToInt32(Request.QueryString["Empno"].ToString());
     if (!IsPostBack)
     {
         string         Q    = "Select * from mstrCategory";
         SqlCommand     com  = new SqlCommand(Q, dbcls.CONN());
         SqlDataAdapter adpt = new SqlDataAdapter(com);
         DataTable      dt   = new DataTable();
         adpt.Fill(dt);
         TextBox38.DataSource = dt;
         TextBox38.DataBind();
         TextBox38.DataTextField  = "category";
         TextBox38.DataValueField = "cid";
         TextBox38.DataBind();
         DropDownList7.DataSource = dt;
         DropDownList7.DataBind();
         DropDownList7.DataTextField  = "category";
         DropDownList7.DataValueField = "cid";
         DropDownList7.DataBind();
         DropDownList9.DataSource = dt;
         DropDownList9.DataBind();
         DropDownList9.DataTextField  = "category";
         DropDownList9.DataValueField = "cid";
         DropDownList9.DataBind();
         DropDownList11.DataSource = dt;
         DropDownList11.DataBind();
         DropDownList11.DataTextField  = "category";
         DropDownList11.DataValueField = "cid";
         DropDownList11.DataBind();
         DropDownList13.DataSource = dt;
         DropDownList13.DataBind();
         DropDownList13.DataTextField  = "category";
         DropDownList13.DataValueField = "cid";
         DropDownList13.DataBind();
         DropDownList15.DataSource = dt;
         DropDownList15.DataBind();
         DropDownList15.DataTextField  = "category";
         DropDownList15.DataValueField = "cid";
         DropDownList15.DataBind();
         BindTextBoxvalues();
     }
 }
예제 #30
0
        private void dataProject()
        {
            DataTable dt = TaskSystem.tools.GetData("SELECT [id], [project] FROM [project] ORDER BY [id]");

            DropDownList1.Items.Clear();
            DropDownList1.DataTextField  = "project";
            DropDownList1.DataValueField = "id";
            DropDownList1.DataSource     = dt;
            DropDownList1.DataBind();


            DataTable dt2 = TaskSystem.tools.GetData("SELECT [id], [username] FROM [users] ORDER BY [id]");

            DropDownList7.Items.Clear();
            DropDownList7.DataTextField  = "username";
            DropDownList7.DataValueField = "id";
            DropDownList7.DataSource     = dt2;
            DropDownList7.DataBind();

            DataTable dt3 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [type] ORDER BY [id]");

            DropDownList2.Items.Clear();
            DropDownList2.DataTextField  = "name";
            DropDownList2.DataValueField = "id";
            DropDownList2.DataSource     = dt3;
            DropDownList2.DataBind();

            DataTable dt4 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [priority] ORDER BY [id]");

            DropDownList3.Items.Clear();
            DropDownList3.DataTextField  = "name";
            DropDownList3.DataValueField = "id";
            DropDownList3.DataSource     = dt4;
            DropDownList3.DataBind();

            DataTable dt5 = TaskSystem.tools.GetData("SELECT distinct(sprint.id), sprint.name FROM [sprint], issue  WHERE (sprint.id=issue.sprint_id OR sprint.status='open' OR sprint.status='active') AND issue.id='" + hfCount.Value + "' ORDER BY sprint.id");

            DropDownList4.Items.Clear();
            DropDownList4.DataTextField  = "name";
            DropDownList4.DataValueField = "id";
            DropDownList4.DataSource     = dt5;
            DropDownList4.DataBind();
        }