public ActionResult ManagePricingForServices(FormCollection form)
        {
            BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();

            string ServiceTax = form["txtServiceTax"].ToString();
            //for service tax update
            if (form["txtServiceTax"].ToString().Length > 0)
                BLObj.UpdateServiceTaxPricing(form["txtServiceTax"].ToString());

            //for Proofreading Pricing with Service Tax
            if (form["txtProofReading"].ToString().Length > 0)
            {
                //double addingServiceTaxwithProofReadingpricing = Convert.ToDouble(form["txtProofReading"].ToString()) * (Convert.ToDouble(ServiceTax)) / 100;

                //double ProofReadingPricing = Convert.ToDouble(form["txtProofReading"].ToString()) + addingServiceTaxwithProofReadingpricing;

                BLObj.InsertProofReadingPricing(form["txtProofReading"].ToString());
            }

            //for Formatting Pricing with Service Tax
            if (form["txtFormatting"].ToString().Length > 0)
            {
                //double addingServiceTaxwithFormattingpricing = Convert.ToDouble(form["txtFormatting"].ToString()) * (Convert.ToDouble(ServiceTax)) / 100;

                //double FormattingPricing = Convert.ToDouble(form["txtFormatting"].ToString()) + addingServiceTaxwithFormattingpricing;

                BLObj.InsertFormatingPricing(form["txtFormatting"].ToString());
            }

            //for Illustration Pricing with Service Tax
            if (form["txtIllustrationPrice"].ToString().Length > 0 && form["ddlIllType"].ToString().Length > 0 && form["ddlColor"].ToString().Length > 0)
            {
                //double addingServiceTaxwithIllustrationpricing = Convert.ToDouble(form["txtIllustrationPrice"].ToString()) * (Convert.ToDouble(ServiceTax)) / 100;

                //double IllustrationPricing = Convert.ToDouble(form["txtIllustrationPrice"].ToString()) + addingServiceTaxwithIllustrationpricing;

                int illtype = Convert.ToInt32(form["ddlIllType"].ToString());

                int illcolor = Convert.ToInt32(form["ddlColor"].ToString());

                BLObj.UpdateIllustrationPricing(illtype, illcolor, form["txtIllustrationPrice"].ToString());

            }

            //for CoverDesign Pricing with Service Tax
            if (form["txtCoverDesingForGraphics"].ToString().Length > 0 || form["txtCoverDesingForIllustrative"].ToString().Length > 0)
            {
                //double addingServiceTaxwithCoverDesingpricing = 0.00,CoverDesingPricing = 0.00;

                if (form["txtCoverDesingForGraphics"].ToString().Length > 0)
                {
                    //addingServiceTaxwithCoverDesingpricing = Convert.ToDouble(form["txtCoverDesingForGraphics"].ToString()) * (Convert.ToDouble(ServiceTax)) / 100;
                    //CoverDesingPricing = Convert.ToDouble(form["txtCoverDesingForGraphics"].ToString()) + addingServiceTaxwithCoverDesingpricing;
                    BLObj.UpdateCoverDesingPricing(form["txtCoverDesingForGraphics"].ToString(), "Graphical");
                }
                else
                {
                    //addingServiceTaxwithCoverDesingpricing = Convert.ToDouble(form["txtCoverDesingForIllustrative"].ToString()) * (Convert.ToDouble(ServiceTax)) / 100;
                    //CoverDesingPricing = Convert.ToDouble(form["txtCoverDesingForIllustrative"].ToString()) + addingServiceTaxwithCoverDesingpricing;
                    BLObj.UpdateCoverDesingPricing(form["txtCoverDesingForIllustrative"].ToString(), "Illustative");
                }

            }

            ServicePricing model = new ServicePricing();
            model.ListColor = LoadColorDropDown();
            model.ListIllustrationType = LoadIllTypeDropDown();

            ViewBag.ClassName = "bg-success text-success";
            ViewBag.ResultMessage = "Prices are changed sucessfully";

            return View(model);
        }
        private List<Packages> LoadListofPackages()
        {
            System.Data.DataTable dt = new System.Data.DataTable();
            BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
            dt = bl.load_ddlPackageName();

            List<Packages> packages = new List<Packages>();

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    packages.Add(new Packages
                    {
                        PackageId = Convert.ToInt32(dr[0]),
                        PackageName = dr[1].ToString(),
                        Amount = dr[2].ToString()
                    });
                }

            }
            return packages;
        }
 private List<SelectListItem> LoadPackageNameDropDown()
 {
     System.Data.DataTable dt = new System.Data.DataTable();
     BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
     dt = bl.load_ddlPackageName();
     return BuildDropDownListData(dt);
 }
        public ActionResult UserIsActive()
        {
            var model = new UserIsActive();
            VishwaPress.BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
            System.Data.DataTable dt = new System.Data.DataTable();
            List<System.Data.DataRow> ListAllUsers = new List<System.Data.DataRow>();
            dt = bl.getAllUsers();
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                ListAllUsers.Add(dr);
            }
            model.ListTable = ListAllUsers;

            List<UserIsActive> list = new List<UserIsActive>();
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                list.Add(new UserIsActive {
                    UserId=int.Parse(dr[0].ToString()),
                    UserName= dr[1].ToString(),
                    Role = dr[2].ToString(),
                    IsActive = int.Parse(dr[3].ToString())
                });
            }
            model.ModelList = list;
            if (Request.IsAjaxRequest())
            {
                return PartialView("_AllUsersWebgrid", model);
            }
            return View(model);
        }
 private int CheckUserActiveORNOT(string UserName)
 {
     VishwaPress.BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
     System.Data.DataTable dt = new System.Data.DataTable();
     dt=bl.CheckUserActiveORNOT(UserName);
     if (dt.Rows.Count > 0)
     {
         if (dt.Rows[0][0].ToString() == "1")
         {
             return 1;
         }
         else
             return 0;
     }
     else
     {
         return 2;
     }
 }
 public void UpdateIsActiveStatus(int UserId,int IsActive)
 {
     VishwaPress.BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
     System.Data.DataTable dt = new System.Data.DataTable();
     bl.updateStatus(UserId, IsActive);
 }
        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);
        }
Beispiel #8
0
 public ActionResult GetActiveFeatures(int PackageID)
 {
     Packages p = new Packages();
     BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
     p.PkgData = bl.GET_ACTIVE_Features_ByPackageID(PackageID);
     return PartialView("_WebgridFeaturesOfPackage", p);
 }
Beispiel #9
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();
            }
        }
Beispiel #10
0
        //[Authorize]
        public ActionResult Packages(string message)
        {
            ViewBag.Message = "Packages";
            ViewBag.Error = message;
            Packages p = new Packages();
            string UserId = "0";
            try
            {
                UserId = Convert.ToString(Common.GetUserId(HttpContext.User.Identity.Name));
            }
            catch (Exception ex)
            {
                UserId = "0";
            }

            BusinessLayer.BLControllers.BL_Account bl = new BusinessLayer.BLControllers.BL_Account();
            p.PkgData = bl.GetPackagesDetails(Convert.ToInt32(UserId));
            return View(p);
        }