Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 案例12:Label11.Text=split[11]; 会话[“l11”]=Label11.Text; Label10.Text=split[10]; 复选框6.Visible=true; 后藤案10; 案例10:Label9.Text=split[9]_C#_Asp.net_Checkbox - Fatal编程技术网

C# 案例12:Label11.Text=split[11]; 会话[“l11”]=Label11.Text; Label10.Text=split[10]; 复选框6.Visible=true; 后藤案10; 案例10:Label9.Text=split[9]

C# 案例12:Label11.Text=split[11]; 会话[“l11”]=Label11.Text; Label10.Text=split[10]; 复选框6.Visible=true; 后藤案10; 案例10:Label9.Text=split[9],c#,asp.net,checkbox,C#,Asp.net,Checkbox,案例12:Label11.Text=split[11]; 会话[“l11”]=Label11.Text; Label10.Text=split[10]; 复选框6.Visible=true; 后藤案10; 案例10:Label9.Text=split[9]; 会话[“l9”]=Label9.Text; Label8.Text=split[8]; 复选框5.Visible=true; 后藤案8; 案例8:Label7.Text=split[7]; 会话[“l7”]=Label7.Text; Lab

案例12:Label11.Text=split[11]; 会话[“l11”]=Label11.Text; Label10.Text=split[10]; 复选框6.Visible=true; 后藤案10; 案例10:Label9.Text=split[9]; 会话[“l9”]=Label9.Text; Label8.Text=split[8]; 复选框5.Visible=true; 后藤案8; 案例8:Label7.Text=split[7]; 会话[“l7”]=Label7.Text; Label6.Text=split[6]; 复选框4.Visible=true; 后藤案6; 案例6:Label5.Text=split[5]; 会话[“l5”]=Label5.文本; Label4.Text=split[4]; 复选框3.Visible=true; 后藤案4; 案例4:Label3.Text=split[3]; 会话[“l3”]=Label3.Text; Label2.Text=split[2]; 复选框2.Visible=true; 转到案例2; 案例2:Label1.Text=split[1]; 会话[“l1”]=标签1.文本; Label0.Text=split[0]; 复选框1.Visible=true; 打破 } } 其他的 { lbltime.Text=“享受周末”; lbltime.Visible=true; } } 受保护的无效日历1\u选择已更改(对象发件人、事件参数e) { CheckBox1.Checked=false; CheckBox2.Checked=false; CheckBox3.Checked=false; CheckBox4.Checked=false; CheckBox5.Checked=false; CheckBox6.Checked=false; CheckBox7.Checked=false; CheckBox8.Checked=false; } 受保护的无效复选框1\u CheckedChanged(对象发送方,事件参数e) { if(CheckBox1.Checked==true) { string sub=Session[“l1”].ToString(); 字符串userid=Session[“uname”].ToString(); 字符串日期=会话[“天]。ToString(); 字符串tempclass=Session[“uclass”].ToString(); SqlConnection con4=newsqlconnection(@“数据源=。\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App\u Data\student.mdf;集成安全性=True;用户实例=True”); SqlCommand cmd4=新的SqlCommand(“插入到“+tempclass+”轨迹值(“+userid+”、“+sub+”、“+date+”)、con4); con4.Open(); cmd4.ExecuteOnQuery(); con4.Close(); } 其他的 { Label18.Text=“uncheck”;//临时检查此块是否执行 } } 受保护的无效复选框2\u CheckedChanged(对象发送方,事件参数e) { if(CheckBox2.Checked==true) { string sub=Session[“l3”].ToString(); 字符串userid=Session[“uname”].ToString(); 字符串日期=会话[“天]。ToString(); 字符串tempclass=Session[“uclass”].ToString(); SqlConnection con4=newsqlconnection(@“数据源=。\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App\u Data\student.mdf;集成安全性=True;用户实例=True”); SqlCommand cmd4=新的SqlCommand(“插入到“+tempclass+”轨迹值(“+userid+”、“+sub+”、“+date+”)、con4); con4.Open(); cmd4.ExecuteOnQuery(); con4.Close(); //重定向(“tracker.aspx”); } 其他的 { } } 受保护的无效复选框3\u CheckedChanged(对象发送方,事件参数e) { if(CheckBox3.Checked==true) { string sub=Session[“l5”].ToString(); 字符串userid=Session[“uname”].ToString(); 字符串日期=会话[“天]。ToString(); 字符串tempclass=Session[“uclass”].ToString(); SqlConnection con4=newsqlconnection(@“数据源=。\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App\u Data\student.mdf;集成安全性=True;用户实例=True”); SqlCommand cmd4=新的SqlCommand(“插入到“+tempclass+”轨迹值(“+userid+”、“+sub+”、“+date+”)、con4); con4.Open(); cmd4.ExecuteOnQuery(); con4.Close(); //重定向(“tracker.aspx”); } 其他的 { } } 受保护的无效复选框4\u CheckedChanged(对象发送方,事件参数e) { if(CheckBox4.Checked==true) { string sub=Session[“l7”].ToString(); 字符串userid=Session[“uname”].ToString(); 字符串日期=会话[“天]。ToString(); 字符串tempclass=Session[“uclass”].ToString(); SqlConnection con4=newsqlconnection(@“数据源=。\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App\u Data\student.mdf;集成安全性=True;用户实例=True”); SqlCommand cmd4=新的SqlCommand(“插入到“+tempclass+”轨迹值(“+userid+”、“+sub+”、“+date+”)、con4); con4.Open(); cmd4.ExecuteOnQuery(); con4.Close(); //重定向(“tracker.aspx”); } 其他的 { } } 受保护的无效复选框5\u CheckedChanged(对象发送方,事件参数e) { if(CheckBox5.Checked==true) { string sub=Session[“l9”].ToString(); 一串
namespace portal

{

    public partial class tracker : System.Web.UI.Page
    {

        String[] split; string day;
        protected void Page_Load(object sender, EventArgs e)
        {

            /* if (Session["uname"] == null)
             {
                 Response.Redirect("Firstpage.aspx");
             }*/
            String[] split = new String[16];
            DateTime d1 = DateTime.Today;
            string month = d1.ToString("MMMM");
            Lblmonth.Text = month;
            String userid = Session["uname"].ToString();
            SqlConnection con2 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
            SqlCommand cmd2 = new SqlCommand("select sbranch ,syear from studdetails where userid=@userid ", con2);
            cmd2.Parameters.AddWithValue("userid", userid);
            String branch = "", year = "";
            SqlDataReader rdr2 = null;
            con2.Open();
            rdr2 = cmd2.ExecuteReader();
            while (rdr2.Read())
            {
                branch = rdr2["sbranch"].ToString();
                year = rdr2["syear"].ToString();
            }
            con2.Close();
            int sem = 0;
            switch (year)
            {
                case "B.E": sem = 8;
                    break;
                case "T.E": sem = 6;
                    break;
                case "S.E": sem = 4;
                    break;
                case "F.E": sem = 2;
                    break;
                default: sem = 2;
                    break;

            }

            int tempmonth = (int)(d1.Month);
            if (tempmonth > 6)
                sem = sem - 1;



            SqlConnection con3 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
            SqlCommand cmd3 = new SqlCommand("select subject from subjecttable where department=@dept and semester=@sem ", con3);
            cmd3.Parameters.AddWithValue("dept", branch);
            cmd3.Parameters.AddWithValue("sem", sem);
            con3.Open();
            SqlDataReader rdr3 = null;
            rdr3 = cmd3.ExecuteReader();
            string subject = "";
            while (rdr3.Read())
            {
                subject = rdr3["subject"].ToString();

            }
            con3.Close();
            Char[] separator = new Char[] { ',' };
            String[] subsplit = subject.Split(separator);
            int size = subsplit.Length;
            switch (size)
            {
                case 6: subj6.Text = subsplit[5];
                    goto case 5;
                case 5: subj5.Text = subsplit[4];
                    goto case 4;
                case 4: subj4.Text = subsplit[3];
                    goto case 3;
                case 3: subj3.Text = subsplit[2];
                    goto case 2;
                case 2: subj2.Text = subsplit[1];
                    goto case 1;
                case 1: subj1.Text = subsplit[0];
                    break; ;

            }

        }
        protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        {
            if (e.Day.IsWeekend)
            {
                e.Cell.BackColor = System.Drawing.Color.DarkBlue;
            }
            else
            {
                e.Cell.BackColor = System.Drawing.Color.LightBlue;
            }
            SelectedDatesCollection dates = Calendar1.SelectedDates;

            DateTime toDay = DateTime.Today;
            string days = toDay.ToLongDateString();

            Labelday.Text = days;
            Char[] separator = new Char[] { ',' };
            String[] split1 = days.Split(separator);
            day = split1[0];
            Session["day"] = Calendar1.SelectedDate.ToShortDateString();
            if (dates.Count > 0)
            {
                Labelday.Text = dates[0].ToLongDateString() + "<br />";
                String temp = Labelday.Text;
                split1 = temp.Split(separator);
                day = split1[0];
            }
            if (!(day.Equals("Saturday") || day.Equals("Sunday")))
            {
                SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                string cla = Convert.ToString(Session["uclass"]);
                SqlCommand cmd = new SqlCommand("select " + day + " from studtimetable where class = @class ", con);

                con.Open();
                cmd.Parameters.AddWithValue("class", cla);
                SqlDataReader rdr = null;
                String tt = "";
                rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    tt = rdr[day].ToString();
                }
                con.Close();

                split = tt.Split(separator);
                int size = split.Length;
                lbltime.Visible = true;
                Lblsubj.Visible = true;
                Lblatt.Visible = true;
                switch (size)
                {
                    case 16: Label15.Text = split[15];
                        Session["l15"] = Label15.Text;
                        Label14.Text = split[14];
                        CheckBox8.Visible = true;

                        goto case 14;
                    case 14: Label13.Text = split[13];
                        Session["l13"] = Label13.Text;
                        Label12.Text = split[12];
                        CheckBox7.Visible = true;
                        goto case 12;
                    case 12: Label11.Text = split[11];
                        Session["l11"] = Label11.Text;
                        Label10.Text = split[10];
                        CheckBox6.Visible = true;
                        goto case 10;
                    case 10: Label9.Text = split[9];
                        Session["l9"] = Label9.Text;
                        Label8.Text = split[8];
                        CheckBox5.Visible = true;
                        goto case 8;
                    case 8: Label7.Text = split[7];
                        Session["l7"] = Label7.Text;
                        Label6.Text = split[6];
                        CheckBox4.Visible = true;
                        goto case 6;
                    case 6: Label5.Text = split[5];
                        Session["l5"] = Label5.Text;
                        Label4.Text = split[4];
                        CheckBox3.Visible = true;
                        goto case 4;
                    case 4: Label3.Text = split[3];
                        Session["l3"] = Label3.Text;
                        Label2.Text = split[2];
                        CheckBox2.Visible = true;
                        goto case 2;
                    case 2: Label1.Text = split[1];
                        Session["l1"] = Label1.Text;
                        Label0.Text = split[0];
                        CheckBox1.Visible = true;
                        break;

                }

            }
            else
            {
                lbltime.Text = "Enjoy weekend";
                lbltime.Visible = true;
            }
        }
        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {

            CheckBox1.Checked = false;

            CheckBox2.Checked = false;

            CheckBox3.Checked = false;

            CheckBox4.Checked = false;

            CheckBox5.Checked = false;

            CheckBox6.Checked = false;

            CheckBox7.Checked = false;

            CheckBox8.Checked = false;
        }



        protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox1.Checked == true)
            {
                string sub = Session["l1"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();


            }
            else
            {
                Label18.Text = "uncheck";//temporary to check if this block executes
            }
        }



        protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
        {

            if (CheckBox2.Checked == true)
            {
                string sub = Session["l3"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }

        }

        protected void CheckBox3_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox3.Checked == true)
            {
                string sub = Session["l5"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }

        }

        protected void CheckBox4_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox4.Checked == true)
            {
                string sub = Session["l7"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {

            }

        }

        protected void CheckBox5_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox5.Checked == true)
            {
                string sub = Session["l9"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }
        }

        protected void CheckBox6_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox6.Checked == true)
            {
                string sub = Session["l11"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }
        }

        protected void CheckBox7_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox7.Checked == true)
            {
                string sub = Session["l13"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }

        }

        protected void CheckBox8_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox8.Checked == true)
            {
                string sub = Session["l15"].ToString();
                string userid = Session["uname"].ToString();
                string date = Session["day"].ToString();
                string tempclass = Session["uclass"].ToString();

                SqlConnection con4 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\mmm\portal\App_Data\student.mdf;Integrated Security=True;User Instance=True");
                SqlCommand cmd4 = new SqlCommand("insert into " + tempclass + "track values ('" + userid + "','" + sub + "','" + date + "')", con4);
                con4.Open();

                cmd4.ExecuteNonQuery();
                con4.Close();

                //Response.Redirect("tracker.aspx");
            }
            else
            {
            }
        }
    }
}