Exemplo n.º 1
0
        public int DeleteUserById(int Id)
        {
            TestDBEntities tstDb  = new TestDBEntities();
            Specialization usrspc = new Specialization();
            ContactInfo    usrctn = new ContactInfo();
            Physician      usrdtl = new Physician();

            usrspc.Id = Id;
            usrctn.Id = Id;
            usrdtl.Id = Id;
            tstDb.Entry(usrspc).State = EntityState.Deleted;
            tstDb.Entry(usrctn).State = EntityState.Deleted;
            tstDb.Entry(usrdtl).State = EntityState.Deleted;
            int Retval = tstDb.SaveChanges();

            return(Retval);
        }
Exemplo n.º 2
0
        public int UpdateUser(int Id, string FirstName, string MiddleName, string LastName, DateTime BirthDate, string Gender, int?Weight, int?Height, string HomeAddress, Int64?HomePhone, string OfficeAddress, Int64 OfficePhone, string EmailAdd, Int64?CellphoneNumber, string Name, string Description)
        {
            TestDBEntities tstDb  = new TestDBEntities();
            Physician      usrdtl = new Physician();


            usrdtl.Id         = Id;
            usrdtl.FirstName  = FirstName;
            usrdtl.MiddleName = MiddleName;
            usrdtl.LastName   = LastName;
            usrdtl.BirthDate  = BirthDate;
            usrdtl.Gender     = Gender;
            usrdtl.Weight     = Weight;
            usrdtl.Height     = Height;
            ContactInfo usrctn = new ContactInfo();

            usrctn.Id              = Id;
            usrctn.HomeAddress     = HomeAddress;
            usrctn.HomePhone       = HomePhone;
            usrctn.OfficeAddress   = OfficeAddress;
            usrctn.OfficePhone     = OfficePhone;
            usrctn.EmailAdd        = EmailAdd;
            usrctn.CellphoneNumber = CellphoneNumber;
            Specialization usrspc = new Specialization();

            usrspc.Id          = Id;
            usrspc.Name        = Name;
            usrspc.Description = Description;

            tstDb.Entry(usrdtl).State = EntityState.Modified;
            tstDb.Entry(usrctn).State = EntityState.Modified;
            tstDb.Entry(usrspc).State = EntityState.Modified;
            int Retval = tstDb.SaveChanges();

            return(Retval);
        }