Esempio n. 1
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > AddReferral(ReferralAddDTO ReferralAddDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate AddReferral for nullability before prepaing the response.

                if (await ReferralAppService.AddReferral(ReferralAddDTO))
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
 /// <summary>
 /// Add Referral AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> AddReferral(ReferralAddDTO referralAddDTO)
 {
     #region Declare a return type with initial value.
     bool isCreated = false;
     #endregion
     try
     {
         if (referralAddDTO != null)
         {
             isCreated = await ReferralBusinessMapping.AddReferral(referralAddDTO);
         }
     }
     catch (Exception exception) {}
     return(isCreated);
 }
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<Referral></returns>
 public Referral MappingReferralAddDTOToReferral(ReferralAddDTO ReferralAddDTO)
 {
     #region Declare a return type with initial value.
     Referral Referral = null;
     #endregion
     try
     {
         Referral = new Referral
         {
             ReferralName = ReferralAddDTO.ReferralName,
             CreationDate = DateTime.Now,
             IsDeleted    = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(Referral);
 }