Exemple #1
0
 public bool AddNameForBed(BedName bedName)
 {
     logger.EnterMethod();
     try
     {
         var existBedName = this._iBedNameRepositories.Get(_ => (
                                                               _.BedId == bedName.BedId &&
                                                               _.LanguageId == bedName.LanguageId
                                                               ));
         if (existBedName != null)
         {
             logger.Info("Exist bed with Id: [" + bedName.BedId + "] and LanguageId: [" + bedName.LanguageId + "]");
             return(false);
         }
         using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required))
         {
             this._iBedNameRepositories.Add(bedName);
             transactionScope.Complete();
         }
         this._iUnitOfWork.Save();
         logger.Info("Insert new bed name for bed with Id: [" + bedName.BedId + "], name value: [" + bedName.Name + "] in language with Id: [" + bedName.LanguageId + "]");
         return(true);
     }
     catch (Exception e)
     {
         logger.Error("Error: [" + e.Message + "]");
         return(false);
     }
     finally
     {
         logger.LeaveMethod();
     }
 }
 public bool AddNameForBed(BedName bedName)
 {
     logger.EnterMethod();
     try
     {
         return(this._iBedRepositories.AddNameForBed(bedName));
     }
     catch (Exception e)
     {
         logger.Error("Error: [" + e.Message + "]");
         return(false);
     }
     finally
     {
         logger.LeaveMethod();
     }
 }
Exemple #3
0
 internal static VM_BedName BedName_To_VMBedName(BedName bedName)
 {
     logger.EnterMethod();
     try
     {
         return(new VM_BedName()
         {
             Name = bedName.Name,
             LanguageId = bedName.LanguageId,
             BedId = bedName.BedId
         });
     }
     catch (Exception e)
     {
         logger.Error("Error: [" + e.Message + "]");
         return(null);
     }
     finally
     {
         logger.LeaveMethod();
     }
 }