Example #1
0
        public static bool InsertOrganisationComm(OrganisationComm newOrgCom)
        {
            var Result = false;

            try
            {
                using (var ctx = new EvolutionRepository.Models.EvolutionDBContext())
                {
                    ctx.Database.ExecuteSqlCommand("Evo_OrganisationComm_Insert  @OrganisationID, @OrganisationCommTypeID, @Address, @AddressPrefix, @CommsHoneymoon",
                                                   new SqlParameter("@OrganisationID           ", newOrgCom.OrganisationID),
                                                   new SqlParameter("@OrganisationCommTypeID   ", newOrgCom.OrganisationCommTypeID),
                                                   new SqlParameter("@Address                  ", newOrgCom.Address),
                                                   new SqlParameter("@AddressPrefix            ", newOrgCom.AddressPrefix),
                                                   new SqlParameter("@CommsHoneymoon           ", newOrgCom.CommsHoneymoon));

                    Result = true;
                }
            }
            catch (Exception)
            {
                Result = false;
            }

            return(Result);
        }
Example #2
0
 public static bool InsertOrganisationComm(OrganisationComm organisationComm)
 {
     try
     {
         return(OrganisationCommDAL.InsertOrganisationComm(organisationComm));
     }
     catch (Exception ex)
     {
         throw new EvolutionBusinessLogic.Exceptions.EvolutionException(ex.Message, ex.InnerException);
     }
 }
        public HttpResponseMessage Update([FromBody] OrganisationComm orgCom)
        {
            bool Result = OrganisationCommLogic.EditOrganisationComm(orgCom);

            if (Result == false)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
            else
            {
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
        }