コード例 #1
0
 public HttpResponseMessage CheckAvailability(String mobilenum)
 {
     try
     {
         if (objCustReg.checkUserExists(mobilenum))
         {
             return(Request.CreateResponse(HttpStatusCode.OK, "True"));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.OK, "False"));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Error Message : " + ex.ToString()));
     }
 }
コード例 #2
0
        public static void Main(string[] a)
        {
            BusinessObjects.BAL.ServiceAreaImpl      SAI = new BusinessObjects.BAL.ServiceAreaImpl("");
            BusinessObjects.BAL.CustomerImpl         CI  = new CustomerImpl();
            BusinessObjects.BAL.CustomerRegistration CR  = new CustomerRegistration();
            Customer customerlist = CR.getUser(5);

            Console.WriteLine(customerlist.firstname);

            Customer customer = new Customer();

            customer.address   = "no5 anandaroad";
            customer.city      = "Chennai";
            customer.country   = "India";
            customer.DOB       = DateTime.Today;
            customer.firstname = "Kumar";
            customer.lastname  = "CM";
            customer.mobile    = "9874563222";
            customer.PIN       = "600017";
            customer.state     = "Tamilnadu";
            if (CI.saveUser(customer, "hellopwd"))
            {
                Console.WriteLine("Inserted Successfully");
            }
            else
            {
                Console.WriteLine("Failed to Insert");
            }


            Console.WriteLine(CR.checkUserRemoteExists("9874563210"));
            Console.WriteLine(CR.checkUserExists("9874563222"));

            dynamic SArea = SAI.getServiceAreas();

            foreach (var item in SArea)
            {
                Console.WriteLine(item.PIN);
            }
            Console.WriteLine(SAI.checkServiceability());
        }