Ejemplo n.º 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();
    }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
    }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
        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();
            }
        }
Ejemplo n.º 9
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"]         = "";
        }
    }
Ejemplo n.º 10
0
        protected void Button14_Click(object sender, EventArgs e)
        {
            int dt = controllerObj.DeleteHOTEL(DropDownList6.Text.ToString());

            DropDownList6.DataBind();
            DropDownList7.DataBind();
            DropDownList8.DataBind();
        }
Ejemplo n.º 11
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();
    }
 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............");
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 14
0
 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 = "";
 }
Ejemplo n.º 15
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();
        }
Ejemplo n.º 16
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();
        }
    }
    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();
    }
Ejemplo n.º 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();
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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();
    }
Ejemplo n.º 21
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();
        }
Ejemplo n.º 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();
    }
Ejemplo n.º 23
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");
        }
    }
Ejemplo n.º 24
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();
    }
Ejemplo n.º 25
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();
    }
Ejemplo n.º 26
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();
        }
    }
Ejemplo n.º 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Panel4.Visible = false;
                Panel2.Visible = false;
                Panel3.Visible = false;
                string cs = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                using (SqlConnection con = new SqlConnection(cs))
                {
                    SqlCommand cmd = new SqlCommand("Select subjectcode,subjectname from subjectdetails", con);
                    con.Open();
                    SqlDataReader sd;
                    sd = cmd.ExecuteReader();
                    DropDownList4.DataSource = sd;
                    DropDownList4.DataBind();
                    DropDownList4.Items.Insert(0, new ListItem("Select Subject", "NA"));
                    sd.Close();
                    SqlCommand cmd1 = new SqlCommand("Select teacherid,teachername,email,contact from Teacherdeatils", con);
                    sd = cmd1.ExecuteReader();
                    DropDownList5.DataSource = sd;
                    DropDownList5.DataBind();
                    DropDownList5.Items.Insert(0, new ListItem("Select Teacher", "NA"));
                    sd.Close();
                    SqlCommand cmd2 = new SqlCommand("Select teacherid,teachername,email,contact from Teacherdeatils", con);
                    sd = cmd2.ExecuteReader();
                    DropDownList6.DataSource = sd;
                    DropDownList6.DataBind();
                    DropDownList6.Items.Insert(0, new ListItem("Select Assisstant", "NA"));
                    sd.Close();
                    SqlCommand cmd3 = new SqlCommand("Select teacherid,teachername,email,contact from Teacherdeatils", con);
                    sd = cmd3.ExecuteReader();
                    DropDownList9.DataSource = sd;
                    DropDownList9.DataBind();
                    DropDownList9.Items.Insert(0, new ListItem("Select Teacher", "NA"));
                    sd.Close();
                    SqlCommand cmd4 = new SqlCommand("Select teacherid,teachername,email,contact from Teacherdeatils", con);
                    sd = cmd4.ExecuteReader();
                    DropDownList12.DataSource = sd;
                    DropDownList12.DataBind();
                    DropDownList12.Items.Insert(0, new ListItem("Select Teacher", "NA"));
                    sd.Close();
                    SqlCommand cmd5 = new SqlCommand("Select teacherid,teachername,email,contact from Teacherdeatils", con);
                    sd = cmd5.ExecuteReader();
                    DropDownList14.DataSource = sd;
                    DropDownList14.DataBind();
                    DropDownList14.Items.Insert(0, new ListItem("Select Teacher", "NA"));
                    sd.Close();
                    SqlCommand cmd6 = new SqlCommand("Select subjectcode,subjectname from subjectdetails", con);
                    sd = cmd6.ExecuteReader();
                    DropDownList8.DataSource = sd;
                    DropDownList8.DataBind();
                    DropDownList8.Items.Insert(0, new ListItem("Select Subject", "NA"));
                    sd.Close();
                    SqlCommand cmd7 = new SqlCommand("Select subjectcode,subjectname from subjectdetails", con);
                    sd = cmd7.ExecuteReader();
                    DropDownList11.DataSource = sd;
                    DropDownList11.DataBind();
                    DropDownList11.Items.Insert(0, new ListItem("Select Subject", "NA"));
                    sd.Close();
                    SqlCommand cmd8 = new SqlCommand("Select subjectcode,subjectname from subjectdetails", con);
                    sd = cmd8.ExecuteReader();
                    DropDownList13.DataSource = sd;
                    DropDownList13.DataBind();
                    DropDownList13.Items.Insert(0, new ListItem("Select Subject", "NA"));
                    sd.Close();
                    SqlCommand cmd9 = new SqlCommand("Select Id,classroom,lab from Room", con);
                    sd = cmd9.ExecuteReader();
                    DropDownList3.DataSource = sd;
                    DropDownList3.DataBind();
                    DropDownList3.Items.Insert(0, new ListItem("Select Lab Room", "NA"));
                    sd.Close();
                    SqlCommand cmd10 = new SqlCommand("Select Id,classroom,lab from Room", con);
                    sd = cmd10.ExecuteReader();
                    DropDownList7.DataSource = sd;
                    DropDownList7.DataBind();
                    DropDownList7.Items.Insert(0, new ListItem("Select Class Room", "NA"));
                    sd.Close();
                    //SqlCommand cmd11 = new SqlCommand("Insert into ROOM 1,"+DropDownList7.SelectedItem.Text+", "+DropDownList3.SelectedItem.Text, con);

                    /*  if (DropDownList11.Items.Contains(DropDownList8.SelectedItem))
                     * {
                     *    DropDownList11.Items.IndexOf(DropDownList8.SelectedItem);
                     *    DropDownList11.SelectedItem.Enabled = false;
                     * }*/
                }
            }
            //Panel1.Visible = true;
        }
    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();
            }
        }
    }
Ejemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.ImageButton1.Visible = false;
            string  sqlallMember = "select * from Billdetail_Information where BillID='" + Request.QueryString["BillID"] + "' and RecordID='" + Request.QueryString["RecordID"] + "'";
            DataSet ds           = new DataSet();
            ds = dataOperate.getDataset("select * from Member_Information where MemberID='" + Request.QueryString["PatientID"] + "'", "Member_Information");

            if (ds.Tables["Member_Information"].Rows.Count > 0)
            {
                DataRowView rowview = ds.Tables["Member_Information"].DefaultView[0];
                this.xingming.Text = rowview["MemberName"].ToString();
                ds.Clear();
            }

            this.GridView1.Visible    = true;
            this.GridView1.DataSource = dataOperate.getDataset(sqlallMember, "Billdetail_Information");
            this.GridView1.DataBind();
            Session["search"] = sqlallMember;
            pid.Text          = Request.QueryString["PatientID"];
            rid.Text          = Request.QueryString["RecordID"];
            bid.Text          = Request.QueryString["BillID"];
            did.Text          = Request.QueryString["DoctorID"];

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

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

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

            if (b == "ID")
            {
                b = "Name";
            }
            else
            {
                b = "ID";
            }

            string  sql3 = "select * from Medicine_Information where MedicineType='" + a + "'";
            DataSet ds3  = new DataSet();
            ds3 = dataOperate.getDataset(sql3, "Medicine_Information");
            int count1 = ds3.Tables["Medicine_Information"].Rows.Count;
            if (count1 != 0)
            {
                DataRowView rowview3 = ds3.Tables["Medicine_Information"].DefaultView[0];
                this.Label19.Text = rowview3["Medicine" + b + ""].ToString();
                this.Label20.Text = rowview3["MedicinePrice"].ToString();
            }
            else
            {
                this.Label19.Text = "";
                this.Label20.Text = "";
            }
        }
    }
Ejemplo n.º 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('您确认要添加照片么?')");
        }