public int EditInformation(string Username, string _Address, string _Email)
        {
            string StoredProcedureName             = StoredProcedures.EditInfo;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@Username", Username);
            Parameters.Add("@address", _Address);
            Parameters.Add("@email", _Email);
            return(dbMan.ExecuteNonQuery(StoredProcedureName, Parameters));
        }
Ejemplo n.º 2
0
        public int deletefromsrt(int id, int courseid)
        {
            string query = "delete from [S Request T] where [Student-ID]=" + id + "and courseid=" + courseid + ";";

            return(dbMan.ExecuteNonQuery(query));
        }
Ejemplo n.º 3
0
        public int InsertClient(string userName, string FName, string MName, string LName, char Sex, string Password, string Email, string BirthDate, string Address = " ")
        {
            string StoredProcedureName             = StoredProcedures.InsertClient;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@_Username", userName);
            Parameters.Add("@_Password", Password);
            Parameters.Add("@_Sex", Sex);
            Parameters.Add("@_Fname", FName);
            Parameters.Add("@_Mname", MName);
            Parameters.Add("@_Lname", LName);
            Parameters.Add("@_Birthdate", BirthDate);
            Parameters.Add("@_Email", Email);
            Parameters.Add("@_ClientAddress", Address);
            return(dbMan.ExecuteNonQuery(StoredProcedureName, Parameters));
        }
Ejemplo n.º 4
0
        public int DeleteFsc(int id)
        {
            string StoredProcedureName             = StoredProcedures.DeleteFsc;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();


            Parameters.Add("@id", id);
            return(dbMan.ExecuteNonQuery(StoredProcedureName, Parameters));
        }
Ejemplo n.º 5
0
        public int DAssignMedications(long DoctorID, string PatientName, string MedicationName, string Dosage = "")
        {
            string query;

            if (Dosage.Length == 0)
            {
                query = "Insert into Prescribed_Medications(Medication_ID, Registration_ID, Prescription_Time)" +
                        " select MID, RegID, GETDATE()" +
                        " From Registration as R, Medication as M" +
                        " where M.MID = (select MID from Medication where Name = '" + MedicationName + "') AND R.RegID = (select Top 1 RegID from Registration where(Patient_ID = (select PID from Patient where Name= '" + PatientName + "')) AND(Doctor_ID =" + DoctorID + ") Order By Date Desc );";
            }
            else
            {
                query = "Insert into Prescribed_Medications(Medication_ID, Registration_ID, Prescription_Time, Dosage) "
                        + " select MID, RegID, GETDATE(), '" + Dosage + "' "
                        + "From Registration as R, Medication as M "
                        + "where M.MID = (select MID from Medication where Name = '" + MedicationName + "') AND R.RegID = (select Top 1 RegID from Registration where(Patient_ID = (select PID from Patient where Name= '" + PatientName + "')) AND(Doctor_ID =" + DoctorID + ") Order By Date Desc )";
            }

            return(dbMan.ExecuteNonQuery(query));
        }
Ejemplo n.º 6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Admin Players Functions

        public int UpdatePlayerInfo(int ID, string Fname, string Lname, int Match_ID, int Points, int Assists, int Goals)
        {
            string query = "UPDATE Players" +
                           " SET Fname = '" + Fname + "' , Lname = '" + Lname + "' , Match_ID = '" + Match_ID + "' , Points = '" + Points +
                           "' , Assists = '" + Assists + "' , Goals = '" + Goals +
                           "' WHERE ID = '" + ID + "';";

            return(dbMan.ExecuteNonQuery(query));
        }
Ejemplo n.º 7
0
 public int SignUp_newUser(string User, string password, int priv)
 {
     string query = " SELECT User_Name from Login Where User_Name = '" + User + "' ";
     object check = dbMan.ExecuteScalar(query);
     if (check == null)
     {
         string query_add = "INSERT INTO Login (User_Name, Password, Privelege) VALUES (" +
             "'" + User + "', " +
             "'" + password + "', " +
             "" + priv + ")";
         return dbMan.ExecuteNonQuery(query_add);
     }
     else
     {
         return -1;
     }
 }