예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                // Instantiate the DataServiceContext.
                context = new db_exerciseEntities(svcUri);

                // Define a LINQ query that returns Orders and
                // Order_Details for a specific customer.
                // var questionQuery = from o in context.Orders.Expand("Order_Details")
                //                  where o.Customers.CustomerID == customerId
                //                 select o;
                var questionQuery = from o in context.mchoiceQues
                                    select new { o.id, o.question, o.objective, o.con };
                //select o;
                // Create an DataServiceCollection<T> based on
                // execution of the LINQ query for Orders.
                // DataServiceCollection<mchoiceQues> mques = new DataServiceCollection<mchoiceQues>(questionQuery);
                // questionQuery.ToList();

                quesView.DataSource = questionQuery.ToList();



                // Make the DataServiceCollection<T> the binding source for the Grid.
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #2
0
        public paramst()
        {
            String WCFIPstr = ConfigurationManager.AppSettings["WCFIP"].ToString();

            context = new db_exerciseEntities(new Uri(WCFIPstr));
            // context = new db_exerciseEntities(svcUri);
            st = new StudInfo();
        }
예제 #3
0
        public param()
        {
            String WCFIPstr = ConfigurationManager.AppSettings["WCFIP"].ToString();

            context = new db_exerciseEntities(new Uri(WCFIPstr));
            String maxstr = ConfigurationManager.AppSettings["maxsize"].ToString();

            maxsize = long.Parse(maxstr);
        }
예제 #4
0
 private void adde_Load(object sender, EventArgs e)
 {
     context = pp.context;
     lcs     = pp.ltea_c;
     comboBox5.DataSource    = lcs;
     comboBox5.ValueMember   = "CourseName";
     comboBox5.Text          = "";
     comboBox4.SelectedIndex = 0;
 }
예제 #5
0
        private void addmq_Load(object sender, EventArgs e)
        {
            context = pp.context;

            /*  var questionQuery = from o in context.Course
             *                    select o;
             * lcs = questionQuery.ToList<Course>();*/
            lcs = pp.ltea_c;
            comboBox5.DataSource = lcs;

            comboBox5.ValueMember = "CourseName";

            comboBox5.Text = "";
        }
예제 #6
0
        private void addA_Load(object sender, EventArgs e)
        {
            context = pp.context;

            /* var questionQuery = from o in context.Course
             *                   select o;
             * lcs = questionQuery.ToList<Course>();*/
            lcs = pp.ltea_c;
            comboBox5.DataSource = lcs;

            comboBox5.ValueMember = "CourseName";

            comboBox5.Text = "";
            // String maxstr = ConfigurationManager.AppSettings["maxsize"].ToString();
            // maxsize = long.Parse(maxstr);
        }
예제 #7
0
        private void exerList_Load(object sender, EventArgs e)
        {
            context = pp.context;

            /*var questionQuery = from o in context.Course
             *                  select o;
             * lcs = questionQuery.ToList<Course>();
             *
             */
            lcs = pp.ltea_c;

            comboBox1.DataSource  = lcs;
            comboBox1.ValueMember = "CourseName";
            // listBox1.Items.Clear();
            // listBox2.Items.Clear();
            // comboBox1.Text = "";
        }
예제 #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                // Instantiate the DataServiceContext.
                context = new db_exerciseEntities(svcUri);

                // Define a LINQ query that returns Orders and
                // Order_Details for a specific customer.
                // var questionQuery = from o in context.Orders.Expand("Order_Details")
                //                  where o.Customers.CustomerID == customerId
                //                 select o;
                var questionQuery = from o in context.mchoiceQues
                                    where o.id == 5
                                    select o;


                mchoiceQues mcq = questionQuery.First <mchoiceQues>();
                comboBox1.Text = (mcq.objective).ToString();
                comboBox2.Text = (mcq.con).ToString();
                comboBox3.Text = (mcq.diff).ToString();
                comboBox4.Text = (mcq.answ).ToString();

                ////////////read richtext

                System.IO.MemoryStream mstream = new System.IO.MemoryStream(mcq.question, false);
                this.rquestion.LoadFile(mstream, RichTextBoxStreamType.RichText);

                //////end read richtext


                // Make the DataServiceCollection<T> the binding source for the Grid.
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #9
0
 public exerList(param p)
 {
     InitializeComponent();
     pp      = p;
     context = p.context;
 }
예제 #10
0
 public addS(param p)
 {
     InitializeComponent();
     pp      = p;
     context = p.context;
 }
예제 #11
0
 public classinfoF(param p)
 {
     InitializeComponent();
     pp      = p;
     context = p.context;
 }