示例#1
0
 public bool Update(Empdata emp)
 {
     using (var db = new chinniDBEntities1())
     {
         db.Entry(emp).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
     return(true);
 }
示例#2
0
 public bool SaveEmployee(Empdata emp)
 {
     using (var db = new chinniDBEntities1())
     {
         db.Empdatas.Add(emp);
         db.SaveChanges();
     }
     return(true);
 }
示例#3
0
 public bool Delete(Empdata emp)
 {
     using (var del = new chinniDBEntities1())
     {
         del.Entry(emp).State = EntityState.Deleted;
         del.SaveChanges();
     }
     return(true);
 }
示例#4
0
        //public bool DeleteEmployee(Empdata emp)
        //{
        //    using (var db = new chinniDBEntities())
        //    {
        //        db.Entry(emp).State = EntityState.Deleted;
        //        db.SaveChanges();

        //    }
        //    return true;
        //}

        public List <Empdata> GetData()
        {
            List <Empdata> list = new List <Empdata>();

            using (var data = new chinniDBEntities1())
            {
                list = (from d in data.Empdatas select d).ToList();
            }
            return(list);
        }