Пример #1
0
        public ActionResult ForgotPassword(ForgotPassword model)
        {
            //var mod = new ForgotPassword();
            if (model.UserName == null)
            {
                ModelState.AddModelError("", "User Name Required");
            }
            else
            {

                if (WebSecurity.UserExists(model.UserName))
                {
                System.Data.DataTable dt = new System.Data.DataTable();
                VishwaPress.BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
                dt = bl.GetEmailId(model.UserName);
                if (dt.Rows.Count == 1)
                {
                    string EmailID = dt.Rows[0][0].ToString();
                    var token = WebSecurity.GeneratePasswordResetToken(model.UserName,5);
                    bl.SendMail(EmailID, model.UserName, token);
                    ViewBag.Success = "Your Token has been mail on your Email Account.Use it to reset password,follow provided link in mail to go to reset password page";
                }
                else
                {
                    ModelState.AddModelError("", "No EmailId");
                }
                }
                 else
                 {
                     ModelState.AddModelError("", "invalid User Name !!");
                  }

            }

            return View(model);
        }
Пример #2
0
        public ActionResult PaymentDone()
        {
            //Payment response

            string[] payment_information = null;
            int packageid = 0;
            string packageamount = "";
            string serviceinfo = "";
            string[] requestinfo = null;
            string amount = "";
            //request information

            if (TempData["RequestInfo"] != null)
            {
                requestinfo = TempData["RequestInfo"].ToString().Split(' ');
                packageid = Convert.ToInt32(requestinfo[1]);
                serviceinfo = requestinfo[0].ToString();
                amount = requestinfo[2].ToString();
            }
            string UserId = Convert.ToString(Common.GetUserId(HttpContext.User.Identity.Name));
            BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
            DataTable email_username  = bl.GetEmailId(UserId);
               // string htmlFilePath = Server.MapPath(Constants.ResetPasswordHTMLTemplate);

            if (serviceinfo == "Package")
            {
                string htmlFilePathforpackage = Server.MapPath(Constants.PackageHTMLTemplate);
                if (TempData["PaymentInformationforPackage"] != null)
                {
                    payment_information = TempData["PaymentInformationforPackage"].ToString().Split(' ');
                    packageid = Convert.ToInt32(payment_information[0]);
                    packageamount = payment_information[1];
                }
               strPGResponse = Request["msg"].ToString();
                Packages p = new Packages();

                if (strPGResponse != "" || strPGResponse != null)
                {

                    RequestURL objRequestURL = new RequestURL();

                    string strDecryptedVal = objRequestURL.VerifyPGResponse(strPGResponse, ConfigurationSettings.AppSettings["FilePath"]);

                    if (strDecryptedVal.StartsWith("ERROR"))
                    {
                        ViewBag.ResultMessage = strDecryptedVal;
                    }
                    else
                    {
                        strSplitDecryptedResponse = strDecryptedVal.Split('|');
                        GetPGRespnseData(strSplitDecryptedResponse);

                        if (strPG_TxnStatus == "0300")
                        {
                            p.PkgData = bl.GET_ACTIVE_Features_ByPackageID(packageid);
                            p.AmountAfterTransaction = packageamount;

                            Guid OrderID = new Guid(TempData["OrderID"].ToString());

                            bl.UpdateOrder(OrderID,strPG_TPSLTxnID);

                            DataTable dt = bl.getPackageDetails(Convert.ToInt32(UserId));

                            if (dt.Rows.Count > 0)
                            {
                                bl.UpdatePackageStatus(packageid, Convert.ToInt32(UserId));
                                bl.UpdatePayStatus(packageid, Convert.ToInt32(UserId));
                            }
                            else
                            {
                                bl.insertUserPackage(packageid, Convert.ToInt32(UserId));
                                bl.UpdatePayStatus(packageid, Convert.ToInt32(UserId));
                            }

                            bl.SendMailAfterPaymentDoneForPackage(email_username.Rows[0][1].ToString(), email_username.Rows[0][0].ToString(), p.PackageName, Convert.ToInt32(p.AmountAfterTransaction), htmlFilePathforpackage);

                        }
                        else
                            ViewBag.ResultMessage = "Transaction Fail ";

                    }
                }

                return View(p);
            }
            else
            {
                string htmlFilePathforService = Server.MapPath(Constants.ServiceHTMLTemplate);
                strPGResponse = Request["msg"].ToString();

                if (strPGResponse != "" || strPGResponse != null)
                {

                    RequestURL objRequestURL = new RequestURL();

                    string strDecryptedVal = objRequestURL.VerifyPGResponse(strPGResponse, ConfigurationSettings.AppSettings["FilePath"]);

                    if (strDecryptedVal.StartsWith("ERROR"))
                    {
                        ViewBag.ResultMessage = strDecryptedVal;
                    }
                    else
                    {
                        strSplitDecryptedResponse = strDecryptedVal.Split('|');
                        GetPGRespnseData(strSplitDecryptedResponse);

                        if (strPG_TxnStatus == "0300")
                        {
                            Guid OrderID = new Guid(TempData["OrderID"].ToString());

                            bl.UpdateOrder(OrderID,strPG_TPSLTxnID);

                            if (serviceinfo == "ProofReading")
                            {
                                BusinessLayer.BLControllers.BL_ProofReading proofreading = new BusinessLayer.BLControllers.BL_ProofReading();
                                proofreading.UpdateProofReadingByTrxnID(packageid, serviceinfo);
                                bl.SendMailAfterPaymentDoenForServices(email_username.Rows[0][1].ToString(), email_username.Rows[0][0].ToString(), serviceinfo, Convert.ToDouble(amount), htmlFilePathforService);
                            }
                            if (serviceinfo == "Formatting")
                            {
                                BusinessLayer.BLControllers.BL_Formatting formating = new BusinessLayer.BLControllers.BL_Formatting();
                                formating.UpdateProofReadingByTrxnID(packageid, serviceinfo);
                                bl.SendMailAfterPaymentDoenForServices(email_username.Rows[0][1].ToString(), email_username.Rows[0][0].ToString(), serviceinfo, Convert.ToDouble(amount), htmlFilePathforService);
                            }
                            if (serviceinfo == "Illustation")
                            {
                                BusinessLayer.BLControllers.BL_Illustration Illustration = new BusinessLayer.BLControllers.BL_Illustration();
                                Illustration.UpdateProofReadingByTrxnID(packageid, serviceinfo);
                                bl.SendMailAfterPaymentDoenForServices(email_username.Rows[0][1].ToString(), email_username.Rows[0][0].ToString(), serviceinfo, Convert.ToDouble(amount), htmlFilePathforService);
                            }
                            if (serviceinfo == "CoverDesign")
                            {
                                BusinessLayer.BLControllers.BL_CoverDesign CoverDesing = new BusinessLayer.BLControllers.BL_CoverDesign();
                                CoverDesing.UpdateProofReadingByTrxnID(packageid, serviceinfo);
                                bl.SendMailAfterPaymentDoenForServices(email_username.Rows[0][1].ToString(), email_username.Rows[0][0].ToString(), serviceinfo, Convert.ToDouble(amount), htmlFilePathforService);
                                //return View(CoverDesign);
                            }
                            ViewBag.Message = requestinfo;
                        }
                        else
                        {
                            ViewBag.ResultMessage = "Transaction Fail ";
                            //ViewBag.ResultMessage = "Transaction Fail :: <br/>" + "Response :: <br/>"+ strDecryptedVal;
                        }

                    }

                }
               return View();
            }
        }