public List <Restaurant> getrestaurants() { var restaurants = AnkapurService.getrestaurants(); var dt = new DataTable(); dt.Load(restaurants); List <Restaurant> rest = (from DataRow row in dt.Rows select new Restaurant() { restcode = row["RestCode"].ToString(), fullname = row["FullName"].ToString() }).ToList(); return(rest); }
public JsonResult savecustomerdetails(Restaurant restaurant) { var data = AnkapurService.savecustomerdetails(restaurant.customerphone, restaurant.customername, restaurant.address, restaurant.password, restaurant.Email); if (data > 0) { ViewBag.customerphone = restaurant.customerphone; ViewBag.customername = restaurant.customername; ViewBag.address = restaurant.address; ViewBag.password = restaurant.password; ViewBag.Email = restaurant.Email; return(Json("success")); } return(Json("unique", JsonRequestBehavior.AllowGet)); }
public ActionResult validatecustomer(Restaurant restaurant) { var data = AnkapurService.validatecustomer(restaurant.password, restaurant.customerphone); var dt = new DataTable(); dt.Load(data); if (dt.Rows[0][0].ToString() != "Does not Exist") { //return Json("success"); var urlBuilder = new UrlHelper(Request.RequestContext); var url = urlBuilder.Action("NewOrder", "Index"); return(Json(new { status = "success", redirectUrl = url })); } return(Json("unique", JsonRequestBehavior.AllowGet)); }
public JsonResult checkotp(string OTP, string CustomerPhonenumber) { var data = AnkapurService.checkotp(OTP, CustomerPhonenumber); DataTable dt = new DataTable(); dt.Load(data); if (dt.Rows.Count != 0) { if (dt.Rows[0]["EmpStatus"].ToString() == "Does not Exist") { return(Json("failed")); } else { return(Json("success")); } } else { return(Json("success")); } }
public JsonResult Registrationpage(string CustomerPhoneNumber, string CustomerName, string Password, string Address) { try { int lengthOfPassword = 5; string guid = Guid.NewGuid().ToString().Replace("-", ""); string OTP = guid.Substring(0, lengthOfPassword).ToUpper(); SMSCAPI.ServiceSoapClient obj2 = new SMSCAPI.ServiceSoapClient(); string strPostResponse1 = obj2.SendTextSMS("ankapurchicken", "ankapur6900", CustomerPhoneNumber.ToString(), "Welcome to Ankapur Chicken OTP for activating your account is" + " " + OTP.ToString(), "ANKPUR"); string delReport1 = obj2.Getbalance("ankapurchicken", "ankapur6900"); var data = AnkapurService.Registercustomer(CustomerPhoneNumber, CustomerName, Password, Address, OTP, "INACTIVE"); if (data > 0) { return(Json("success")); } return(Json("unique", JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json("Failed")); } }
public JsonResult sendpassword(string phone) { try { if (ModelState.IsValid) { using (AnkapurEntities db = new AnkapurEntities()) { var customerphone = phone; if (customerphone == null) { Content("<script language='javascript' type='text/javascript'> alert('Please Enter the Valid Phonenumber');location.href='" + @Url.Action("Index", "ksmenu") + "' </script>"); } else if (customerphone.Length < 10) { //ViewBag.vmobmsg = "Please Enter the valid Phonenumber"; Content("<script language='javascript' type='text/javascript'>alert('Please Enter the valid Phonenumber');location.href='" + @Url.Action("Index", "ksmenu") + "'</script>"); } else { var details = (from userlist in db.TblNewCustomers where userlist.CustPhoneNumber == phone select new { userlist.CustPhoneNumber, userlist.CustomerFName, userlist.Delivery_Addresss, userlist.Email, userlist.Status }).ToList(); //if (details.FirstOrDefault().Status == "ACTIVE") //{ if (details.FirstOrDefault() != null) { if (details.FirstOrDefault().Status == "ACTIVE") { var password = AnkapurService.sendpwtocustomer(phone); if (password.HasRows) { var dt = new DataTable(); dt.Load(password); string pw = dt.Rows[0]["Password"].ToString(); SMSCAPI.ServiceSoapClient obj2 = new SMSCAPI.ServiceSoapClient(); string strPostResponse1 = obj2.SendTextSMS("ankapurchicken", "ankapur6900", phone.ToString(), "Welcome to Ankapur Chicken Password for your account is" + " " + pw.ToString(), "ANKPUR"); string delReport1 = obj2.Getbalance("ankapurchicken", "ankapur6900"); return(Json("success")); //return Json("exists"); } else { if (password.FieldCount == 0) { return(Json("exists")); } else { Content("<script language='javascript' type='text/javascript'>alert('Phonenumber is not Found Please Register');location.href='" + @Url.Action("Index", "ksmenu") + "'</script>"); } } return(Json("unique", JsonRequestBehavior.AllowGet)); } } } } } return(Json("unique", JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json("Failed")); } }