Пример #1
0
        public ActionResult RequestQuote(QuoteModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    HelpingMethods hm = new HelpingMethods();
                    //if (!hm.CheckReCaptcha(Request["g-recaptcha-response"]))
                    //{
                    //    ViewBag.resultmail = "Captcha is not valid. Please try again.";
                    //    return View();
                    //}


                    StringBuilder sbEmailBodyl = new StringBuilder();
                    sbEmailBodyl.Append("<table border='1' style='width:100%;'>");
                    sbEmailBodyl.Append("<tr><th colspan='2'>Owner Details</th></tr>");
                    sbEmailBodyl.Append("<tr><td>Name </td><td>" + model.Name + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Designation </td><td>" + model.Designation + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Contact Number </td><td>" + model.Mobile + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Email </td><td>" + model.Email + "</td></tr>");
                    sbEmailBodyl.Append("<tr><th colspan='2'>Business Details</th></tr>");
                    sbEmailBodyl.Append("<tr><td>BKO or Business Name </td><td>" + model.Org_Name + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Brick Kiln or Business Type </td><td>" + model.busiess_type + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Location </td><td>" + model.City_village + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>City or Village </td><td>" + model.District + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>State </td><td>" + model.State + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Country</td><td>" + model.Country + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>See the Vedio Demo First</td><td>" + model.seen_video + "</td></tr>");
                    sbEmailBodyl.Append("<tr><td>Interested For</td><td>" + model.Interested_for + "</td></tr>");
                    sbEmailBodyl.Append("</table>");
                    //var result = hm.SendMail("*****@*****.**", "Request Quote", sbEmailBodyl.ToString(), "eBrickKiln- " + model.Interested_for + ", Request Quote by vistor");

                    var result          = hm.SendMailSales("*****@*****.**", "eBrickKiln- " + model.Interested_for, sbEmailBodyl.ToString(), "eBrickKiln- Sales");
                    var resulttovisitor = hm.SendMailSales(model.Email, "eBrickKiln- Greetings", MailToClient(), "eBrickKiln- Sales");

                    var resultsms = hm.sendsmsany("Thanks from 'uSofts' to show your interest in our eBrickkiln product for your business. Detail sent on your mail Id Soon you will get call from sale executive.", model.Mobile);

                    if (result)
                    {
                        //ViewBag.resultmail = "Your message sent.";
                        return(View("ContactSuccess"));
                    }
                }
            }
            catch { }
            return(View());
        }
Пример #2
0
        public ActionResult ResendOTP()
        {
            var status = false;

            try
            {
                HelpingMethods hm = new HelpingMethods();
                Session["otp"] = hm.RandomNumber();
                string message = "OTP is " + Session["otp"].ToString() + " for login to brick kiln support.";
                var    r       = hm.sendsmsany(message, Session["mobilenumber"].ToString());
                status = true;
            }
            catch { }
            return(new JsonResult {
                Data = new { status = status }
            });
        }
Пример #3
0
        //[ValidateAntiForgeryToken]
        public ActionResult Login(LoginModel model, string byotp, string bypassword)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var localusermobile = model.MobileLogin.Trim();

                    if (localusermobile.All(char.IsDigit))
                    {
                        if (localusermobile.Length == 10)
                        {
                            var userdetail = _mainobj.GetByMobile(localusermobile);
                            if (userdetail == null)
                            {
                                ModelState.AddModelError("MobileLogin", "Mobile is not registered with us, please contact us to get registerd.");
                                return(View());
                            }
                            else
                            {
                                if (userdetail.userblocked)
                                {
                                    ModelState.AddModelError("MobileLogin", "Your account is blocked by admin.");
                                    return(View());
                                }
                                var currentwebsite        = "Brick Kiln,";
                                var userforcuurentwebsite = userdetail.formodule.Contains(currentwebsite);
                                if (!userforcuurentwebsite)
                                {
                                    ModelState.AddModelError("MobileLogin", "Mobile is not registered with us for current website, please contact us to get registerd.");
                                    return(View());
                                }
                            }

                            if (!string.IsNullOrEmpty(byotp))
                            {
                                HelpingMethods hm = new HelpingMethods();

                                Session["otp"] = hm.RandomNumber();
                                //Session["otp"] = 1111;/////////////////////////////////////// temp
                                Session["mobilenumber"] = model.MobileLogin;
                                ViewBag.mobilenumber    = model.MobileLogin;

                                string message = "OTP is " + Session["otp"].ToString() + " for login to brick kiln support.";
                                var    result  = hm.sendsmsany(message, ViewBag.mobilenumber);

                                Session["modelvalues"] = model;
                                opttrycount            = 0;
                                return(View("ConfirmOTP"));
                            }
                            else if (!string.IsNullOrEmpty(bypassword))
                            {
                                var upassword   = StaticData.GetSHA512(model.Password);
                                var loginresult = _mainobj.GetByMobilePassword(localusermobile, upassword);
                                if (loginresult != null)
                                {
                                    FormsAuthentication.Initialize();
                                    HttpContext currentContext       = System.Web.HttpContext.Current;
                                    FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
                                        1, loginresult.clientname, DateTime.Now, DateTime.Now.AddMinutes(30), true,
                                        loginresult.userrole, FormsAuthentication.FormsCookiePath);
                                    string     hash   = FormsAuthentication.Encrypt(ticket);
                                    HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);
                                    currentContext.Response.Cookies.Add(cookie);

                                    AuthenticateThisRequest();

                                    if (User.IsInRole("Admin"))
                                    {
                                        return(RedirectToAction("Index", "Description"));
                                    }
                                    else if (User.IsInRole("Support"))
                                    {
                                        return(RedirectToAction("ClientDetail", "Support"));
                                    }
                                    else if (User.IsInRole("Client"))
                                    {
                                        return(RedirectToAction("Index", "Support"));
                                    }
                                }
                                else
                                {
                                    ModelState.AddModelError("MobileLogin", "Mobile or Password is not valid");
                                    return(View("LoginAdmin"));
                                }
                            }
                        }
                    }
                }
                catch { }
            }
            ModelState.AddModelError("MobileLogin", "Mobile is not valid");
            return(View());
        }