/// <summary>
 /// Updae Referral AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> UpdateReferral(ReferralUpdateDTO referralUpdateDTO)
 {
     #region Declare a return type with initial value.
     bool isUpdated = false;
     #endregion
     try
     {
         if (referralUpdateDTO != null)
         {
             isUpdated = await ReferralBusinessMapping.UpdateReferral(referralUpdateDTO);
         }
     }
     catch (Exception exception) {}
     return(isUpdated);
 }
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public Referral MappingReferralupdateDTOToReferral(Referral referral, ReferralUpdateDTO ReferralUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     Referral Referral = referral;
     #endregion
     try
     {
         if (ReferralUpdateDTO.ReferralId > default(int))
         {
             Referral.ReferralId   = ReferralUpdateDTO.ReferralId;
             Referral.ReferralName = ReferralUpdateDTO.ReferralName;
         }
     }
     catch (Exception exception) { }
     return(Referral);
 }
Ejemplo n.º 3
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > UpdateReferral(ReferralUpdateDTO ReferralUpdateDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate userUpdateDTO for nullability before prepaing the response.
                if (await ReferralAppService.UpdateReferral(ReferralUpdateDTO))
                {
                    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);
        }