Пример #1
0
        //Get the details of a particular employee

        public AdmArea GetAreaData(int id)

        {
            try

            {
                AdmArea area = db.AdmArea.Find(id);

                return(area);
            }

            catch

            {
                throw;
            }
        }
Пример #2
0
        //To Update the records of a particluar employee

        public int UpdateArea(AdmArea area)

        {
            try

            {
                db.Entry(area).State = EntityState.Modified;

                db.SaveChanges();

                return(1);
            }

            catch

            {
                throw;
            }
        }
Пример #3
0
        //To Add new employee record

        public int AddArea(AdmArea area)

        {
            try

            {
                db.AdmArea.Add(area);

                db.SaveChanges();

                return(1);
            }

            catch

            {
                throw;
            }
        }
Пример #4
0
        //To Delete the record of a particular employee

        public int DeleteArea(int id)

        {
            try

            {
                AdmArea area = db.AdmArea.Find(id);

                db.AdmArea.Remove(area);

                db.SaveChanges();

                return(1);
            }

            catch

            {
                throw;
            }
        }