protected void Button6_Click(object sender, EventArgs e)
 {
     DbCompanyEntities ce = new DbCompanyEntities();
     var recs = from tab in ce.Emps where tab.Job == TxtJob.Text select tab;
     GridView1.DataSource = recs;
     GridView1.DataBind();
 }
 protected void Button5_Click(object sender, EventArgs e)
 {
     DbCompanyEntities ce = new DbCompanyEntities();
     var recs = ce.Emps ;
     GridView1.DataSource = recs;
     GridView1.DataBind();
 }
Beispiel #3
0
        protected void Button6_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();
            var recs             = from tab in ce.Emps where tab.Job == TxtJob.Text select tab;

            GridView1.DataSource = recs;
            GridView1.DataBind();
        }
Beispiel #4
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();
            var recs             = ce.Emps;

            GridView1.DataSource = recs;
            GridView1.DataBind();
        }
        protected void Button4_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();

            short empno = short.Parse(TxtEmpno.Text);
            Emp context = ce.Emps.SingleOrDefault(col => col.Empno == empno);
            ce.DeleteObject(context);
            ce.SaveChanges();
        }
Beispiel #6
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();

            short empno   = short.Parse(TxtEmpno.Text);
            Emp   context = ce.Emps.SingleOrDefault(col => col.Empno == empno);

            ce.DeleteObject(context);
            ce.SaveChanges();
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();

            short empno = short.Parse( TxtEmpno.Text);
            Emp context = ce.Emps.SingleOrDefault(col => col.Empno == empno);

            TxtName.Text = context.Ename;
            TxtJob.Text = context.Job;
            TxtSalary.Text = context.Salary.ToString();
        }
Beispiel #8
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DbCompanyEntities ce = new DbCompanyEntities();

            short empno   = short.Parse(TxtEmpno.Text);
            Emp   context = ce.Emps.SingleOrDefault(col => col.Empno == empno);

            TxtName.Text   = context.Ename;
            TxtJob.Text    = context.Job;
            TxtSalary.Text = context.Salary.ToString();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            #region Create a record
            Emp rec = new Emp();
            rec.Empno = short.Parse(TxtEmpno.Text);
            rec.Ename = TxtName.Text;
            rec.Job = TxtJob.Text;
            rec.Salary = short.Parse(TxtSalary.Text);
            #endregion

            #region Add employ into db and save changes
            DbCompanyEntities dce = new DbCompanyEntities();
            dce.AddToEmps(rec);
            dce.SaveChanges();
            #endregion
        }
Beispiel #10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            #region Create a record
            Emp rec = new Emp();
            rec.Empno  = short.Parse(TxtEmpno.Text);
            rec.Ename  = TxtName.Text;
            rec.Job    = TxtJob.Text;
            rec.Salary = short.Parse(TxtSalary.Text);
            #endregion

            #region Add employ into db and save changes
            DbCompanyEntities dce = new DbCompanyEntities();
            dce.AddToEmps(rec);
            dce.SaveChanges();
            #endregion
        }