Ejemplo n.º 1
0
    void fill()
    {
        arvindEntities db = new arvindEntities();
        GridView1.DataSource = db.results;
        GridView1.DataBind();

    }
Ejemplo n.º 2
0
    public void chck()
    {
        arvindEntities db = new arvindEntities();
        var q = from m in db.results
                //where m.id == 2
                select m;
        foreach (var a in q)
        {
            if ("year" == DropDownList1.SelectedItem.Text && a.results == "year")
            {
                
               // Response.Write("<script>alert('y')</script>");
                foreach (var b in q)
                {
                    if (b.results == "month" || b.results == "week")
                    {
                        Response.Write("<script>alert('yooooooooo')</script>");

                    }

                }
            
            
            }


            if ("month" == DropDownList1.SelectedItem.Text && a.results == "month")
            {
                foreach (var b in q)
                {
                    if (b.results == "week")
                    {
                        Response.Write("<script>alert('m')</script>");

                    }
                }
                
            }



            if ("week" == DropDownList1.SelectedItem.Text && a.results == "week")
            {
               
                
            }

        
        }
    }
Ejemplo n.º 3
0
 public void delte()
 {
     try
     {
         arvindEntities db = new arvindEntities();
         List<result> em = db.ExecuteStoreQuery<result>("delete from results").ToList();
        
        
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
     Response.Write("<script>alert('Record has Delete')</script>");
     fill();
 }
Ejemplo n.º 4
0
    public void chck() {
        arvindEntities db = new arvindEntities();
        var q = from m in db.results
                where m.id==1
                select m;
        foreach (var a in q)
        {
            //GridView1.DataSource = q;
           // GridView1.DataBind();
            




        }
    
    }
Ejemplo n.º 5
0
    void insert()
    {
        try
        {
            arvindEntities db = new arvindEntities();
            int a;
            a = int.Parse(TextBox1.Text);
            result em = new result();
            em.id = a;
            em.results = DropDownList1.SelectedItem.Text;
            em.Mark = TextBox2.Text;
            em.Attendance = TextBox3.Text;
            db.AddToresults(em);
            db.SaveChanges();
            Response.Write("<script>alert('Record has save')</script>");
            fill();
        }
        catch (Exception e) {
           // Response.Write("<script>alert('same primary key insert''" + e.Message + "')</script>");
            Console.WriteLine("same primary key insert", e.Message);

        }
    }
Ejemplo n.º 6
0
    public Default4()
    {

        db = new arvindEntities();
    }