Beispiel #1
0
        public IActionResult OnPost()
        {
            int      CardNumLength = CardNumber.ToString().Length;
            int      ExpDateLength = ExpDate.ToString().Length;
            int      CVVLength     = CVV.ToString().Length;
            DateTime da;

            if (CardNumLength == 16)
            {
                if (DateTime.TryParseExact(ExpDate.ToString(), "MM/yy", null, System.Globalization.DateTimeStyles.None, out da))
                {
                    Console.WriteLine("DateTime = success");
                    if (CVVLength != 3)
                    {
                        Console.WriteLine("CVV success");
                    }
                }
                else
                {
                    Console.WriteLine("Please use the correct format");
                }
            }
            else
            {
                Console.WriteLine("The Card Number must be 16 digits");
            }

            return(RedirectToPage("/Index"));
        }
 public override string ToString()
 {
     null = "" + this.checkedIn + "," + this.CID_Conflict + "," + this.userid + "," + CheckedInDate + "," + ExpDate.ToString() + ",";
     foreach (string str in this.plugIns)
     {
         null = null + "," + str + "";
     }
     return(null + "," + this.serial);
 }
        public bool AddNewProduct(Product product)
        {
            int id = Convert.ToInt32(Functions.IDGeneration(MyShopConfigration.Products)) + 1;

            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Id", id.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Name", Name);
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Price", Price.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "ExpDate", ExpDate.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "ManDate", ManDate.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "CompanyName", CompanyName);
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Quntity", Quntity.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Features", Features);
            return(true);
        }
Beispiel #4
0
 /* Methods */
 public override string ToString()
 {
     return($"{CardNum}\t{ExpDate.ToString("MM'/'y")}\t{Cvv}");
 }