Example #1
0
        public int  Delete_employee(int id)
        {
            //"delete from Employees where id='" + search_textfield.Text + "'";

            string query = "DELETE FROM Employees WHERE id=" + id;

            return(Connection_Database.ExecuteQuery(query));
        }
        public int Add_Choach(Choch choach)
        {
            string query = string.Format("INSERT INTO Choach(Choach_No,Register,Date_Time,Source,Destination,Total_Seat,No_Seat,Seat_available,Amount) VALUES('{0}', '{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", choach.Choch_No, choach.Registration, choach.Date_Time, choach.Source, choach.Destination, choach.Total_Seat, Convert.ToInt32(choach.Seat_no), Convert.ToInt32(choach.Available_Seat), Convert.ToInt32(choach.Amount));

            return(Connection_Database.ExecuteQuery(query));
        }
Example #3
0
        public int Update_employee(Employees employee)
        {
            string query = "UPDATE Employees SET Name='" + employee.Name + "', Phone='" + employee.Phone + "', Salary='" + employee.Salary + "', Email='" + employee.Email + "' WHERE id=" + employee.Id;

            return(Connection_Database.ExecuteQuery(query));
        }
        public int Delete(string serach)
        {
            string query = "DELETE FROM Employees WHERE id=" + serach;

            return(Connection_Database.ExecuteQuery(query));
        }
        public int Edit_seat(Choch seat)
        {
            string query = "UPDATE Choach SET No_Seat=No_Seat+'" + seat.Seat_no + "'  WHERE Choach_No=" + seat.Choch_No;

            return(Connection_Database.ExecuteQuery(query));
        }
        //add passenger
        public int Add_passenger(User_Entity passenger)
        {
            string query = string.Format("INSERT INTO Passenger(Name,Phone,Choach_no,Seat_name) VALUES('{0}', '{1}','{2}','{3}')", passenger.Name, passenger.Phone, passenger.Choch_No, passenger.Seat_no);

            return(Connection_Database.ExecuteQuery(query));
        }
        public int Addemployee(Employees emp)
        {
            string query = string.Format("INSERT INTO Employees (id,Name,Phone,Salary,Email) VALUES ('{0}', '{1}','{2}','{3}','{4}')", emp.Id, emp.Name, emp.Phone, emp.Salary, emp.Email);

            return(Connection_Database.ExecuteQuery(query));
        }
        public int Add(User_Entity user)
        {
            string query = string.Format("INSERT INTO User_base(Name,Email,Username,Phone,Password) VALUES('{0}', '{1}','{2}','{3}','{4}')", user.Name, user.Email, user.Username, user.Phone, user.Password);

            return(Connection_Database.ExecuteQuery(query));
        }