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); }
public int DeleteUserById(int Id) { TestDBEntities tstDb = new TestDBEntities(); InfoUser usrdtl = new InfoUser(); usrdtl.ID = Id; tstDb.Entry(usrdtl).State = EntityState.Deleted; int Retval = tstDb.SaveChanges(); return(Retval); }
public int UpdateUser(int Id, string Name, string Email) { TestDBEntities tstDb = new TestDBEntities(); UserDetail usrdtl = new UserDetail(); usrdtl.Id = Id; usrdtl.Name = Name; usrdtl.Email = Email; tstDb.Entry(usrdtl).State = EntityState.Modified; int Retval = tstDb.SaveChanges(); return(Retval); }
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); }