コード例 #1
0
        public async Task <IActionResult> SubmitForm(Tb_Orders model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }
                else
                {
                    Guid      code  = new Guid();
                    Tb_Orders order = new Tb_Orders
                    {
                        AccountNumber = code.ToString().Substring(0, 5),
                        Country       = model.Country,
                        CreateAt      = DateTime.Now,
                        Email         = model.Email,
                        FullName      = model.FullName,
                        Mobile        = model.Mobile,
                        status        = Status.register
                    };
                    await _unitOfWork.OrderRepo.InsertAsync(order);

                    await _unitOfWork.Save();

                    return(Ok());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: Pe2131/Registration
        public async Task <IActionResult> SubmitOrder(Tb_Orders model)
        {
            try
            {
                var setting = await _unitOfWork.SettingRepo.GetByIdAsync(1);

                ViewBag.logo = setting.Logo;
                if (!ModelState.IsValid)
                {
                    return(View(ModelState));
                }
                else
                {
                    Tb_Orders order = new Tb_Orders
                    {
                        AccountNumber = Guid.NewGuid().ToString().Substring(0, 5),
                        Country       = model.Country,
                        CreateAt      = DateTime.Now,
                        Email         = model.Email,
                        FullName      = model.FullName,
                        Mobile        = model.Mobile,
                        status        = Status.register,
                        Account       = model.Account,
                        Paystatus     = model.Paystatus,
                        Account2      = model.Account2
                    };
                    string price = model.Paystatus == 0 ? "99" : "999";
                    await _unitOfWork.OrderRepo.InsertAsync(order);

                    await _unitOfWork.Save();

                    ViewBag.Code = "Your Order ID Is : " + order.AccountNumber + "<br/> Please Check Your Email For Payment Details & Complete Your Order.";
                    await _emailSender.SendEmailAsync(model.Email, "Your Order & Payment Details", $"Dear {model.FullName}" +
                                                      $"<br><br>Thank you very much for your order at https://profitfactory.eu - part of (<b>World Outsourcing Services Ltd</b>)" +
                                                      $"<br> Your Order <b>ID</b> at Profitfactory.eu is: <b>{order.AccountNumber}</b> <br> Please make a note of your Order <b>ID</b> and quote it in any communication with us, no matter whether you contact us by Live chat or by e-mail or even if you are sending payments. Below you can find can find all payment options." +
                                                      $"<br><br> <b>Option 1 - Revolut :</b><br><br>" +
                                                      $"<b>Beneficiary: World Outsourcing Services Ltd.</b><br><b>IBAN: GB52 REVO 0099 6927 4762 17</b><br><b>BIC: REVOGB21</b><br><b>Beneficiary address: 1616, Detski Mir 12, Sofia, Bulgaria</b><br><b>Bank / Payment institution: Revolut</b>" +
                                                      "<br><br> <b>Option 2 - Details For Wire Transfer:</b> <br><br>" +
                                                      "<b>Account Name: World Outsourcing Services Ltd</b><br><b>Bank Name: United Bulgarian Bank</b> <br> <b>IBAN: BG18UBBS80021453642710</b> <br> <b>BIC / SWIFT: UBBSBGSF</b> <br><b>Bank Address & Branch :Bulgaria, Sofia, bul.Vitosha 89b</b>" +
                                                      "<br><br>" +
                                                      $"Please note that we can only start with the setup of your order once we have received the initial payment. After we have received your payment, we will send you a separate e-mail. It will then take one day until everything has been completed and we will send you the Software file." +
                                                      $"We therefore would like to ask you to transfer the amount of <b>\"{price}\"EUR</b> to one of the options above , using your <b>Order ID</b> as subject for the transfer.<br>This will make it easier for us to allocate the payment and thus speed up the setup process." +
                                                      "<br><br> Thank you very much!<br>Team Profitfactory.eu"
                                                      );

                    return(View());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }