예제 #1
0
    protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select location,aid from auditorium";
        DataTable dt = a.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            TextBox9.Text = dt.Rows[0][0].ToString();
            aidn          = Convert.ToInt32(dt.Rows[0][1].ToString());
        }
        cmd.CommandText = "select rent_amt from auditorium where aid='" + DropDownList7.SelectedValue + "'";
        DataTable b = a.getdata(cmd);

        tam = Convert.ToInt32(b.Rows[0][0].ToString());


        cmd.CommandText               = "select pgid,package from package where aid='" + DropDownList7.SelectedValue + "'";
        DropDownList10.DataSource     = a.getdata(cmd);
        DropDownList10.DataTextField  = "package";
        DropDownList10.DataValueField = "pgid";
        DropDownList10.DataBind();
        DropDownList10.Items.Insert(0, "--select--");
    }
예제 #2
0
        private void BindDropDown10()
        {
            try
            {
                using (OracleConnection sqlConn = new OracleConnection(strConn))
                {
                    using (OracleCommand sqlCmd = new OracleCommand())
                    {
                        sqlCmd.CommandText = "select * from TB_RANK";
                        sqlCmd.Connection  = sqlConn;
                        sqlConn.Open();
                        OracleDataAdapter da = new OracleDataAdapter(sqlCmd);
                        DataTable         dt = new DataTable();
                        da.Fill(dt);
                        DropDownList10.DataSource     = dt;
                        DropDownList10.DataValueField = "SEQ";
                        DropDownList10.DataTextField  = "RANK_NAME_TH";
                        DropDownList10.DataBind();
                        sqlConn.Close();

                        DropDownList10.Items.Insert(0, new ListItem("-- กรุณาเลือก --", "0"));
                    }
                }
            }
            catch { }
        }
 public void drop10()
 {
     ds.Clear();
     ds = db.discont("select sub_role from tb_subroles_of_subrole where role='" + DropDownList6.Text + "' and sub_main_role='" + DropDownList7.Text + "'");
     DropDownList10.DataSource    = ds;
     DropDownList10.DataTextField = "sub_role";
     DropDownList10.DataBind();
     DropDownList10.Items.Insert(0, "Select sub_role............");
 }
        protected void Page_Load(object sender, EventArgs e)
        {




            if (!IsPostBack)
            {
                SqlCommand cmd = new SqlCommand("Select distinct trip_id from Trip where boarding_point = '" + Session["board"] + "' and arrival_point = '" + Session["arrive"] + "'", con);

                con.Open();

                DropDownList10.DataSource = cmd.ExecuteReader();
                DropDownList10.DataTextField = "trip_id";
                DropDownList10.DataValueField = "trip_id";
                DropDownList10.DataBind();

                Session["trips"] = DropDownList10.SelectedValue.ToString();

                con.Close();


            }

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

                con.Open();

                DropDownList6.DataSource = cmd.ExecuteReader();
                DropDownList6.DataTextField = "bus_id";
                DropDownList6.DataValueField = "bus_id";
                DropDownList6.DataBind();

                con.Close();
            }



     

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

                con.Open();

                DropDownList11.DataSource = cmd.ExecuteReader();
                DropDownList11.DataTextField = "company_name";
                DropDownList11.DataValueField = "buscomponay_id";
                DropDownList11.DataBind();

                con.Close();
            }
        }
 protected void DropDownList11_SelectedIndexChanged(object sender, EventArgs e)
 {
     TextBox28.Text = DropDownList11.SelectedValue;
     Ypologos.DataBind();
     Old_Eggrafa.DataBind();
     DropDownList10.Items.Clear();
     DropDownList10.DataBind();
     DropDownList10.Items.Insert(0, new ListItem("Επιλογή...", String.Empty));
     DropDownList10.SelectedIndex = 0;
 }
    private void stuid()
    {
        SqlCommand cmd = new SqlCommand("prc_dispstudent", con);

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

        DropDownList10.DataTextField  = "id";
        DropDownList10.DataValueField = "id";
        DropDownList10.DataSource     = rd;
        DropDownList10.DataBind();
        rd.Close();
        cmd.Dispose();
    }
예제 #7
0
        protected void CheckButton_Click(object sender, EventArgs e)
        {
            var result = (from a in myctx.ServiceProviders
                          where a.ServiceProviderType == DropDownList1.Text
                          select a.ServiceProviderID).Except(from b in myctx.ServiceProviderAssignments
                                                             where b.StartTime == TimeSpan.Parse(TextBox1.Text) && b.EndTime == TimeSpan.Parse(TextBox2.Text) && b.StartDateAssigned == Convert.ToDateTime(TextBoxDate.Text) && b.ENDDATEASSIGNED == Convert.ToDateTime(TextBox6.Text)
                                                             select b.ServiceProviderID).ToList();

            DropDownList10.DataSource = result;
            DropDownList10.DataBind();

            for (int i = 0; i <= DropDownList10.Items.Count - 1; i++)
            {
                var spname = from a in myctx.ServiceProviders
                             where a.ServiceProviderType == DropDownList1.Text && a.ServiceProviderID == Convert.ToInt16(DropDownList10.Items[i].Text)
                             select a.ServiceProviderFullName;

                // mylist.Add(spname);
                var ss = spname.First();
                DropDownList2.Items.Add(ss);
            }


            //var resultname = from a in myctx.ServiceProviders
            //                 where a.ServiceProviderID == Convert.ToInt16(GridView1.Rows[i].Cells[0].Text)
            //                 select new { a.ServiceProviderID, name = a.SPFirstName + " " + a.SPLastName };

            //if (resultname.Count() != 0)
            //{
            //    DropDownList2.DataSource = resultname;
            //    DropDownList2.DataTextField = "name";
            //    DropDownList2.DataValueField = "ServiceProviderID";
            //    DropDownList2.DataBind();



            var ser = from b in myctx.ServiceBs

                      where b.ServiceProviderID == Convert.ToInt16(DropDownList10.SelectedValue)
                      select new { b.ServiceName, b.SerciveID };

            if (ser.Count() != 0)
            {
                DropDownList6.DataSource     = ser;
                DropDownList6.DataTextField  = "ServiceName";
                DropDownList6.DataValueField = "SerciveID";
                DropDownList6.DataBind();
            }
        }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            cmd.CommandText               = "select ID,LOCATION from Place_tb";
            DropDownList10.DataSource     = db.getdata(cmd);
            DropDownList10.DataTextField  = "LOCATION";
            DropDownList10.DataValueField = "LOCATION";
            DropDownList10.DataBind();
            DropDownList10.Items.Insert(0, "--select--");
            cmd.CommandText = "select max (ID) from Hotel_tb";
            TextBox1.Text   = db.max_id(cmd).ToString();
            for (int i = 1; i <= 31; i++)
            {
                DropDownList1.Items.Add(i.ToString());
            }
            DropDownList1.Items.Insert(0, "DD");
            DropDownList2.Items.Insert(0, "MM");
            for (int i = 2018; i <= 2100; i++)
            {
                DropDownList3.Items.Add(i.ToString());
            }
            DropDownList3.Items.Insert(0, "YYYY");
        }
        for (int i = 1; i <= 31; i++)
        {
            DropDownList4.Items.Add(i.ToString());
        }
        DropDownList4.Items.Insert(0, "DD");
        DropDownList5.Items.Insert(0, "MM");
        for (int i = 2018; i <= 2100; i++)
        {
            DropDownList6.Items.Add(i.ToString());
        }
        DropDownList6.Items.Insert(0, "YYYY");
        for (int i = 1; i <= 10; i++)
        {
            DropDownList8.Items.Add(i.ToString());
        }
        DropDownList8.Items.Insert(0, "");

        for (int i = 1; i <= 7; i++)
        {
            DropDownList9.Items.Add(i.ToString());
        }
        DropDownList9.Items.Insert(0, "");
    }
예제 #9
0
        protected void Button19_Click(object sender, EventArgs e)
        {
            string        queryString = "select CAST( uploaded_at as nvarchar(50)) + ' ' + ' /' + ' ' +type as uploaded_attype,c.id from Content c inner join Original_Content o on c.id=o.ID where o.review_status=1";
            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)
            {
                DropDownList10.DataSource     = dt;
                DropDownList10.DataTextField  = "uploaded_attype";
                DropDownList10.DataValueField = "id";
                DropDownList10.DataBind();
            }
            connection.Close();
        }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    advisor_Id = 100, id = 100;
        string date = "4/16/2013";
        string stID = "822459053";

        lblAdvisorID.Text = advisor_Id.ToString();
        lblDate.Text      = date;
        lblStudentID.Text = stID;
        int time = 9;


        this.Util(100);
        DropDownList1.DataSource = getAdvisorIDs();
        DropDownList1.DataBind();

        Label2.Text = getAdvisorImage(advisor_Id);
        Label3.Text = getName(advisor_Id);
        Label4.Text = getDepartment(advisor_Id);
        //   Label5.Text = getMonday(advisor_Id);
        // ////Label6.Text = getTuesday(advisor_Id);
        // ////Label7.Text = getWednesday(advisor_Id);
        // ////Label8.Text = getThursday(advisor_Id);
        // ////Label9.Text = getFriday(advisor_Id);
        DropDownList10.DataSource = getSlots(advisor_Id, date);
        DropDownList10.DataBind();
        DropDownList11.DataSource = getTaken(advisor_Id, date);
        DropDownList11.DataBind();
        DropDownList12.DataSource = getAvailability(getSlots(advisor_Id, date), getTaken(advisor_Id, date));
        DropDownList12.DataBind();
        DropDownList13.DataSource = getDaysAvailable(id);
        DropDownList13.DataBind();
        // //Label14.Text = getAvailableID(time);
        Label15.Text = getCheck(stID).ToString();
        DropDownList16.DataSource = getAdvisor2WeekSchedule();
        DropDownList16.DataBind();
        DropDownList17.DataSource = getAdvisor2WeekSchedule(id);
        DropDownList17.DataBind();
        DropDownList18.DataSource = getStudentIds();
        DropDownList18.DataBind();
    }
예제 #11
0
    private void BindDropDownList10()
    {
        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.其它

        dt.Rows.Add(new Object[] { "1", "1郵寄" });
        dt.Rows.Add(new Object[] { "2", "2自領" });
        dt.Rows.Add(new Object[] { "3", "3其它" });


        DropDownList10.DataSource     = dt;
        DropDownList10.DataTextField  = "Filed2";
        DropDownList10.DataValueField = "Filed1";
        DropDownList10.DataBind();
    }
예제 #12
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     DropDownList10.Items.Clear();
     DropDownList10.Items.Add(new ListItem(" Χρήση ...", "0"));
     DropDownList10.DataBind();
 }
예제 #13
0
        private void BindAreaDP()
        {
            List <RSSMWeb.Code.Utils.CustomClass> mylist = Utils.GetUserList();

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

            mylist.Insert(0, tmp);


            DropDownList7.DataTextField  = "Name";
            DropDownList7.DataValueField = "ID";
            DropDownList7.DataSource     = mylist;
            DropDownList7.DataBind();

            //DropDownList6.DataTextField = "Name";
            //DropDownList6.DataValueField = "ID";
            //DropDownList6.DataSource = mylist;
            //DropDownList6.DataBind();

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

            DropDownList6.DataSource = mylist_username_dpt;
            DropDownList6.DataBind();
            DropDownList6.SelectedValue = "0";



            //DropDownList9.DataTextField = "Name";
            //DropDownList9.DataValueField = "ID";
            //DropDownList9.DataSource = mylist;
            //DropDownList9.DataBind();

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

            DropDownList9.DataSource = mylist_username_dpt;
            DropDownList9.DataBind();
            DropDownList9.SelectedValue = "0";

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

            DropDownList10.DataSource = mylist_username_dpt;
            DropDownList10.DataBind();
            DropDownList10.SelectedValue = "0";

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

            DropDownList12.DataSource = mylist_username_dpt;
            DropDownList12.DataBind();
            DropDownList12.SelectedValue = "0";

            mylist.Clear();
            mylist   = Utils.GetPJList();
            tmp.ID   = "0";
            tmp.Name = "无";
            mylist.Insert(0, tmp);

            DropDownList4.DataTextField  = "Name";
            DropDownList4.DataValueField = "ID";
            DropDownList4.DataSource     = mylist;
            DropDownList4.DataBind();

            mylist.Clear();
            mylist   = Utils.GetPDList();
            tmp.ID   = "0";
            tmp.Name = "无";
            mylist.Insert(0, tmp);

            DropDownList2.DataTextField  = "Name";
            DropDownList2.DataValueField = "ID";
            DropDownList2.DataSource     = mylist;
            DropDownList2.DataBind();
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var x = Request.QueryString["page"].ToString();
                int y = int.Parse(x);
                if (y == 1)
                {
                    Panel2.Visible = true;
                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_department rr      = db.Tbl_department.First(u => u.Department_ID == y1);
                    int            dep     = Convert.ToInt32(rr.Level_ID);
                    var            stateid = from Tbl_Level in db.Tbl_Level where Tbl_Level.Level_ID.Equals(dep) select new { Tbl_Level.Name_Ar, Tbl_Level.Name_Er, Tbl_Level.Level_ID };
                    var            le      = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID, Tbl_Level.Name_Ar };
                    DropDownList1.DataSource     = le.ToList();
                    DropDownList1.DataValueField = "Level_ID";
                    DropDownList1.DataTextField  = "Name_Er";
                    DropDownList1.DataBind();
                    DropDownList1.SelectedValue = dep.ToString();

                    name_ar_dep.Text = rr.Name_Ar;
                    name_en_dep.Text = rr.Name_En;
                }

                else if (y == 112)
                {
                    Panel7.Visible = true;
                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_department rr      = db.Tbl_department.First(u => u.Department_ID == y1);
                    int            dep     = Convert.ToInt32(rr.Level_ID);
                    var            stateid = from Tbl_Level in db.Tbl_Level where Tbl_Level.Level_ID.Equals(dep) select new { Tbl_Level.Name_Ar, Tbl_Level.Name_Er, Tbl_Level.Level_ID };
                    var            le      = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID, Tbl_Level.Name_Ar };
                    DropDownList9.DataSource     = le.ToList();
                    DropDownList9.DataValueField = "Level_ID";
                    DropDownList9.DataTextField  = "Name_Ar";
                    DropDownList9.DataBind();
                    DropDownList9.SelectedValue = dep.ToString();

                    TextBox14.Text = rr.Name_Ar;
                    TextBox13.Text = rr.Name_En;
                }



                else if (y == 21)
                {
                    Panel8.Visible = true;

                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_Subject rr      = db.Tbl_Subject.First(u => u.Subject_ID == y1);
                    int         pro     = Convert.ToInt32(rr.Prof_ID);
                    var         stateid = from Tbl_Prof in db.Tbl_Prof where Tbl_Prof.Approval.Equals("1") select new { Tbl_Prof.Prof_ID, Tbl_Prof.Name };
                    //var pr = from Tbl_Prof in db.Tbl_Prof select new { Tbl_Prof.Name, Tbl_Prof.Prof_ID };
                    DropDownList10.DataSource     = stateid.ToList();
                    DropDownList10.DataValueField = "Prof_ID";
                    DropDownList10.DataTextField  = "Name";
                    DropDownList10.DataBind();
                    DropDownList10.SelectedValue = pro.ToString();

                    int            dep = Convert.ToInt32(rr.Department_ID);
                    Tbl_department de  = db.Tbl_department.First(d => d.Department_ID == dep);
                    int            lev = Convert.ToInt32(de.Level_ID);
                    var            le  = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID, Tbl_Level.Name_Ar };
                    DropDownList11.DataSource     = le.ToList();
                    DropDownList11.DataValueField = "Level_ID";
                    DropDownList11.DataTextField  = "Name_Ar";
                    DropDownList11.DataBind();
                    DropDownList11.SelectedValue = lev.ToString();

                    var stateidDep = from Tbl_department in db.Tbl_department where Tbl_department.Level_ID.Equals(lev) select new { Tbl_department.Department_ID, Tbl_department.Level_ID, Tbl_department.Name_En, Tbl_department.Name_Ar };

                    var statename = stateidDep.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList12.DataSource     = statename;
                        DropDownList12.DataValueField = "Department_ID";
                        DropDownList12.DataTextField  = "Name_Ar";
                        DropDownList12.DataBind();
                        DropDownList12.SelectedValue = dep.ToString();
                    }

                    TextBox15.Text = rr.Name_Er;
                    TextBox16.Text = rr.Name_Ar;
                }

                else if (y == 2)
                {
                    Panel3.Visible = true;

                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_Subject rr      = db.Tbl_Subject.First(u => u.Subject_ID == y1);
                    int         pro     = Convert.ToInt32(rr.Prof_ID);
                    var         stateid = from Tbl_Prof in db.Tbl_Prof where Tbl_Prof.Approval.Equals("1") select new { Tbl_Prof.Prof_ID, Tbl_Prof.Name };
                    //var pr = from Tbl_Prof in db.Tbl_Prof select new { Tbl_Prof.Name, Tbl_Prof.Prof_ID };
                    DropDownList4.DataSource     = stateid.ToList();
                    DropDownList4.DataValueField = "Prof_ID";
                    DropDownList4.DataTextField  = "Name";
                    DropDownList4.DataBind();
                    DropDownList4.SelectedValue = pro.ToString();

                    int            dep = Convert.ToInt32(rr.Department_ID);
                    Tbl_department de  = db.Tbl_department.First(d => d.Department_ID == dep);
                    int            lev = Convert.ToInt32(de.Level_ID);
                    var            le  = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID };
                    DropDownList2.DataSource     = le.ToList();
                    DropDownList2.DataValueField = "Level_ID";
                    DropDownList2.DataTextField  = "Name_Er";
                    DropDownList2.DataBind();
                    DropDownList2.SelectedValue = lev.ToString();

                    var stateidDep = from Tbl_department in db.Tbl_department where Tbl_department.Level_ID.Equals(lev) select new { Tbl_department.Department_ID, Tbl_department.Level_ID, Tbl_department.Name_En };

                    var statename = stateidDep.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList3.DataSource     = statename;
                        DropDownList3.DataValueField = "Department_ID";
                        DropDownList3.DataTextField  = "Name_En";
                        DropDownList3.DataBind();
                        DropDownList3.SelectedValue = dep.ToString();
                    }

                    TextBox1.Text = rr.Name_Er;
                    TextBox2.Text = rr.Name_Ar;
                }


                else if (y == 31)
                {
                    Panel9.Visible = true;
                    var      x1 = Request.QueryString["id"].ToString();
                    int      y1 = int.Parse(x1);
                    Tbl_Prof rr = db.Tbl_Prof.First(u => u.Prof_ID == y1);
                    TextBox17.Text = rr.Name.ToString();
                    TextBox18.Text = rr.Password.ToString();
                    TextBox19.Text = rr.Email.ToString();
                }

                else if (y == 3)
                {
                    Panel1.Visible = true;
                    var      x1 = Request.QueryString["id"].ToString();
                    int      y1 = int.Parse(x1);
                    Tbl_Prof rr = db.Tbl_Prof.First(u => u.Prof_ID == y1);
                    TextBox4.Text = rr.Name.ToString();
                    TextBox5.Text = rr.Password.ToString();
                    TextBox6.Text = rr.Email.ToString();
                }



                else if (y == 41)
                {
                    Panel10.Visible = true;
                    var         x1 = Request.QueryString["id"].ToString();
                    int         y1 = int.Parse(x1);
                    Tbl_Student rr = db.Tbl_Student.First(u => u.Student_ID == y1);
                    TextBox20.Text = rr.Name.ToString();
                    TextBox21.Text = rr.Password.ToString();
                    TextBox22.Text = rr.Email.ToString();
                    var lev = rr.Level_ID;
                    var dep = rr.Department_ID;

                    var le = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID, Tbl_Level.Name_Ar };
                    DropDownList13.DataSource     = le.ToList();
                    DropDownList13.DataValueField = "Level_ID";
                    DropDownList13.DataTextField  = "Name_Ar";
                    DropDownList13.DataBind();
                    DropDownList13.SelectedValue = lev.ToString();

                    var stateidDep = from Tbl_department in db.Tbl_department where Tbl_department.Level_ID.Equals(lev) select new { Tbl_department.Department_ID, Tbl_department.Level_ID, Tbl_department.Name_En, Tbl_department.Name_Ar };

                    var statename = stateidDep.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList14.DataSource     = statename;
                        DropDownList14.DataValueField = "Department_ID";
                        DropDownList14.DataTextField  = "Name_Ar";
                        DropDownList14.DataBind();
                        DropDownList14.SelectedValue = dep.ToString();
                    }
                }



                else if (y == 4)
                {
                    Panel4.Visible = true;
                    var         x1 = Request.QueryString["id"].ToString();
                    int         y1 = int.Parse(x1);
                    Tbl_Student rr = db.Tbl_Student.First(u => u.Student_ID == y1);
                    TextBox3.Text = rr.Name.ToString();
                    TextBox7.Text = rr.Password.ToString();
                    TextBox8.Text = rr.Email.ToString();
                    var lev = rr.Level_ID;
                    var dep = rr.Department_ID;

                    var le = from Tbl_Level in db.Tbl_Level select new { Tbl_Level.Name_Er, Tbl_Level.Level_ID };
                    DropDownList5.DataSource     = le.ToList();
                    DropDownList5.DataValueField = "Level_ID";
                    DropDownList5.DataTextField  = "Name_Er";
                    DropDownList5.DataBind();
                    DropDownList5.SelectedValue = lev.ToString();

                    var stateidDep = from Tbl_department in db.Tbl_department where Tbl_department.Level_ID.Equals(lev) select new { Tbl_department.Department_ID, Tbl_department.Level_ID, Tbl_department.Name_En };

                    var statename = stateidDep.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList6.DataSource     = statename;
                        DropDownList6.DataValueField = "Department_ID";
                        DropDownList6.DataTextField  = "Name_En";
                        DropDownList6.DataBind();
                        DropDownList6.SelectedValue = dep.ToString();
                    }
                }



                else if (y == 61)
                {
                    Panel11.Visible = true;
                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_chapter rr  = db.Tbl_chapter.First(u => u.Chapter_ID == y1);
                    int         dep = Convert.ToInt32(rr.Subject_ID);

                    var x2        = Request.QueryString["pr"].ToString();
                    int y2        = int.Parse(x2);
                    var stateid   = from Tbl_Subject in db.Tbl_Subject where Tbl_Subject.Prof_ID.Equals(y2) select new { Tbl_Subject.Subject_ID, Tbl_Subject.Name_Ar };
                    var statename = stateid.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList15.DataValueField = "Subject_ID";
                        DropDownList15.DataTextField  = "Name_Ar";
                        DropDownList15.DataSource     = statename;
                        DropDownList15.DataBind();
                        DropDownList15.Items.Insert(0, "--- select sub----");
                    }
                    DropDownList15.SelectedValue = dep.ToString();

                    TextBox24.Text = rr.Name_Ar;
                    TextBox23.Text = rr.Name_En;
                }

                else if (y == 6)
                {
                    Panel5.Visible = true;
                    var x1 = Request.QueryString["id"].ToString();
                    int y1 = int.Parse(x1);

                    Tbl_chapter rr  = db.Tbl_chapter.First(u => u.Chapter_ID == y1);
                    int         dep = Convert.ToInt32(rr.Subject_ID);

                    var x2        = Request.QueryString["pr"].ToString();
                    int y2        = int.Parse(x2);
                    var stateid   = from Tbl_Subject in db.Tbl_Subject where Tbl_Subject.Prof_ID.Equals(y2) select new { Tbl_Subject.Subject_ID, Tbl_Subject.Name_Er };
                    var statename = stateid.ToList();
                    if (statename.Count > 0)
                    {
                        DropDownList7.DataValueField = "Subject_ID";
                        DropDownList7.DataTextField  = "Name_Er";
                        DropDownList7.DataSource     = statename;
                        DropDownList7.DataBind();
                        DropDownList7.Items.Insert(0, "--- select sub----");
                    }
                    DropDownList7.SelectedValue = dep.ToString();

                    TextBox10.Text = rr.Name_Ar;
                    TextBox9.Text  = rr.Name_En;
                }



                else if (y == 71)
                {
                    Panel12.Visible = true;
                    var          x1 = Request.QueryString["id"].ToString();
                    int          y1 = int.Parse(x1);
                    Tbl_Question rr = db.Tbl_Question.First(u => u.Question_ID == y1);
                    TextBox26.Text = rr.Question_Ar.ToString();
                    TextBox25.Text = rr.Question_En.ToString();
                    DropDownList16.SelectedValue = rr.Question_Level.ToString();
                    var x2 = Request.QueryString["pr"].ToString();
                    int y2 = int.Parse(x2);
                }

                else if (y == 7)
                {
                    Panel6.Visible = true;
                    var          x1 = Request.QueryString["id"].ToString();
                    int          y1 = int.Parse(x1);
                    Tbl_Question rr = db.Tbl_Question.First(u => u.Question_ID == y1);
                    TextBox12.Text = rr.Question_Ar.ToString();
                    TextBox11.Text = rr.Question_En.ToString();
                    DropDownList8.SelectedValue = rr.Question_Level.ToString();
                    var x2 = Request.QueryString["pr"].ToString();
                    int y2 = int.Parse(x2);
                }
            }
        }
 protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
 {
     DropDownList10.DataBind();
 }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            sql_str = " select distinct(t.offday) as offday from onduty t " +
                      " where t.offday not in ('OFF','ON')      ";
            ds_temp = func.get_dataSet_access(sql_str, conn);



            RadioButtonList1.DataSource = ds_temp.Tables[0];

            RadioButtonList1.DataTextField  = "offday";
            RadioButtonList1.DataValueField = "offday";
            RadioButtonList1.DataBind();
            // RadioButtonList1.Items.Insert(0, "請選擇");

            txtEstimateStartDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToString("yyyy/MM/dd"));


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

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



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

            DropDownList8.DataSource = arlist_temp1;
            DropDownList8.DataBind();
            DropDownList8.Text = DateTime.Now.ToString("mm");
            DropDownList8.Text = "00";



            txtEstimateEndDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(+0).ToString("yyyy/MM/dd"));


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

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



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

            DropDownList18.DataSource = arlist_temp1;
            DropDownList18.DataBind();
            DropDownList18.Text = DateTime.Now.ToString("mm");
            DropDownList18.Text = "59";

            #region MyRegion 值班工程師
            sql_str = " select distinct (t.engineer) as engineer                                                                      " +
                      "   from onduty t                                                                                   " +
                      "  where t.engineer not in                                                                          " +
                      "        ('何宗彥', '吳泳潔', '廖建賀', '張松騰', '徐展文', '林校平', '林豐裕',                     " +
                      "         '羅盛平', '胡慶祥', '邵朝文', '賴岳汶', '陳品辰', '陳盈仁', '魏武慶',                     " +
                      "         '黃建友', '黃紹煒','蔡丞','楊炎煌','蕭寶棋','蔡育倫','陳鏞企','吳宗哲','吳宜蓁','呂政達') ";
            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList4.DataSource     = ds_temp.Tables[0];
            DropDownList4.DataTextField  = "engineer";
            DropDownList4.DataValueField = "engineer";

            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, "請選擇");

            #endregion

            #region fab
            sql_str = " select distinct (t.fab) as fab                                                                      " +
                      "   from onduty t                                                                                   ";

            // ds_temp.Clear();
            string [] fab_array = { "T0T1*", "T2*", "T0Array", "T1Array", "T0Cell", "T1Cell", "T1CF", "T2Array", "T2Cell", "T2CF", "T0T1_OTHERS", "T2_OTHERS", "C3", "WIS" };
            ds_temp = func.get_dataSet_access(sql_str, conn);

            DropDownList1.DataSource = ds_temp.Tables[0];
            DropDownList1.DataSource = fab_array;
            //DropDownList1.DataTextField = "fab";
            //DropDownList1.DataValueField = "fab";

            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "請選擇");


            #endregion


            #region fab
            sql_str = " select distinct (t.system) as system                                                                      " +
                      "   from onduty t                                                                                   ";

            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList2.DataSource     = ds_temp.Tables[0];
            DropDownList2.DataTextField  = "system";
            DropDownList2.DataValueField = "system";

            DropDownList2.DataBind();
            DropDownList2.Items.Insert(0, "請選擇");


            #endregion



            #region close_flag
            sql_str = "select distinct(t.close_flag) as close_flag  from onduty t" +
                      " where t.close_flag is not null";
            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList3.DataSource     = ds_temp.Tables[0];
            DropDownList3.DataTextField  = "close_flag";
            DropDownList3.DataValueField = "close_flag";
            DropDownList3.DataBind();
            DropDownList3.Items.Insert(0, "請選擇");


            #endregion



            #region ars_flag
            sql_str = "select distinct(t.ars_flag) as ars_flag  from onduty t" +
                      " where t.ars_flag is not null";
            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList12.DataSource     = ds_temp.Tables[0];
            DropDownList12.DataTextField  = "ars_flag";
            DropDownList12.DataValueField = "ars_flag";
            DropDownList12.DataBind();
            DropDownList12.Items.Insert(0, "請選擇");



            #endregion


            #region alarm_flag
            sql_str = "select distinct(t.alarm_flag) as alarm_flag  from onduty t" +
                      " where t.alarm_flag is not null";
            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList10.DataSource     = ds_temp.Tables[0];
            DropDownList10.DataTextField  = "alarm_flag";
            DropDownList10.DataValueField = "alarm_flag";
            DropDownList10.DataBind();
            DropDownList10.Items.Insert(0, "請選擇");



            #endregion



            #region type
            sql_str = " select distinct(t.type) as type  from onduty t                                                       " +
                      " where t.type not in ('資料異常','MO+過帳失敗','交辦事項','支援部門','設備(搬運系統)','過帳失敗')     ";
            // ds_temp.Clear();
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList6.DataSource     = ds_temp.Tables[0];
            DropDownList6.DataTextField  = "type";
            DropDownList6.DataValueField = "type";
            DropDownList6.DataBind();
            DropDownList6.Items.Insert(0, "請選擇");



            #endregion


            #region product_impact
            sql_str = " select distinct(t.product_impact) as product_impact  from onduty t " +
                      " where t.product_impact is not null                                 ";
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList7.DataSource     = ds_temp.Tables[0];
            DropDownList7.DataTextField  = "product_impact";
            DropDownList7.DataValueField = "product_impact";
            DropDownList7.DataBind();
            DropDownList7.Items.Insert(0, "請選擇");

            #endregion



            #region 處理者
            sql_str = " select distinct(t.bywhom) as bywhom  from onduty t " +
                      " where t.bywhom is not null                                 ";
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList9.DataSource     = ds_temp.Tables[0];
            DropDownList9.DataTextField  = "bywhom";
            DropDownList9.DataValueField = "bywhom";
            DropDownList9.DataBind();
            DropDownList9.Items.Insert(0, "請選擇");


            #endregion



            #region Assign To
            sql_str = " select distinct(t.assign_owner) as assign_owner  from onduty t                                       " +
                      " where t.assign_owner  not in ('何宗彥', '吳泳潔', '廖建賀', '張松騰', '徐展文', '林校平', '林豐裕',  " +
                      "         '羅盛平', '胡慶祥', '邵朝文', '賴岳汶', '陳品辰', '陳盈仁', '魏武慶',                        " +
                      "         '黃建友', '黃紹煒','蔡丞','楊炎煌','蕭寶棋','蔡育倫','陳鏞企','吳宗哲','吳宜蓁','呂政達')    ";
            ds_temp = func.get_dataSet_access(sql_str, conn);
            DropDownList11.DataSource     = ds_temp.Tables[0];
            DropDownList11.DataTextField  = "assign_owner";
            DropDownList11.DataValueField = "assign_owner";
            DropDownList11.DataBind();
            DropDownList11.Items.Insert(0, "請選擇");
            DropDownList11.Items.Insert(1, "*");


            #endregion

            Label1.Text = "0";
            Label2.Text = "0";
            Label3.Text = "0";
            Label4.Text = "0";
            Label5.Text = "0";

            Label1.ForeColor = Color.Red;
            Label2.ForeColor = Color.Red;
            Label3.ForeColor = Color.Red;
            Label4.ForeColor = Color.Red;
            Label5.ForeColor = Color.Red;

            bind_data();
            //MappTextProvider omapp = new MappTextProvider();

            //omapp.SendMessage("12574", "值班紀錄被查詢發送測試");
        }
    }
예제 #17
0
 protected void DropDownList8_DataBound(object sender, EventArgs e)
 {
     DropDownList10.DataBind();
 }
예제 #18
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            string Pri          = null;
            int    EstimatedMin = 0;

            if (DropDownList11.Text == "0 minutes")
            {
                EstimatedMin = 0;
            }
            else if (DropDownList11.Text == "5 minutes")
            {
                EstimatedMin = 5;
            }
            else if (DropDownList11.Text == "10 minutes")
            {
                EstimatedMin = 10;
            }
            else if (DropDownList11.Text == "15 minutes")
            {
                EstimatedMin = 15;
            }
            else if (DropDownList11.Text == "20 minutes")
            {
                EstimatedMin = 20;
            }
            else if (DropDownList11.Text == "25 minutes")
            {
                EstimatedMin = 25;
            }
            else if (DropDownList11.Text == "30 minutes")
            {
                EstimatedMin = 30;
            }
            else if (DropDownList11.Text == "35 minutes")
            {
                EstimatedMin = 35;
            }
            else if (DropDownList11.Text == "40 minutes")
            {
                EstimatedMin = 40;
            }
            else if (DropDownList11.Text == "45 minutes")
            {
                EstimatedMin = 45;
            }
            else if (DropDownList11.Text == "50 minutes")
            {
                EstimatedMin = 50;
            }
            else if (DropDownList11.Text == "55 minutes")
            {
                EstimatedMin = 55;
            }

            int EstimatedTime = (int)Char.GetNumericValue(DropDownList10.Text.ElementAt(0)) * 60 + EstimatedMin;

            if (DropDownList2.Text.Contains("1 - task requires <= 1 hour"))
            {
                Pri = "1";
            }
            else if (DropDownList2.Text.Contains("2 - task requires <= 2 hours"))
            {
                Pri = "2";
            }
            else if (DropDownList2.Text.Contains("3 - task requires <= 3 hours"))
            {
                Pri = "3";
            }
            else if (DropDownList2.Text.Contains("4 - task requires <= 4 hours"))
            {
                Pri = "4";
            }
            else if (DropDownList2.Text.Contains("5 - task requires <= 6 hours"))
            {
                Pri = "5";
            }

            string Dif = DropDownList3.SelectedValue;
            string skill1;
            string skill2;
            string skill3;

            if (DropDownList7.SelectedValue == "Assembly")
            {
                skill1 = "ASSEMBLY";
            }
            else if (DropDownList7.SelectedValue == "C++")
            {
                skill1 = "CPP";
            }
            else if (DropDownList7.SelectedValue == "C#")
            {
                skill1 = "CSHARP";
            }
            else if (DropDownList7.SelectedValue == "Java")
            {
                skill1 = "JAVA";
            }
            else if (DropDownList7.SelectedValue == "JavaScript")
            {
                skill1 = "JAVASCRIPT";
            }
            else if (DropDownList7.SelectedValue == "Python")
            {
                skill1 = "PYTHON";
            }
            else if (DropDownList7.SelectedValue == "SQL")
            {
                skill1 = "DB";
            }
            else
            {
                skill1 = DropDownList7.SelectedValue;
            }

            if (DropDownList8.SelectedValue == "Assembly")
            {
                skill2 = "ASSEMBLY";
            }
            else if (DropDownList8.SelectedValue == "C++")
            {
                skill2 = "CPP";
            }
            else if (DropDownList8.SelectedValue == "C#")
            {
                skill2 = "CSHARP";
            }
            else if (DropDownList8.SelectedValue == "Java")
            {
                skill2 = "JAVA";
            }
            else if (DropDownList8.SelectedValue == "JavaScript")
            {
                skill2 = "JAVASCRIPT";
            }
            else if (DropDownList8.SelectedValue == "Python")
            {
                skill2 = "PYTHON";
            }
            else if (DropDownList8.SelectedValue == "SQL")
            {
                skill2 = "DB";
            }
            else
            {
                skill2 = DropDownList8.SelectedValue;
            }

            if (DropDownList9.SelectedValue == "Assembly")
            {
                skill3 = "ASSEMBLY";
            }
            else if (DropDownList9.SelectedValue == "C++")
            {
                skill3 = "CPP";
            }
            else if (DropDownList9.SelectedValue == "C#")
            {
                skill3 = "CSHARP";
            }
            else if (DropDownList9.SelectedValue == "Java")
            {
                skill3 = "JAVA";
            }
            else if (DropDownList9.SelectedValue == "JavaScript")
            {
                skill3 = "JAVASCRIPT";
            }
            else if (DropDownList9.SelectedValue == "Python")
            {
                skill3 = "PYTHON";
            }
            else if (DropDownList9.SelectedValue == "SQL")
            {
                skill3 = "DB";
            }
            else
            {
                skill3 = DropDownList9.SelectedValue;
            }

            string skillr1 = DropDownList4.SelectedValue;
            string skillr2 = DropDownList5.SelectedValue;
            string skillr3 = DropDownList6.SelectedValue;

            if (DropDownList1.SelectedValue == " " || TextBox2.Text == "" || TextBox3.Text == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Please fill all the textboxes with the right data.');", true);
            }
            else if (skill1.Contains("-") && skill2.Contains("-") && skill3.Contains("-"))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Please fill all the textboxes with the right data.');", true);
            }
            else if ((Pri == "1" && EstimatedTime >= 60) || (Pri == "2" && EstimatedTime >= 120) || (Pri == "3" && EstimatedTime >= 180) || (Pri == "4" && EstimatedTime >= 240) || (Pri == "5" && EstimatedTime >= 360))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Estimated Time must corespond to Priority Level.');", true);
            }
            else
            {
                string mesage = "4" + DropDownList1.Text + "|" + TextBox2.Text + "|" + TextBox3.Text + "|" + Pri + "|" + Dif + "|" + EstimatedTime;
                int    prim   = 0;
                if (!skill1.Contains("-"))
                {
                    if (skillr1 == "10")
                    {
                        skillr1 = "9";
                    }
                    mesage += "|" + skill1 + ":" + skillr1 + ";";
                    prim++;
                }
                if (!skill2.Contains("-"))
                {
                    if (skillr2 == "10")
                    {
                        skillr2 = "9";
                    }
                    if (prim != 0)
                    {
                        mesage += skill2 + ":" + skillr2 + ";";
                    }
                    if (prim == 0)
                    {
                        mesage += "|" + skill2 + ":" + skillr2 + ";";
                        prim++;
                    }
                }
                if (!skill3.Contains("-"))
                {
                    if (skillr3 == "10")
                    {
                        skillr3 = "9";
                    }
                    if (prim != 0)
                    {
                        mesage += skill3 + ":" + skillr3 + ";";
                    }
                    if (prim == 0)
                    {
                        mesage += "|" + skill3 + ":" + skillr3 + ";";
                    }
                }



                send_msg(tc, ns, mesage);

                string recv_mess = recv_msg(ns);

                string[] pop = recv_mess.Split(new Char[] { ':', ';' });

                if (pop[0][0] == '1')
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Task sent');", true);
                    DropDownList1.ClearSelection();
                    TextBox2.Text = "";
                    TextBox3.Text = "";
                    DropDownList2.ClearSelection();
                    DropDownList3.ClearSelection();
                    DropDownList4.ClearSelection();
                    DropDownList5.ClearSelection();
                    DropDownList6.ClearSelection();
                    DropDownList7.ClearSelection();
                    DropDownList8.ClearSelection();
                    DropDownList9.ClearSelection();
                    DropDownList10.ClearSelection();
                    DropDownList11.ClearSelection();
                    //Response.Redirect("SendATask.aspx");
                    Response.AppendHeader("Refresh", "1");
                }
                else
                {
                    string aux = pop[0];
                    aux    = aux.Remove(0, 1);
                    pop[0] = aux;
                    string mesaj = "";

                    for (int i = 0; i < pop.Length; i++)
                    {
                        string s = pop[i];

                        if (s.Trim() != "")
                        {
                            if (s.Contains("0") || s.Contains("1") || s.Contains("2") || s.Contains("3") || s.Contains("4") || s.Contains("5") || s.Contains("6") || s.Contains("7") || s.Contains("8") || s.Contains("9") || s.Contains("10"))
                            {
                                mesaj += ": " + s + "; ";
                            }
                            else if (s.Contains("ASSEMBLY"))
                            {
                                mesaj += "Assembly";
                            }
                            else if (s.Contains("CPP"))
                            {
                                mesaj += "C++";
                            }
                            else if (s.Contains("CSHARP"))
                            {
                                mesaj += "C#";
                            }
                            else if (s.Contains("JAVA"))
                            {
                                mesaj += "Java";
                            }
                            else if (s.Contains("JAVASCRIPT"))
                            {
                                mesaj += "JavaScript";
                            }
                            else if (s.Contains("PYTHON"))
                            {
                                mesaj += "Python";
                            }
                            else if (s.Contains("DB"))
                            {
                                mesaj += "SQL";
                            }
                            else
                            {
                                mesaj += s;
                            }
                        }
                    }
                    string popup = "alert(' Closest skills are: " + mesaj + "');";

                    Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", popup, true); //printez siru
                }
            }
        }