Beispiel #1
0
 /// <summary>
 /// Update branding information
 /// </summary>
 /// <param name="branding">branding entity to be updated</param>
 /// <returns>updated branding entity</returns>
 public ISOBranding Update(ISOBranding branding)
 {
     try
     {
         this.brandingSrv.Update(branding);
         int commitStatus = UnitOfWork.Commit();
         return(branding);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public HttpResponseMessage Create([System.Web.Http.ModelBinding.ModelBinder(typeof(IocCustomCreationConverter))] ISOBranding brandEntity)
 {
     try
     {
         var result = brandingSrv.Create(brandEntity);
         if (result != null)
         {
             return(CreateHttpResponse <ISOBranding>(HttpStatusCode.Created, HttpCustomStatus.Success, result, GetLocalisedString("msgBrandingSuccess")));
         }
         else
         {
             return(CreateHttpResponse <ISOBranding>(HttpStatusCode.Accepted, HttpCustomStatus.Success, result, GetLocalisedString("msgWebServiceError")));
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         return(CreateHttpResponse <ISOBranding>(HttpStatusCode.InternalServerError, HttpCustomStatus.Failure, null, GetLocalisedString("msgWebServiceError") + ex.Message));
     }
 }
Beispiel #3
0
 /// <summary>
 /// Add branding information
 /// </summary>
 /// <param name="branding">branding entity to be created</param>
 /// <returns>created branding entity</returns>
 public ISOBranding Create(ISOBranding branding)
 {
     try
     {
         var brandEntity = this.brandingSrv.Entities.Where(x => x.Id == branding.Id).FirstOrDefault();
         if (brandEntity == null)
         {
             branding = this.brandingSrv.Add(branding);
             int commitStatus = UnitOfWork.Commit();
             return(branding);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public async Task <HttpResponseMessage> GetAll()
 {
     try
     {
         ISOBranding brandEntity = (await brandingSrv.GetAll()).FirstOrDefault();
         if (brandEntity != null)
         {
             var result = CreateHttpResponse <ISOBranding>(HttpStatusCode.OK, HttpCustomStatus.Success, brandEntity, "Success");
             return(result);
         }
         else
         {
             return(CreateHttpResponse <ISOBranding>(HttpStatusCode.NoContent, HttpCustomStatus.Success, null, "No Records Found"));
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         return(CreateHttpResponse <ISOBranding>(HttpStatusCode.InternalServerError, HttpCustomStatus.Failure, null, "Web Service Error: Please report this problem or try again later." + ex.Message));
     }
 }
        public HttpResponseMessage Update([System.Web.Http.ModelBinding.ModelBinder(typeof(IocCustomCreationConverter))] ISOBranding brandEntity)
        {
            try
            {
                var result = brandingSrv.Update(brandEntity);

                if (result != null)
                {
                    return(CreateHttpResponse <ISOBranding>(HttpStatusCode.OK, HttpCustomStatus.Success, result, "Branding updation successful"));
                }
                else
                {
                    return(CreateHttpResponse <ISOBranding>(HttpStatusCode.Accepted, HttpCustomStatus.Success, result, "Branding updation not successful"));
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                return(CreateHttpResponse <ISOBranding>(HttpStatusCode.InternalServerError, HttpCustomStatus.Failure, null, "Web Service Error: " + ex.Message));
            }
        }
 /// <summary>
 /// update operation of branding service
 /// </summary>
 /// <param name="branding">branding entity to be updated</param>
 /// <returns>branding entity</returns>
 public ISOBranding Update(ISOBranding branding)
 {
     return(this.brandingSrv.Update(branding));
 }
 /// <summary>
 /// Create operation of branding service
 /// </summary>
 /// <param name="branding">branding entity to be created</param>
 /// <returns>branding entity</returns>
 public ISOBranding Create(ISOBranding branding)
 {
     return(this.brandingSrv.Create(branding));
 }