Exemple #1
0
        public virtual async Task <SalutationCollectionModel> Get()
        {
            var salutations = SalutationHelper.GetSalutations();
            var collection  = new SalutationCollectionModel(salutations);

            collection.Links.Add(new Link()
            {
                Rel = "self", Href = this.Url.Route(SalutationsRouteName, new { })
            });
            return(await Task.FromResult(collection));
        }
Exemple #2
0
 public dynamic SearchActiveSalutations(DTO.LABURNUM.COM.SalutationModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         List <DTO.LABURNUM.COM.SalutationModel> dbSalutations = new SalutationHelper(new FrontEndApi.SalutationApi().GetActiveSalutations()).Map();
         return(GetApiResponseModel("Successfully Performed.", true, dbSalutations));
     }
     else
     {
         return(GetApiResponseModel("Api Access User Name or Password Invalid.", false, null));
     }
 }
Exemple #3
0
 public dynamic SearchSalutationById(DTO.LABURNUM.COM.SalutationModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         if (model.SalutationId <= 0)
         {
             return(GetApiResponseModel("Salutation Id Cannnot be null.", true, null));
         }
         List <DTO.LABURNUM.COM.SalutationModel> dbClasses = new SalutationHelper(new FrontEndApi.SalutationApi().GetSalutationByAdvanceSearch(model)).Map();
         if (dbClasses.Count == 0)
         {
             return(GetApiResponseModel("No Record Found For Given Salutation Id", true, null));
         }
         if (dbClasses.Count > 1)
         {
             return(GetApiResponseModel("More Than One Record Found Please Contact Administrator", true, null));
         }
         return(GetApiResponseModel("Successfully Performed.", true, dbClasses[0]));
     }
     else
     {
         return(GetApiResponseModel("Api Access User Name or Password Invalid.", false, null));
     }
 }