Ejemplo n.º 1
0
 public void SendOrderMail(Orders Order)
 {
     MailLogic MailLogic = new MailLogic();
     Dictionary<string, string> Placeholders = new Dictionary<string, string>
     {
         { "firstname", Order.FirstName },
         { "orderid", Order.OrdersId.ToString() },
         { "summary", LoadOrderSummary() }
     };
     MailLogic.sendMailTemplate("OrderComplete", Order.Email, Placeholders);
 }
Ejemplo n.º 2
0
 public async Task<bool> SendResetPasswordMail(string Email)
 {
     if (string.IsNullOrEmpty(Email))
     {
         SiteLogic.AddError("Please enter email");
         return false;
     }
     User User = userManager.FindByEmail(Email);
     if (User != null)
     {
         var code = await userManager.GeneratePasswordResetTokenAsync(User.Id);
         Page page = HttpContext.Current.Handler as Page;
         var callbackUrl = HttpContext.Current.Request.GetFullVirtualPath("~/account/resetpassword", "id=" + HttpContext.Current.Server.UrlEncode(User.Id) + "&code=" + HttpContext.Current.Server.UrlEncode(code));
         MailLogic MailLogic = new MailLogic();
         Dictionary<string, string> Placeholders = new Dictionary<string, string>
         {
             { "firstname", User.FirstName },
             { "callbackurl", "<a href=\""+callbackUrl+"\">Reset link</a>" }
         };
         MailLogic.sendMailTemplate("ResetPassword", User.Email, Placeholders);
         //await userManager.SendEmailAsync(User.Id, "Reset Password",
         //"Please reset your password by clicking here: <a href=\"" + callbackUrl + "\">link</a>");
         return true;
     }
     return false;
 }
Ejemplo n.º 3
0
        public string PayDeal()
        {
            string ret = "", ret1 = "", ret2 = "", ret3 = "", ret4 = "", ret5 = "", ret6 = "";

            string siteurl = SiteLogic.Config()["siteurl"];
            string retMsg = "";

            string authNUm = Order.CardAuthNum;
            string cardNumber = Order.CardToken, expMonth = "";
            int ReferenceNumber = 0, Validation_Result_Code = 0;
            clsZCreditWSSoapClient sc = new clsZCreditWSSoapClient();
            sc.CommitSimpleTransaction("2648414013", //TerminalNumber,  0963222014
                 "7351585986",    //Password, 0963222014
                 "",      //Track2,,
                 ref cardNumber,      //CardNumber,,
                 ref expMonth,    //ExpDate_MMYY,
                 (float)Order.GetGrandTotal(),     //TransactionSum,,
                 Order.CardHolderId,   //HolderID,,
                 "",     //CVV,,
                 false,    //IsCustomerPresent,,
                 ref authNUm,    //AuthNum,,
                 out Validation_Result_Code,    //Validation_Result_Code,
                 out ret,    //Validation_Result_Message,
                 out ret1,    //CardName,,
                 out ret2,    //CardIssuerCode,,
                 out ret3,    //CardFinancerCode,,
                 out ret4,    //CardBrandCode,,
                 out ReferenceNumber,    //ReferenceNumber,,
                 out ret5,    //VoucherNumber,,
                 out ret6);    //ApprovalType,

            if (Validation_Result_Code == 0)
            {
                Order.AdminComments = "AuthNum: " + authNUm + ", Validation_Result_Code: " + Validation_Result_Code + ", ReferenceNumber: " + ReferenceNumber;
                Order.StatusId = 6;
                MailLogic ml = new MailLogic();
                UsersLogic UsersLogic = new UsersLogic();
                User user = UsersLogic.FindByUserId(Order.UserId);
                Dictionary<string, string> Placeholders = new Dictionary<string, string>
                {
                    { "firstname", user.FirstName },
                    { "orderid", Order.OrdersId.ToString() }
                };
                ml.sendMailTemplate("SiteNotification", user.Email, Placeholders);
            }
            else
            {
                Order.AdminComments += " Validation_Result_Message: " + ret + ", AuthNum: " + ", Validation_Result_Code: " + Validation_Result_Code + ", ReferenceNumber: " + ReferenceNumber;
            }

            return ret;
        }