Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SqlConnection  con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Saipreethi_Induri\source\repos\Registrationform\Registrationform\App_Data\Database1.mdf;Integrated Security=True");
         SqlCommand     cmd = new SqlCommand("select * from Country", con);
         SqlDataAdapter sda = new SqlDataAdapter(cmd);
         DataTable      dt  = new DataTable();
         sda.Fill(dt);
         DropDownList4.DataSource = dt;
         DropDownList4.DataBind();
     }
 }
Ejemplo n.º 2
0
 protected void delcity_Click(object sender, EventArgs e)
 {
     controllerObj.deletecity(Convert.ToInt32(DropDownList12.SelectedValue));
     DropDownList7.DataBind();
     DropDownList6.DataBind();
     DropDownList5.DataBind();
     DropDownList4.DataBind();
     DropDownList3.DataBind();
     DropDownList2.DataBind();
     DropDownList11.DataBind();
     DropDownList12.DataBind();
     DropDownList13.DataBind();
 }
Ejemplo n.º 3
0
    protected void DropDownList12_SelectedIndexChanged(object sender, EventArgs e)
    {
        sql_temp = "select distinct(t.dep_name) as dep_name from lh_onduty_record t where t.divname='" + DropDownList12.SelectedValue + "' ";

        ds_temp = func.get_dataSet_access(sql_temp, conn);

        DropDownList4.DataTextField  = "dep_name";
        DropDownList4.DataValueField = "dep_name";
        DropDownList4.DataSource     = ds_temp.Tables[0];
        DropDownList4.DataBind();
        DropDownList4.Items.Insert(0, "請選擇");
        ds_temp.Clear();
    }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label9.Visible = false;
            Label8.Visible = false;
            UtilizadorRules utilizadorRules = new UtilizadorRules();

            this.utilizadorExistente = new Utilizador();
            string email = Session["email"].ToString();
            string senha = Session["password"].ToString();

            if (email != null || senha != null)
            {
                this.utilizadorExistente = utilizadorRules.Login(email, senha);
                Label1.Text = "Agendar uma Consulta para: " + utilizadorExistente.Username;
            }

            Label6.Visible = false;
            if (Calendar1.SelectedDate.Date < DateTime.Today)
            {
                Label6.Visible = true;
            }

            List <Tratamento> listaTratamentos     = new List <Tratamento>();
            List <Local>      listaLocais          = new List <Local>();
            List <Utilizador> listaFisioterapeutas = new List <Utilizador>();


            ConsultaRules consultaRules = new ConsultaRules();

            listaLocais      = consultaRules.GetLocais();
            listaTratamentos = consultaRules.GetTratamentos();

            if (!Page.IsPostBack)
            {
                DropDownList2.DataSource     = listaLocais;
                DropDownList2.DataTextField  = "Nome";
                DropDownList2.DataValueField = "ID";
                DropDownList2.DataBind();

                DropDownList4.DataSource     = listaTratamentos;
                DropDownList4.DataTextField  = "Descricao";
                DropDownList4.DataValueField = "ID";
                DropDownList4.DataBind();

                listaFisioterapeutas         = utilizadorRules.GetFisioterapeutas();
                DropDownList1.DataSource     = listaFisioterapeutas;
                DropDownList1.DataTextField  = "Username";
                DropDownList1.DataValueField = "ID";
                DropDownList1.DataBind();
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                TextBox14.Enabled = false;
                TextBox1.Enabled  = false;

                DropDownList4.DataValueField = "Cmp_No";
                DropDownList4.DataTextField  = "Cmp_Nm";
                DropDownList4.DataSource     = db.MainCmpnam.ToList();
                DropDownList4.DataBind();
                TextBox28.Text = DropDownList4.SelectedValue;


                DropDownList5.DataValueField = "Brn_No";
                DropDownList5.DataTextField  = "Brn_NmAr";
                DropDownList5.DataSource     = db.MainBranch.ToList();
                DropDownList5.DataBind();

                int id = int.Parse(Request.QueryString["no"]);
                var cn = db.MtsCustmr.Where(o => o.Cstm_No == id).SingleOrDefault();
                ViewState.Add("id", id);

                TextBox14.Text = cn.Cstm_No.ToString();
                TextBox15.Text = cn.Cstm_NmAr;
                TextBox1.Text  = cn.Level_no.ToString();
                TextBox2.Text  = cn.Cstm_NmEn.ToString();
                //TextBox3.Text = cn.Sup_Rsp;
                //TextBox4.Text = cn.Sup_Othr;
                //TextBox5.Text = cn.Sup_Email;
                if (!string.IsNullOrEmpty(cn.Tel1))
                {
                    TextBox6.Text = cn.Tel1.ToString();
                }
                if (!string.IsNullOrEmpty(cn.Cstm_Tel))
                {
                    TextBox7.Text = cn.Cstm_Tel;
                }
                TextBox8.Text  = cn.Mobile1;
                TextBox9.Text  = cn.Credit_Value.ToString();
                TextBox10.Text = cn.Credit_Days.ToString();
                TextBox12.Text = cn.Fbal_Db.ToString();
                TextBox11.Text = cn.Fbal_CR.ToString();
                //TextBox13.Text = cn.Curncy_No.ToString();
                DropDownList2.SelectedValue    = cn.Catg_No.ToString();
                DropDownList3.SelectedValue    = cn.Cntry_No.ToString();
                RadioButtonList1.SelectedValue = cn.Level_Status.ToString();
                TextBox26.Text = cn.Brn_No.ToString();
                load_tree();
            }
        }
    //binding every month day
    private void BindDays(int year, int month)
    {
        int       i;
        ArrayList AlDay = new ArrayList();

        switch (month)
        {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            for (i = 1; i <= 31; i++)
            {
                AlDay.Add(i);
            }
            break;

        case 2:
            if (CheckLeap(year))
            {
                for (i = 1; i <= 29; i++)
                {
                    AlDay.Add(i);
                }
            }
            else
            {
                for (i = 1; i <= 28; i++)
                {
                    AlDay.Add(i);
                }
            }
            break;

        case 4:
        case 6:
        case 9:
        case 11:
            for (i = 1; i <= 30; i++)
            {
                AlDay.Add(i);
            }
            break;
        }

        DropDownList4.DataSource = AlDay;
        DropDownList4.DataBind();
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MultiView1.SetActiveView(View1);
            DataGrid1.DataSource = db.DataReturn("select surgery_id as ID, surgery_name as SURGERY, category_name as CATEGORY, duration as DURATION, amount as AMOUNT, description as DESCRIPTION from surgeries inner join surgery_category on surgery_category.category_id = surgeries.category_id where surgeries.hospital_id = " + Session["hospital_id"].ToString());
            DataGrid1.DataBind();

            DropDownList4.DataSource     = db.DataReturn("select surgeon_id,first_name+' '+last_name as sname from surgeons where hospital_id='" + Session["hospital_id"].ToString() + "'");
            DropDownList4.DataValueField = "surgeon_id";
            DropDownList4.DataTextField  = "sname";
            DropDownList4.DataBind();
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        label_GridPageState.Text = "默认数据源";

        string state = "";

        if (!IsPostBack)
        {
            if (Request.QueryString["state"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                state = Request.QueryString["state"];
            }

            if (state == "devide")
            {
                Title = "随工单分单";
                GridView_WOmain.Columns[0].Visible = false;
                GridView_WOmain.Columns[1].Visible = false;
                CheckBoxAll.Visible     = false;
                CheckBoxfanxuan.Visible = false;
                Btn_deleting.Visible    = false;
            }
            if (state == "combine")
            {
                Title = "随工单合单";
                GridView1.Columns[15].Visible = false;
            }
            DropDownList3.DataSource     = erl.S_WOError_Rework_PBCraft();
            DropDownList3.DataTextField  = "PBC_Name";
            DropDownList3.DataValueField = "PBC_ID";
            DropDownList3.DataBind();
            DropDownList3.Items.Insert(0, new ListItem("请选择", ""));

            DropDownList4.DataSource     = erl.S_WOError_Rework_PBCraft();
            DropDownList4.DataTextField  = "PBC_Name";
            DropDownList4.DataValueField = "PBC_ID";
            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, new ListItem("请选择", ""));

            //this.Title = "随工单分单";
            string condition = " and 1=1";
            GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition);
            GridView_WOmain.DataBind();
            UpdatePanel_WOmain.Update();
        }
    }
Ejemplo n.º 9
0
 private void GetFrancheeseNames()
 {
     da = new SqlDataAdapter("select fid,fname from tbl_francheese", con);
     ds = new DataSet();
     da.Fill(ds, "tbl_f");
     if (ds.Tables.Count > 0 && ds.Tables["tbl_f"].Rows.Count > 0)
     {
         DropDownList4.DataSource     = ds.Tables["tbl_f"].DefaultView;
         DropDownList4.DataTextField  = "fname";
         DropDownList4.DataValueField = "fid";
         DropDownList4.DataBind();
         DropDownList4.Items.Insert(0, "---Select---");
     }
 }
Ejemplo n.º 10
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        try
        {
            int check = Convert.ToInt32(TextBox1.Text);
            if (check == Convert.ToInt32(ViewState["count"]))
            // insert we selected questions
            {
                SqlCommand testCmd = new SqlCommand();
                testCmd.CommandText = "INSERT INTO Test(Test_Type,Total_Questions,Total_Marks,Subject_Id) Values('" + Convert.ToString(DropDownList4.SelectedItem) + "'," + GridView1.Rows.Count + "," + check + "," + Convert.ToInt32(Label7.Text) + ")";
                testCmd.Connection  = cn;
                testCmd.ExecuteNonQuery();


                SqlCommand lastTest = new SqlCommand();
                lastTest.CommandText = "SELECT max(Test_Id) FROM TEST";
                lastTest.Connection  = cn;
                int t_id = Convert.ToInt32(lastTest.ExecuteScalar());
                //   Response.Write("Test Id " + t_id);

                SqlCommand ins_queCmd = new SqlCommand();

                for (int row = 0; row < GridView1.Rows.Count; row++)
                {
                    ins_queCmd.CommandText = "INSERT INTO Test_Question(Test_Id,Question_Id) VALUES (" + t_id + "," + GridView1.Rows[row].Cells[0].Text + ")";
                    ins_queCmd.Connection  = cn;
                    ins_queCmd.ExecuteNonQuery();
                    //Response.Write(GridView1.Rows[row].Cells[0].Text);
                }

                DropDownList1.ClearSelection();
                DropDownList2.ClearSelection();
                DropDownList3.ClearSelection();
                DropDownList4.ClearSelection();
                TextBox1.Text = "";
                CheckBoxList1.Items.Clear();
                CheckBoxList2.Items.Clear();
                GridView1.DataSource = null;
                GridView1.DataBind();
                Response.Write(@"<script language='javascript'>alert('Test is successfully generated')</script>");
            }
            else
            {
                Response.Write("Select Entered Mark paper");
            }
        }
        catch (Exception a)
        {
        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AdminName"] == null)
        {
            Response.Redirect("login.aspx");
        }
        if (!IsPostBack)
        {
            MySqlDataReader reader = SqlHelper.GetExecuteReader("SELECT bookstyle FROM book_style");
            DropDownList1.DataSource     = reader;
            DropDownList1.DataTextField  = "bookstyle";
            DropDownList1.DataValueField = "bookstyle";
            DropDownList1.DataBind();
            SqlHelper.Closeconn();
            DropDownList1.Items.Insert(0, new ListItem("<-- 请选择 -->", "0"));
        }
        ////////////////////////////
        DateTime  tnow   = DateTime.Now; //现在时间
        ArrayList alyear = new ArrayList();
        int       i;

        for (i = 1980; i <= 2018; i++)
        {
            alyear.Add(i);
        }
        ArrayList almonth = new ArrayList();

        for (i = 1; i <= 12; i++)
        {
            almonth.Add(i);
        }
        ArrayList alday = new ArrayList();

        for (i = 1; i <= 31; i++)
        {
            alday.Add(i);
        }
        if (!this.IsPostBack)
        {
            DropDownList2.DataSource = alyear;
            DropDownList2.DataBind();
            DropDownList2.SelectedValue = tnow.Year.ToString();
            DropDownList3.DataSource    = almonth;
            DropDownList3.DataBind();
            DropDownList3.SelectedValue = tnow.Month.ToString();
            DropDownList4.DataSource    = alday;
            DropDownList4.DataBind();
            DropDownList4.SelectedValue = tnow.Day.ToString();
        }
    }
Ejemplo n.º 12
0
        protected void Button5_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 Hora,Dia_Consulta from Paciente_Clinica_Tijuca where Dia_Consulta='" + DropDownList3.Text + "'", conexao2);

            DropDownList4.DataTextField  = "Hora";
            DropDownList4.DataValueField = "Hora";
            DropDownList4.DataSource     = acha.ExecuteReader();
            DropDownList4.DataBind();
        }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ArrayList arry = new ArrayList();
         arry.Add("男");
         arry.Add("女");
         DropDownList4.DataSource = arry;
         DropDownList4.DataBind();
     }
     else
     {
     }
 }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string         str       = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["constring"].ToString();
         SqlConnection  conn      = new SqlConnection(str);
         SqlDataAdapter myCommand = new SqlDataAdapter("select stationName from station ", conn);
         DataSet        ds        = new DataSet();
         myCommand.Fill(ds);
         DropDownList4.DataTextField = "stationName";
         DropDownList4.DataSource    = ds.Tables[0].DefaultView;
         DropDownList4.DataBind();
     }
 }
Ejemplo n.º 15
0
 private void GetBranchNames(int fid)
 {
     da = new SqlDataAdapter("select bid,bname from tbl_branches where fid=" + fid + " ", con);
     ds = new DataSet();
     da.Fill(ds, "tbl_b");
     if (ds.Tables.Count > 0 && ds.Tables["tbl_b"].Rows.Count > 0)
     {
         DropDownList4.DataSource     = ds.Tables["tbl_b"].DefaultView;
         DropDownList4.DataTextField  = "bname";
         DropDownList4.DataValueField = "bid";
         DropDownList4.DataBind();
         DropDownList4.Items.Insert(0, "---Select---");
     }
 }
Ejemplo n.º 16
0
        protected void Button6_Click(object sender, EventArgs e)
        {
            string        conexao = @"Server=Localhost;Database=Consultorio;Trusted_Connection=true";
            SqlConnection conecta = new SqlConnection(conexao);

            conecta.Open();

            SqlCommand acha = new SqlCommand("select mes,data from dataIlha where mes='" + DropDownList3.Text + "'", conecta);

            DropDownList4.DataTextField  = "data";
            DropDownList4.DataValueField = "data";
            DropDownList4.DataSource     = acha.ExecuteReader();
            DropDownList4.DataBind();
        }
 private void RestartGeneration()
 {
     DropDownList1.DataSource = Classes.HogwartsDataAccess.GetSemesterList();
     DropDownList1.DataBind();
     DropDownList1.SelectedIndex = 0;
     DropDownList2.DataSource    = Classes.HogwartsDataAccess.GetDepartmentList();
     DropDownList2.DataBind();
     DropDownList2.SelectedIndex = 0;
     DropDownList3.DataSource    = Classes.HogwartsDataAccess.GetDisciplineList(DropDownList2.SelectedValue);
     DropDownList3.DataBind();
     RadioButtonList1.SelectedIndex = 0;
     DropDownList4.DataSource       = Classes.HogwartsDataAccess.GetTeacherList(DropDownList2.SelectedValue);
     DropDownList4.DataBind();
 }
Ejemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "";
            if (!Page.IsPostBack)
            {
                DropDownList3.DataValueField = "Brn_No";
                DropDownList3.DataTextField  = "Brn_NmAr";
                DropDownList3.DataSource     = db.MainBranch.ToList();
                DropDownList3.DataBind();

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

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

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


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



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


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


                TextBox1.Enabled = false;
                TextBox1.Text    = (db.MtsLC.Max(o => o.Doc_No) + 1).ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AddSeat.Attributes.Add("onclick", " javascript : return confirm (' Are you sure want to select the seat ?');");

            int adultfare = Convert.ToInt32(DropDownList1.SelectedValue);
            int childfare = Convert.ToInt32(DropDownList2.SelectedValue);


            if (!IsPostBack)
            {
                SqlCommand cmd = new SqlCommand("Select adult_fare from Trip where boarding_point = '" + Session["boarding_point"] + "' and arrival_point = '" + Session["arrival_point"] + "' and depart_date ='" + Session["depart_date"] + "' and depart_time = '" + Session["depart_time"] + "'", con);

                con.Open();

                DropDownList3.DataSource     = cmd.ExecuteReader();
                DropDownList3.DataTextField  = "adult_fare";
                DropDownList3.DataValueField = "adult_fare";
                DropDownList3.DataBind();


                con.Close();

                int Dbadultfare = Convert.ToInt32(DropDownList3.SelectedValue);
            }

            if (!IsPostBack)
            {
                SqlCommand cmd = new SqlCommand("Select child_fare from Trip where boarding_point = '" + Session["boarding_point"] + "' and arrival_point = '" + Session["arrival_point"] + "' and depart_date ='" + Session["depart_date"] + "' and depart_time = '" + Session["depart_time"] + "'", con);

                con.Open();

                DropDownList4.DataSource     = cmd.ExecuteReader();
                DropDownList4.DataTextField  = "child_fare";
                DropDownList4.DataValueField = "child_fare";
                DropDownList4.DataBind();


                con.Close();

                int Dbchildfare = Convert.ToInt32(DropDownList4.SelectedValue);
            }



            if (Session["userName"] != null)
            {
                Label8.Text = Session["userName"].ToString();
            }
        }
Ejemplo n.º 20
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Text = "";
     TextBox2.Text = "";
     TextBox4.Text = "";
     TextBox5.Text = "";
     TextBox6.Text = "";
     DropDownList1.ClearSelection();
     DropDownList2.ClearSelection();
     DropDownList3.ClearSelection();
     DropDownList4.ClearSelection();
     RadioButtonList1.ClearSelection();
     RadioButtonList2.ClearSelection();
     RadioButtonList3.ClearSelection();
 }
Ejemplo n.º 21
0
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSet ds2      = new DataSet();
        DAL     obj2     = new DAL();
        string  schoolid = Convert.ToString(Session["schoolid"]);
        string  strm     = DropDownList3.SelectedValue;

        ds2 = obj2.getCoursesByTerm(strm, schoolid);

        DropDownList4.DataSource     = ds2.Tables[0];
        DropDownList4.DataTextField  = "coursenameid";
        DropDownList4.DataValueField = "courseid";
        DropDownList4.DataBind();
        DropDownList4.Items.Insert(0, new ListItem("--Select Course--", "0"));
    }
Ejemplo n.º 22
0
        private void filldrop()
        {
            DropDownList4.DataSource    = getuserdata();
            DropDownList4.DataTextField = "CourseId";
            DropDownList4.DataBind();


            DropDownList3.DataSource    = getsectiondata();
            DropDownList3.DataTextField = "Id";
            DropDownList3.DataBind();

            DropDownList2.DataSource    = getTeacherdata();
            DropDownList2.DataTextField = "TeacherId";
            DropDownList2.DataBind();
        }
Ejemplo n.º 23
0
        public void selectCountry()
        {
            SqlCommand     cmd = new SqlCommand("Select * from Country", con);
            SqlDataAdapter adp = new SqlDataAdapter();

            adp.SelectCommand = cmd;
            DataSet ds = new DataSet();

            adp.Fill(ds);
            DropDownList4.DataSource     = ds;
            DropDownList4.DataValueField = "C_Id";
            DropDownList4.DataTextField  = "C_Name";
            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, " Select Country");
        }
Ejemplo n.º 24
0
        protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
        {
            int no = int.Parse(DropDownList4.SelectedValue);

            DropDownList4.DataValueField = "Cmp_No";
            DropDownList4.DataTextField  = "Cmp_Nm";
            DropDownList4.DataSource     = db.MtsSuplir.Where(o => o.Cmp_No == no).ToList();
            DropDownList4.DataBind();

            load_tree();


            //Session.Add("tree_node_path", " ");
            TreeView1.CollapseAll();
        }
Ejemplo n.º 25
0
 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     DropDownList4.Items.Clear();
     Code_Leitour.DataBind();
     DropDownList4.Items.Add(new ListItem(" Επιλογή Kωδικού ...", "0"));
     DropDownList4.DataBind();
     Leitourgika_Search.DataBind();
     GridView2.DataBind();
     Check_Leit.DataBind();
     Check_Leit_LC.DataBind();
     GridView3.DataBind();
     GridView4.DataBind();
     Ypologos.DataBind();
     GridView5.DataBind();
 }
Ejemplo n.º 26
0
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList4.Enabled = true;
        mysql = "SELECT distinct 市 FROM Area WHERE 省份 = '"
                + DropDownList3.SelectedValue.ToString().Trim() + "'";
        myds = mydb.ExecuteQuery(mysql, "Area");
        DataRow nrow = myds.Tables["Area"].NewRow();          //插入一个空行

        nrow["市"] = "";
        myds.Tables["Area"].Rows.InsertAt(nrow, 0);
        DropDownList4.DataSource    = myds.Tables["Area"];
        DropDownList4.DataTextField = "市";
        DropDownList4.DataBind();
        DropDownList5.Items.Clear();
    }
Ejemplo n.º 27
0
        protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
        {
            SqlCommand     cmd = new SqlCommand("Select * from Mall_regi where M_Name='" + DropDownList1.SelectedItem.Value + "'", con);
            SqlDataAdapter adp = new SqlDataAdapter();

            adp.SelectCommand = cmd;
            DataSet ds = new DataSet();

            adp.Fill(ds);
            DropDownList4.DataSource     = ds;
            DropDownList4.DataValueField = "M_Area";
            DropDownList4.DataTextField  = "M_Area";
            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, " Select Area");
        }
Ejemplo n.º 28
0
    protected void addnewfilluser()
    {
        string str = "";

        str = "select User_master.UserID, Party_master.PartyID,Party_master.Compname +' : '+ Party_master.Contactperson as PartyName from Party_master inner join PartytTypeMaster on PartytTypeMaster.PartyTypeId=Party_master.PartyTypeId inner join User_master on User_master.PartyID=Party_master.PartyID where Party_master.Whid='" + DropDownList2.SelectedValue + "'  and Party_master.PartyTypeId='" + DropDownList3.SelectedValue + "' order by PartyName  ";
        SqlDataAdapter da = new SqlDataAdapter(str, con);
        DataTable      dt = new DataTable();

        da.Fill(dt);

        DropDownList4.DataSource     = dt;
        DropDownList4.DataTextField  = "PartyName";
        DropDownList4.DataValueField = "UserID";
        DropDownList4.DataBind();
    }
Ejemplo n.º 29
0
        protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
            int ch        = Convert.ToInt32(DropDownList3.SelectedValue);
            var stateid   = from Tbl_chapter in db.Tbl_chapter where Tbl_chapter.Subject_ID.Equals(ch) select new { Tbl_chapter.Name_Ar, Tbl_chapter.Chapter_ID };
            var statename = stateid.ToList();

            if (statename.Count > 0)
            {
                DropDownList4.DataValueField = "Chapter_ID";
                DropDownList4.DataTextField  = "Name_Ar";
                DropDownList4.DataSource     = statename;
                DropDownList4.DataBind();
                //DropDownList1.Items.Insert(0, "--- select chapter ----");
            }
        }
Ejemplo n.º 30
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             if (FileUpload1.HasFile)
             {
                 dp = FileUpload1.PostedFile.FileName;
                 dp = "~/Uploaded/dp/" + dp;
                 FileUpload1.PostedFile.SaveAs(Server.MapPath(dp));
             }
             if (FileUpload2.HasFile)
             {
                 map = FileUpload2.PostedFile.FileName;
                 map = "~/Uploaded/map/" + map;
                 FileUpload2.PostedFile.SaveAs(Server.MapPath(map));
             }
             string sa = "insert into users(catid,spid,uname,uno,uemail,username,upass,sid,cid,address,udp,umap) values('" + DropDownList1.SelectedValue + "','" + DropDownList2.SelectedValue + "','" + TextBox1.Text
                         + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + DropDownList3.SelectedValue + "','" + DropDownList4.SelectedValue + "','" + TextBox7.Text + "','" + dp + "','" + map + "')";
             cmd = new SqlCommand(sa, con);
             con.Open();
             cmd.ExecuteNonQuery();
             con.Close();
             Response.Write("<script>$(document).ready(function () { $('#signup').modal('show');});</script>");
             Label14.Text = "You have successfully registered";
         }
         catch (Exception ex)
         {
             Response.Write(ex.ToString());
         }
         finally
         {
             con.Close();
             DropDownList1.ClearSelection();
             DropDownList2.ClearSelection();
             TextBox1.Text = "";
             TextBox2.Text = "";
             TextBox3.Text = "";
             TextBox4.Text = "";
             TextBox5.Text = "";
             TextBox6.Text = "";
             TextBox7.Text = "";
             DropDownList3.ClearSelection();
             DropDownList4.ClearSelection();
         }
     }
 }