Exemple #1
0
 /// <summary>
 /// Add TypeOfJob AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> AddTypeOfJob(TypeOfJobAddDTO typeOfJobAddDTO)
 {
     #region Declare a return type with initial value.
     bool isCreated = false;
     #endregion
     try
     {
         if (typeOfJobAddDTO != null)
         {
             isCreated = await TypeOfJobBusinessMapping.AddTypeOfJob(typeOfJobAddDTO);
         }
     }
     catch (Exception exception) {}
     return(isCreated);
 }
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<TypeOfJob></returns>
 public TypeOfJob MappingTypeOfJobAddDTOToTypeOfJob(TypeOfJobAddDTO TypeOfJobAddDTO)
 {
     #region Declare a return type with initial value.
     TypeOfJob TypeOfJob = null;
     #endregion
     try
     {
         TypeOfJob = new TypeOfJob
         {
             TypeOfJobName = TypeOfJobAddDTO.TypeOfJobName,
             CreationDate  = DateTime.Now,
             IsDeleted     = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(TypeOfJob);
 }
Exemple #3
0
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddTypeOfJob(TypeOfJobAddDTO TypeOfJobAddDTO)
        {
            #region Declare a return type with initial value.
            bool isTypeOfJobCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                TypeOfJob TypeOfJob = null;
                #endregion
                TypeOfJob = TypeOfJobMapping.MappingTypeOfJobAddDTOToTypeOfJob(TypeOfJobAddDTO);
                if (TypeOfJob != null)
                {
                    await UnitOfWork.TypeOfJobRepository.Insert(TypeOfJob);

                    isTypeOfJobCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isTypeOfJobCreated);
        }