Esempio n. 1
0
        public ActionResult Generate(int Nominal, string UserName)
        {
            try
            {
                PaymentSystem obj = new PaymentSystem();

                Guid g;
                g = Guid.NewGuid();

                var x = entities.PaymentSystems;

                foreach (var i in x)
                {
                    if (!i.KeyCode.Equals(g))
                    {
                        obj.Nominal = Nominal;
                        obj.KeyCode = g.ToString();
                        obj.IsActive = true;
                        obj.UserName = UserName;
                        PaymentS = g;
                    }
                }

                Mail(UserName);

                if (ModelState.IsValid)
                {
                    paymentsystemRepository.Insert(obj);
                    paymentsystemRepository.Save();
                }
                return RedirectToAction("Successful");
            }
            catch (Exception) { return RedirectToAction("Index"); }
        }
Esempio n. 2
0
 public void Insert(PaymentSystem paymentsystem)
 {
     entities.PaymentSystems.Add(paymentsystem);
 }