public void UpdateCustomer()
        {
            String q = "update Customers set FirstName ='" + FirstName + "',LastName = '" + LastName + "' ,ContactNumber = '" + ContactNo + "' ,Address = '" + Address + "' ,Gender = '" + Gender + "',DateOfBirth = '" + this.DateOfBirth + "',RoomType = '" + RoomType + "',Rooms = '" + Room + "' Where ContactID = '" + ContactID + "'";

            try
            {
                using (DBConect db = new DBConect())
                {
                    bool ok = db.update(q);

                    if (ok)
                    {
                        MessageBox.Show("User updated successfully", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("User updation failed", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
            // throw new NotImplementedException();
        }
Example #2
0
        public void UpdateCustomer()
        {
            String q = "update customers set FirstName ='" + FirstName + "',LastName = '" + LastName + "', NIC = '" + NIC + "' ,ContactNumber = '" + ContactNo + "' , Address = '" + Address + "' , Gender = '" + Gender + "',checkin = '" + this.checkin + "',checkout = '" + this.checkout + "',adults = '" + adults + "',children = '" + children + "',DeluxeRoom = '" + DeluxeRoom + "',SuiteRoom = '" + SuiteRoom + "',StandardRoom = '" + StandardRoom + "' Where ContactID = '" + ContactID + "'";

            try
            {
                using (DBConect db = new DBConect())
                {
                    bool ok = db.update(q);

                    if (ok)
                    {
                        MessageBox.Show("User updated successfully", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("User updation failed", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
            // throw new NotImplementedException();
        }