Esempio n. 1
0
 protected void SelectUnit([AllowNull, MaybeNull] CareUnit unit)
 {
     if (SelectedCareUnit != null && unit != null && SelectedCareUnit?.CareUnitId == unit.CareUnitId)
     {
         SelectedCareUnit = null !;
     }
     else
     {
         SelectedCareUnit = unit;
     }
     StateHasChanged();
 }
 public ActionResult AddCareUnit(MedicalPlaceProfileViewModel model)
 {
     if (ModelState.IsValid)
     {
         CareUnit careunit = new CareUnit()
         {
             Name               = model.NewCareUnit.Name,
             Description        = model.NewCareUnit.Description,
             Cost               = model.NewCareUnit.Cost,
             LastUpdate         = model.NewCareUnit.LastUpdate,
             CareUnitTypeID     = model.NewCareUnit.CareUnitTypeID,
             AvailableRoomCount = model.NewCareUnit.AvailableRoomCount,
             ProviderID         = model.NewCareUnit.ProviderID
         };
         CareUnitBusinessLayer.AddCareUnit(careunit);
     }
     return(ProfilePage(model.MedicalPlaceID));
 }
Esempio n. 3
0
 public void AddCareUnit(CareUnit careunit)
 {
     DBEntities.CareUnits.Add(careunit);
     DBEntities.SaveChanges();
 }
Esempio n. 4
0
 public void UpdateCareUnit(CareUnit careunit)
 {
     DBEntities.CareUnits.Attach(careunit);
     DBEntities.Entry(careunit).State = EntityState.Modified;
     DBEntities.SaveChanges();
 }