예제 #1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        SqlConnection scn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        scn.Open();
        SqlCommand scm = new SqlCommand("standardamount", scn);

        scm.CommandType = CommandType.StoredProcedure;
        SqlParameter param = null;

        param           = scm.Parameters.Add(new SqlParameter("@buildingid", SqlDbType.Int));
        param.Direction = ParameterDirection.Input;
        param.Value     = DropDownList1.Text;

        param           = scm.Parameters.Add(new SqlParameter("@dormitoryid", SqlDbType.Int));
        param.Direction = ParameterDirection.Input;
        param.Value     = DropDownList2.Text;

        SqlDataAdapter sda = new SqlDataAdapter(scm);
        DataSet        ds  = new DataSet();

        sda.Fill(ds);
        DropDownList8.DataSource = ds;
        DropDownList8.DataBind();
    }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "";
            if (!Page.IsPostBack)
            {
                DropDownList1.DataValueField = "Cmp_No";
                DropDownList1.DataTextField  = "Cmp_Nm";
                DropDownList1.DataSource     = db.MainCmpnam.ToList();
                DropDownList1.DataBind();
                int no = int.Parse(DropDownList1.SelectedValue);

                DropDownList8.DataTextField  = "Name_Arb";
                DropDownList8.DataValueField = "Actvty_No";
                DropDownList8.DataSource     = db.ActivityTypes.Where(o => o.cmp_no == no).ToList();
                DropDownList8.DataBind();
                ViewState["id"]  = 0;
                TextBox1.Enabled = false;
                if (db.MtsEmpcntrct.Count() == 0)
                {
                    TextBox1.Text = (1).ToString();
                }
                else
                {
                    TextBox1.Text = (db.MtsEmpcntrct.Max(o => o.Emp_No) + 1).ToString();
                }
            }
        }
        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();
            }
        }
예제 #4
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 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();
    }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                s = Convert.ToInt32(Session["ID"].ToString());
                SqlConnection  cnn  = new SqlConnection(WebConfigurationManager.ConnectionStrings["constr"].ConnectionString);
                DataTable      dt1  = new DataTable();
                String         com  = "select advertisement.id,'Description: '+[Description]+'  Location: '+[location] as 'Info' from advertisement where viewer_id=" + s + ";";
                SqlDataAdapter adpt = new SqlDataAdapter(com, cnn);
                adpt = new SqlDataAdapter(com, cnn);
                dt1  = new DataTable();
                adpt.Fill(dt1);
                DropDownList8.DataSource     = dt1;
                DropDownList8.DataTextField  = "Info";
                DropDownList8.DataValueField = "id";
                DropDownList8.DataBind();
                DropDownList8.Items.Insert(0, new ListItem("", ""));
                cnn.Open();
                SqlCommand cmd = new SqlCommand("select description,[location] from advertisement where id=@id", cnn);
                cmd.Parameters.AddWithValue("@id", DropDownList8.SelectedValue);
                SqlDataReader dataReader = cmd.ExecuteReader();

                while (dataReader.Read())
                {
                    TextBox7.Text = dataReader.GetValue(0).ToString();
                    TextBox8.Text = dataReader.GetValue(1).ToString();
                }
                cnn.Close();
            }
        }
예제 #7
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();
            }
        }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.Label10.Visible = false;
            this.Label11.Visible = false;
            string  drbj         = DropDownList1.SelectedValue.ToString();
            string  sqlallMember = "select * from Bill_Information join Member_Information on Bill_Information.PatientID=Member_Information.MemberID";
            DataSet ds           = new DataSet();
            ds = dataOperate.getDataset(sqlallMember, "Bill_Information");
            if (ds.Tables["Bill_Information"].Rows.Count > 0)
            {
                DataRowView rowview = ds.Tables["Bill_Information"].DefaultView[0];
                this.Label11.Text    = "all";
                this.Label10.Visible = true;
                this.Label11.Visible = true;
                ds.Clear();
            }

            DropDownList1.Visible = true;
            string a1 = DropDownList6.SelectedValue;


            string  sql3 = "select distinct(" + a1 + "ID) from Bill_Information";
            DataSet ds3  = new DataSet();
            ds3 = dataOperate.getDataset(sql3, "Bill_Information");
            DataView rowview3 = ds3.Tables["Bill_Information"].DefaultView;
            DropDownList1.DataSource     = rowview3;
            DropDownList1.DataValueField = "" + a1 + "ID";
            DropDownList1.DataBind();


            string  sql = "select distinct(PatientID) from Record_Information";
            DataSet ds1 = new DataSet();
            ds1 = dataOperate.getDataset(sql, "Record_Information");
            DataView rowview1 = ds1.Tables["Record_Information"].DefaultView;
            DropDownList8.DataSource     = rowview1;
            DropDownList8.DataValueField = "PatientID";
            DropDownList8.DataBind();

            DropDownList9.Visible = true;
            string a = DropDownList8.SelectedValue;

            string  sql2 = "select RecordID from Record_Information where PatientID='" + a + "'";
            DataSet ds2  = new DataSet();
            ds2 = dataOperate.getDataset(sql2, "Record_Information");
            DataView rowview2 = ds2.Tables["Record_Information"].DefaultView;
            DropDownList9.DataSource     = rowview2;
            DropDownList9.DataValueField = "RecordID";
            DropDownList9.DataBind();

            this.GridView1.Visible    = true;
            this.GridView1.DataSource = dataOperate.getDataset(sqlallMember, "Bill_Information");
            this.GridView1.DataBind();
            Session["search"]     = sqlallMember;
            Session["Department"] = "";
            Session["ID"]         = "";
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "";
            if (!Page.IsPostBack)
            {
                DropDownList1.DataValueField = "Cmp_No";
                DropDownList1.DataTextField  = "Cmp_Nm";
                DropDownList1.DataSource     = db.MainCmpnam.ToList();
                DropDownList1.DataBind();
                int no = int.Parse(DropDownList1.SelectedValue);

                DropDownList8.DataTextField  = "Name_Arb";
                DropDownList8.DataValueField = "Actvty_No";
                DropDownList8.DataSource     = db.ActivityTypes.Where(o => o.cmp_no == no).ToList();
                DropDownList8.DataBind();
                ViewState["id"] = 0;
                DropDownList3.DataValueField = "Dpm_No";
                DropDownList3.DataTextField  = "Dpm_Nm";
                DropDownList3.DataSource     = db.AstDprtmnt.ToList();
                DropDownList3.DataBind();



                DropDownList4.DataValueField = "Pymnt_No";
                DropDownList4.DataTextField  = "Pymnt_NmAr";
                DropDownList4.DataSource     = db.HrAstPymntype.ToList();
                DropDownList4.DataBind();

                var id = int.Parse(Request.QueryString["no"]);
                var cn = db.MtsEmpcntrct.Find(id);

                TextBox1.Text = cn.Emp_No.ToString();
                TextBox2.Text = cn.Emp_NmAr;
                TextBox3.Text = cn.Emp_NmEn;
                TextBox4.Text = cn.Cnt_Stdt;
                TextBox5.Text = cn.Cnt_Endt;
                TextBox6.Text = cn.Cnt_Nwdt;
                DropDownList1.SelectedValue = cn.salry_typ.ToString();
                DropDownList3.SelectedValue = cn.Depm_No.ToString();
                TextBox7.Text = cn.Bsc_Salary.ToString();
                DropDownList4.SelectedValue = cn.Pymnt_No.ToString();
                TextBox8.Text  = cn.Trnsp_Alw.ToString();
                TextBox9.Text  = cn.Wrk_Hour.ToString();
                TextBox10.Text = cn.Bnk_No.ToString();
                TextBox11.Text = cn.Hous_Alw.ToString();
                TextBox12.Text = cn.Wrk_CostHour.ToString();
                TextBox13.Text = cn.Food_Alw.ToString();
                TextBox14.Text = cn.Emp_Acntno;
                TextBox15.Text = cn.Other_Alw.ToString();
                TextBox16.Text = cn.Tkt_Class;
                TextBox17.Text = cn.Bnk_Brn;
                TextBox22.Text = cn.Shift_Type.ToString();
                TextBox18.Text = cn.Tkt_No.ToString();
                TextBox19.Text = cn.Fbal_Db.ToString();

                TextBox20.Text = cn.Fbal_CR.ToString();
                TextBox21.Text = cn.Acc_NoDb1.ToString();
            }
        }
예제 #10
0
        protected void Button14_Click(object sender, EventArgs e)
        {
            int dt = controllerObj.DeleteHOTEL(DropDownList6.Text.ToString());

            DropDownList6.DataBind();
            DropDownList7.DataBind();
            DropDownList8.DataBind();
        }
 public void drop8()
 {
     ds.Clear();
     ds = db.discont("select role from tb_role ");
     DropDownList8.DataSource    = ds;
     DropDownList8.DataTextField = "role";
     DropDownList8.DataBind();
     DropDownList8.Items.Insert(0, "Select Role............");
 }
예제 #12
0
    //绑定gridview里面的下拉框库房区域
    protected void BindDropdownlist8()
    {
        Guid id = new Guid(label7.Text.ToString());

        DropDownList8.DataSource     = db.Select_Area(id);
        DropDownList8.DataTextField  = "IMSA_AreaName";
        DropDownList8.DataValueField = "IMSA_AreaID";
        DropDownList8.DataBind();
    }
예제 #13
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 = "";
 }
예제 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ArrayList arlist_temp1 = new ArrayList();


            txtEstimateStartDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-2 / 24).ToString("yyyy/MM/dd"));
            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            DropDownList5.DataSource = arlist_temp1;
            DropDownList5.DataBind();
            DropDownList5.Text = DateTime.Now.AddHours(-6).ToString("HH");


            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");

            DropDownList8.DataSource = arlist_temp1;
            DropDownList8.DataBind();
            DropDownList8.Text = "30";



            txtEstimateEndDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-2 / 24).ToString("yyyy/MM/dd"));
            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            DropDownList15.DataSource = arlist_temp1;
            DropDownList15.DataBind();
            DropDownList15.Text = DateTime.Now.AddHours(-1).ToString("HH");


            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");

            DropDownList18.DataSource = arlist_temp1;
            DropDownList18.DataBind();
            DropDownList18.Text = "29";



            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\class.txt");

            DropDownList1.DataSource = arlist_temp1;
            DropDownList1.DataBind();
            //DropDownList1.Items.Insert(0, "請選擇");



            bind_data();
        }
    }
예제 #16
0
        protected void Button7_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_Tijuca where hora ='" + DropDownList2.Text + "' ", conexao2);

            DropDownList8.DataTextField  = "Dia_Consulta";
            DropDownList8.DataValueField = "Dia_Consulta";
            DropDownList8.DataSource     = acha.ExecuteReader();
            DropDownList8.DataBind();
        }
    private void subject()
    {
        SqlCommand cmd = new SqlCommand("prc_dispsubject", con);

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

        DropDownList8.DataTextField  = "Subject";
        DropDownList8.DataValueField = "subjectid";
        DropDownList8.DataSource     = rd;
        DropDownList8.DataBind();
        rd.Close();
        cmd.Dispose();
    }
예제 #18
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();
 }
예제 #19
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;
            }
        }
예제 #20
0
    public void city()
    {
        con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Pratik\\Desktop\\Jobadda\\App_Data\\JobportalDB.mdf;Integrated Security=True;User Instance=True");
        con.Open();

        SqlDataAdapter adp   = null;
        string         query = "select * from City where City.state_id=" + DropDownList7.SelectedValue;

        adp = new SqlDataAdapter(query, con);
        DataSet ds = new DataSet();

        adp.Fill(ds);
        DropDownList8.DataSource     = ds.Tables[0];
        DropDownList8.DataTextField  = "city_name";
        DropDownList8.DataValueField = "city_id";
        DropDownList8.DataBind();
        DropDownList8.Items.Insert(0, new ListItem("select", "0"));
        con.Close();
    }
예제 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TextBox5.Visible     = false;
                ImageButton4.Visible = false;
                Calendar1.Visible    = false;
                Calendar4.Visible    = false;
            }

            if (Page.PreviousPage != null)
            {
                var queryStrings = (Request.QueryString.ToString());
                var a            = queryStrings.Split('&');

                DropDownList7.ClearSelection();
                DropDownList8.ClearSelection();
            }
        }
예제 #22
0
    private void showCustomerType()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
        SqlCommand    cmd = new SqlCommand("Select * from Accountcustomer_type ORDER BY No asc", con);

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

        da.Fill(ds);


        DropDownList8.DataSource     = ds;
        DropDownList8.DataTextField  = "Accountcustomer_type";
        DropDownList8.DataValueField = "No";
        DropDownList8.DataBind();
        DropDownList8.Items.Insert(0, new ListItem("-- Choose Option --", "0"));

        con.Close();
    }
예제 #23
0
        protected void Button17_Click(object sender, EventArgs e)
        {
            string        queryString = "select * from New_Request";
            SqlConnection connection  = new SqlConnection(WebConfigurationManager.ConnectionStrings["constr"].ConnectionString);
            SqlCommand    command     = new SqlCommand(queryString, connection);

            connection.Open();
            DataTable      dt = new DataTable();
            SqlDataAdapter ad = new SqlDataAdapter(command);

            ad.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                DropDownList8.DataSource     = dt;
                DropDownList8.DataTextField  = "information";
                DropDownList8.DataValueField = "id";
                DropDownList8.DataBind();
            }
            connection.Close();
        }
예제 #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtEstimateStartDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(+0).ToString("yyyy/MM/dd"));
            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\hour.txt");

            DropDownList5.DataSource = arlist_temp1;
            DropDownList5.DataBind();
            DropDownList5.Text = DateTime.Now.ToString("HH");


            arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\min.txt");

            DropDownList8.DataSource = arlist_temp1;
            DropDownList8.DataBind();
            DropDownList8.Text = DateTime.Now.ToString("mm");
        }
    }
예제 #25
0
    private void showbillingcountry()
    {
        company_id = Convert.ToInt32(Session["company_id"].ToString());
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
        SqlCommand    cmd = new SqlCommand("Select * from Accoun_Country where com_id='" + company_id + "' ORDER BY No asc", con);

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

        da.Fill(ds);


        DropDownList8.DataSource     = ds;
        DropDownList8.DataTextField  = "Accoun_Country";
        DropDownList8.DataValueField = "No";
        DropDownList8.DataBind();
        DropDownList8.Items.Insert(0, new ListItem("-- Choose Option --", "0"));

        con.Close();
    }
예제 #26
0
    protected void  Button1_Click(object sender, EventArgs e)
    {
        string dt1 = DropDownList1 + "/" + DropDownList2 + "/" + DropDownList3;
        string dt2 = DropDownList4 + "/" + DropDownList5 + "/" + DropDownList6;

        cmd.CommandText = "insert into Hotel_tb values(" + TextBox1.Text + ",'" + Session["id"] + "','" + DropDownList10.Text + "','" + DropDownList11.Text + "',,'" + dt1 + "','" + dt2 + "','" + DropDownList7.Text + "','" + DropDownList8.Text + "','" + DropDownList9 + "','" + TextBox4.Text + "')";
        db.execute(cmd);
        Response.Write("<script>alert('Submitted')</script>");
        cmd.CommandText = "select max (ID) from Hotel_tb";
        TextBox1.Text   = db.max_id(cmd).ToString();

        TextBox4.Text = "";
        DropDownList1.ClearSelection();
        DropDownList2.ClearSelection();
        DropDownList3.ClearSelection();
        DropDownList4.ClearSelection();
        DropDownList5.ClearSelection();
        DropDownList6.ClearSelection();
        DropDownList7.ClearSelection();
        DropDownList8.ClearSelection();
        DropDownList9.ClearSelection();
    }
예제 #27
0
    private void BindDropDownList8()
    {
        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.免稅、9.不計稅

        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不計稅" });


        DropDownList8.DataSource     = dt;
        DropDownList8.DataTextField  = "Filed2";
        DropDownList8.DataValueField = "Filed1";
        DropDownList8.DataBind();
    }
예제 #28
0
    protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList1.Visible = true;
        DropDownList8.Visible = false;
        string a = DropDownList6.SelectedValue;

        if (a == "Patient")
        {
            a = "Member";
            DropDownList8.Visible = true;
            string  sql = "select * from Department_Information";
            DataSet ds  = new DataSet();
            ds = dataOperate.getDataset(sql, "Department_Information");
            DataView rowview = ds.Tables["Department_Information"].DefaultView;
            DropDownList8.DataSource     = rowview;
            DropDownList8.DataValueField = "DepartmentName";
            DropDownList8.DataBind();

            string  sql1 = "select distinct Visitation_Information.MemberID from Visitation_Information join Member_Information on Visitation_Information.MemberID=Member_Information.MemberID where MemberDepartment='" + DropDownList8.SelectedValue + "'";
            DataSet ds1  = new DataSet();
            ds1 = dataOperate.getDataset(sql1, "Visitation_Information");
            DataView rowview1 = ds1.Tables["Visitation_Information"].DefaultView;
            DropDownList1.DataSource     = rowview1;
            DropDownList1.DataValueField = "MemberID";
            DropDownList1.DataBind();
        }
        else
        {
            string  sql = "select distinct(" + a + "ID) from Bill_Information";
            DataSet ds  = new DataSet();
            ds = dataOperate.getDataset(sql, "Bill_Information");
            DataView rowview = ds.Tables["Bill_Information"].DefaultView;
            DropDownList1.DataSource     = rowview;
            DropDownList1.DataValueField = "" + a + "ID";
            DropDownList1.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection SQLConn = new SqlConnection("Data Source=FTP\\SQLEXPRESS;Initial Catalog=DhruvTest;User ID=sa;Password=pass$1234;pooling=false;pooling=false");

        bindgrid();

        if (Session["PsNo"] == null)
        {
            // Response.Redirect("test1.aspx?val=" + "done");
            Response.Redirect("Login.aspx");
        }
        else
        {
            String PsNo = Convert.ToString((int)Session["PsNo"]);
            txtno.Text = PsNo;
            if (txtno.Text != "")
            {
                SqlCommand sql = new SqlCommand("select * from admin where PsNo='" + txtno.Text + "'", SQLConn);
                sql.Parameters.AddWithValue("@psno", txtno.Text);
                SqlDataAdapter sda = new SqlDataAdapter(sql);
                DataTable      dt  = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    TextBox4.Text = dt.Rows[0]["Name"].ToString();
                    TextBox5.Text = dt.Rows[0]["Email"].ToString();
                }
            }
            if (txtno.Text != "")
            {
                SqlCommand sql = new SqlCommand("select * from employee where PsNo='" + txtno.Text + "'", SQLConn);
                sql.Parameters.AddWithValue("@psno", txtno.Text);
                SqlDataAdapter sld = new SqlDataAdapter(sql);
                DataTable      dt1 = new DataTable();
                sld.Fill(dt1);
                if (dt1.Rows.Count > 0)
                {
                    TextBox4.Text = dt1.Rows[0]["Name"].ToString();
                    TextBox5.Text = dt1.Rows[0]["Email"].ToString();
                }
            }


            DDLRM1.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList2.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList3.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList4.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList6.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList7.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList8.Items[0].Attributes.Add("disabled", "disabled");
            DropDownList9.Items[0].Attributes.Add("disabled", "disabled");
        }

        /*
         *      if (!Page.IsPostBack)
         *      {
         *          SqlConnection con = new SqlConnection("Data Source=FTP\\SQLEXPRESS;Initial Catalog=DhruvTest;User ID=sa;Password=pass$1234;pooling=false");
         *          SqlCommand cmd = new SqlCommand("select * from Master", con);
         *          SqlDataAdapter sda = new SqlDataAdapter(cmd);
         *          DataTable dt = new DataTable();
         *          sda.Fill(dt);
         *          DropDownList1.DataSource = dt;
         *          DropDownList1.DataBind();
         *
         *      }
         */

        if (!IsPostBack)
        {
            string CS = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(CS))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Block) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList2.DataTextField  = "Block";
                DropDownList2.DataValueField = "Block";
                DropDownList2.DataSource     = rdr;
                DropDownList2.DataBind();

                con.Close();
            }

            string QW = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(QW))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Floor) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList3.DataTextField  = "Floor";
                DropDownList3.DataValueField = "Floor";
                DropDownList3.DataSource     = rdr;
                DropDownList3.DataBind();
                con.Close();
            }

            string WE = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(WE))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(RoomSt) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList4.DataTextField  = "RoomSt";
                DropDownList4.DataValueField = "RoomSt";
                DropDownList4.DataSource     = rdr;
                DropDownList4.DataBind();

                con.Close();
            }

            string ER = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(ER))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Nos) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList5.DataTextField  = "Nos";
                DropDownList5.DataValueField = "Nos";
                DropDownList5.DataSource     = rdr;
                DropDownList5.DataBind();
                con.Close();
            }

            string RT = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(RT))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(WebEx) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList6.DataTextField  = "WebEx";
                DropDownList6.DataValueField = "WebEx";
                DropDownList6.DataSource     = rdr;
                DropDownList6.DataBind();
                con.Close();
            }

            string TY = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(TY))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Sparkboard) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList7.DataTextField  = "Sparkboard";
                DropDownList7.DataValueField = "Sparkboard";
                DropDownList7.DataSource     = rdr;
                DropDownList7.DataBind();
                con.Close();
            }

            string YU = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(YU))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Desktop) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList8.DataTextField  = "Desktop";
                DropDownList8.DataValueField = "Desktop";
                DropDownList8.DataSource     = rdr;
                DropDownList8.DataBind();
                con.Close();
            }

            string UI = System.Configuration.ConfigurationManager.ConnectionStrings["conf"].ConnectionString;
            using (SqlConnection con = new SqlConnection(UI))
            {
                SqlCommand cmd = new SqlCommand("Select DISTINCT(Projector) from Master", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                DropDownList9.DataTextField  = "Projector";
                DropDownList9.DataValueField = "Projector";
                DropDownList9.DataSource     = rdr;
                DropDownList9.DataBind();
                con.Close();
            }
        }
    }
예제 #30
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM carname";
                DBClass db        = new DBClass(sqlstring);
                DropDownList8.DataSource     = db.returndr();
                DropDownList8.DataTextField  = "车辆名称";
                DropDownList8.DataValueField = "车辆名称";
                DropDownList8.DataBind();
                db.dbClose();
            }

            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM cartype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList1.DataSource     = db.returndr();
                DropDownList1.DataTextField  = "车辆类型";
                DropDownList1.DataValueField = "车辆类型";
                DropDownList1.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM state";
                DBClass db        = new DBClass(sqlstring);
                DropDownList3.DataSource     = db.returndr();
                DropDownList3.DataTextField  = "车辆状态";
                DropDownList3.DataValueField = "车辆状态";
                DropDownList3.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM carcolor";
                DBClass db        = new DBClass(sqlstring);
                DropDownList2.DataSource     = db.returndr();
                DropDownList2.DataTextField  = "车辆颜色名";
                DropDownList2.DataValueField = "车辆颜色名";
                DropDownList2.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM subpoint";
                DBClass db        = new DBClass(sqlstring);
                DropDownList4.DataSource     = db.returndr();
                DropDownList4.DataTextField  = "业务部编号";
                DropDownList4.DataValueField = "业务部编号";
                DropDownList4.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM insuretype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList5.DataSource     = db.returndr();
                DropDownList5.DataTextField  = "保险类型";
                DropDownList5.DataValueField = "保险类型";
                DropDownList5.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM insurecompany";
                DBClass db        = new DBClass(sqlstring);
                DropDownList6.DataSource     = db.returndr();
                DropDownList6.DataTextField  = "保险公司";
                DropDownList6.DataValueField = "保险公司";
                DropDownList6.DataBind();
                db.dbClose();
            }
            if (!IsPostBack)
            {
                string  sqlstring = "SELECT * FROM oiltype";
                DBClass db        = new DBClass(sqlstring);
                DropDownList7.DataSource     = db.returndr();
                DropDownList7.DataTextField  = "油类型";
                DropDownList7.DataValueField = "油类型";
                DropDownList7.DataBind();
                db.dbClose();
            }            // 在此处放置用户代码以初始化页面

            Button3.Attributes.Add("onclick", "javascript:return confirm('您确认要添加照片么?')");
        }