Ejemplo n.º 1
0
        public void updateFreeCustDB(string firstname, string lastname, string email, string phone, string dob, string country, string townorcity, string nationality, string address, string postalcd, string username, string password, string cardtype, string cardno, string expdate, string chname, string ccv, string membership, string expirydate)
        {
            List <Object> updateArray = new List <object>();

            updateArray.Add(ExpiryDate);
            updateArray.Add(FirstName);
            updateArray.Add(LastName);
            updateArray.Add(Email);
            updateArray.Add(Phone);
            updateArray.Add(Convert.ToDateTime(DOB));
            updateArray.Add(Country);
            updateArray.Add(TownOrCity);
            updateArray.Add(Nationality);
            updateArray.Add(CustAddress);
            updateArray.Add(PostalCd);
            updateArray.Add(Username);
            updateArray.Add(CustPassword);
            updateArray.Add(CardType);
            updateArray.Add(CardNo);
            updateArray.Add(CardExpirationDate);
            updateArray.Add(CardHolderName);
            updateArray.Add(CCV);
            updateArray.Add(Membership);
            updateArray.Add(DBNull.Value);

            FreeCustomer f = new FreeCustomer();

            db.updateRow(updateArray, "tblCustomer", " WHERE Username = '******'", f);
        }
Ejemplo n.º 2
0
        public override Object getCustomerRow(string username)
        {
            FreeCustomer currentUserInfoLine = new FreeCustomer();

            ObservableCollection <FreeCustomer> customerLines = populateFreeCustomerDetails();

            foreach (FreeCustomer line in customerLines)
            {
                if (line.Username == username)
                {
                    currentUserInfoLine = line;
                }
            }
            return(currentUserInfoLine);
        }
Ejemplo n.º 3
0
        public ObservableCollection <FreeCustomer> populateFreeCustomerDetails()
        {
            custFreeCollection = new ObservableCollection <FreeCustomer>();

            DataTable table = db.getDataTable("select * from tblCustomer WHERE Membership = 'Free'");

            int size = table.Rows.Count;

            for (int i = 0; i < size; i++)
            {
                DataRow row = table.Rows[i];
                if (row["Membership"].ToString() == "Free")
                {
                    FirstName          = row["FirstName"].ToString();
                    LastName           = row["LastName"].ToString();
                    Email              = row["Email"].ToString();
                    Phone              = row["Phone"].ToString();
                    DOB                = row["DOB"].ToString();
                    Country            = row["Country"].ToString();
                    TownOrCity         = row["TownOrCity"].ToString();
                    Nationality        = row["Nationality"].ToString();
                    CustAddress        = row["CustAddress"].ToString();
                    PostalCd           = row["PostalCd"].ToString();
                    Username           = row["Username"].ToString();
                    CustPassword       = row["CustPassword"].ToString();
                    CardType           = row["CardType"].ToString();
                    CardNo             = row["CardNo"].ToString();
                    CardExpirationDate = row["CardExpirationDate"].ToString();
                    CardHolderName     = row["CardHolderName"].ToString();
                    CCV                = row["ccv"].ToString();
                    Membership         = row["Membership"].ToString();
                    try
                    {
                        ExpiryDate = row["ExpiryDate"].ToString();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    FreeCustomer fCust = new FreeCustomer(FirstName, LastName, Email, Phone, DOB, Country, TownOrCity, Nationality, CustAddress, PostalCd, Username, CustPassword, CardType, CardNo, CardExpirationDate, CardHolderName, CCV, Membership, ExpiryDate); //create object
                    custFreeCollection.Add(fCust);
                }
            }

            return(custFreeCollection);
        }