Example #1
0
        public IEnumerable <DemoLead> GetDemoLead()
        {
            demoLeadBO = new DemoLeadBO();
            var obj = demoLeadBO.GetDemoLeads();



            if (obj == null)
            {
                HttpResponseMessage msg = new HttpResponseMessage(HttpStatusCode.NotFound)
                {
                    Content      = new StringContent(string.Format("No customer with ID = {0}", 1)),
                    ReasonPhrase = "CustomerID Not Found in Database!"
                };
                throw new HttpResponseException(msg);
            }
            else
            {
                HttpResponseMessage msg = new HttpResponseMessage(HttpStatusCode.NotFound)
                {
                    Content      = new StringContent(string.Format("No customer with ID = {0}", 1)),
                    ReasonPhrase = "CustomerID Not Found in Database!"
                };
                throw new HttpResponseException(msg);
                //return obj;
            }
        }
Example #2
0
 // DELETE  SELECTED DEMOLEAD
 public bool Delete(int demoLeadID)
 {
     demoLeadBO = new DemoLeadBO();
     return(demoLeadBO.DeleteDemoLead(demoLeadID));
 }
Example #3
0
 // PUT UPDATE DEMOLEAD
 public bool Put(DemoLead demoLead)
 {
     demoLeadBO = new DemoLeadBO();
     return(demoLeadBO.EditDemoLead(demoLead));
 }
Example #4
0
 // POST ADD NEW DEMOLEAD
 public bool Post(DemoLead demoLead)
 {
     demoLeadBO = new DemoLeadBO();
     return(demoLeadBO.AddNewDemoLead(demoLead));
 }
Example #5
0
 // GET SELECTED DEMOLEAD
 public DemoLead GetDemoLead(int demoLeadID)
 {
     demoLeadBO = new DemoLeadBO();
     return(demoLeadBO.GetSelectedDemoLead(demoLeadID));
 }
 // GET ALL DEMOLEAD
 public IEnumerable <DemoLead> GetDemoLead()
 {
     demoLeadBO = new DemoLeadBO();
     return(demoLeadBO.GetDemoLeads());
 }