Exemplo n.º 1
0
        //Get the details of a particular friend

        public Owes GetOwesData(int id)

        {
            try

            {
                Owes owes = db.Owes.Find(id);

                return(owes);
            }

            catch

            {
                throw;
            }
        }
Exemplo n.º 2
0
        //To Add new employee record

        public int AddOwes(Owes owes)

        {
            try

            {
                db.Owes.Add(owes);

                db.SaveChanges();

                return(1);
            }

            catch

            {
                throw;
            }
        }
Exemplo n.º 3
0
        //To Delete the record of a particular employee

        public int DeleteOwes(int id)

        {
            try

            {
                Owes frd = db.Owes.Find(id);

                db.Owes.Remove(frd);

                db.SaveChanges();

                return(1);
            }

            catch

            {
                throw;
            }
        }
Exemplo n.º 4
0
        //To Update the records of a particluar friend

        public int UpdateOwes(Owes owes)

        {
            try

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

                db.SaveChanges();



                return(1);
            }

            catch

            {
                throw;
            }
        }