Exemplo n.º 1
0
        public bool EditDoctorSchedule(AssignedDoctors assignedDoctors)
        {
            Query   = "UPDATE AssignedDoctors SET Sat = @sat, Sun = @sun, Mon = @mon, Tue = @tue, Wed = @wed, Thu = @thu, Fri = @fri, SatTime = @satTime, SunTime = @sunTime, MonTime = @monTime, TueTime = @tueTime, WedTime = @wedTime, ThuTime = @thuTime, FriTime = @friTime WHERE MedicalId = @medicalId AND DoctorId = @doctorId";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("sat", assignedDoctors.Sat);
            Command.Parameters.AddWithValue("sun", assignedDoctors.Sun);
            Command.Parameters.AddWithValue("mon", assignedDoctors.Mon);
            Command.Parameters.AddWithValue("tue", assignedDoctors.Tue);
            Command.Parameters.AddWithValue("wed", assignedDoctors.Wed);
            Command.Parameters.AddWithValue("thu", assignedDoctors.Thu);
            Command.Parameters.AddWithValue("fri", assignedDoctors.Fri);
            Command.Parameters.AddWithValue("satTime", assignedDoctors.SatFromTime);
            Command.Parameters.AddWithValue("sunTime", assignedDoctors.SunFromTime);
            Command.Parameters.AddWithValue("monTime", assignedDoctors.MonFromTime);
            Command.Parameters.AddWithValue("tueTime", assignedDoctors.TueFromTime);
            Command.Parameters.AddWithValue("wedTime", assignedDoctors.WedFromTime);
            Command.Parameters.AddWithValue("thuTime", assignedDoctors.ThuFromTime);
            Command.Parameters.AddWithValue("friTime", assignedDoctors.FriFromTime);
            Command.Parameters.AddWithValue("medicalId", assignedDoctors.MedicalId);
            Command.Parameters.AddWithValue("doctorId", assignedDoctors.DoctorId);
            Connection.Open();
            bool rowAffected = Convert.ToBoolean(Command.ExecuteNonQuery());

            Connection.Close();
            return(rowAffected);
        }
Exemplo n.º 2
0
        public bool SaveAssignedDoctor(AssignedDoctors assignedDoctors)
        {
            Query   = "INSERT INTO AssignedDoctors VALUES(@medicalId, @doctorId, @doctorFee, @returningFee, @sat, @sun, @mon, @tue, @wed, @thu, @fri, @satTime, @sunTime, @monTime, @tueTime,@wedTime,@thuTime,@friTime)";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("medicalId", assignedDoctors.MedicalId);
            Command.Parameters.AddWithValue("doctorId", assignedDoctors.DoctorId);
            Command.Parameters.AddWithValue("doctorFee", assignedDoctors.DoctorFee);
            Command.Parameters.AddWithValue("returningFee", assignedDoctors.DoctorReturningFee);
            Command.Parameters.AddWithValue("sat", assignedDoctors.Sat);
            Command.Parameters.AddWithValue("sun", assignedDoctors.Sun);
            Command.Parameters.AddWithValue("mon", assignedDoctors.Mon);
            Command.Parameters.AddWithValue("tue", assignedDoctors.Tue);
            Command.Parameters.AddWithValue("wed", assignedDoctors.Wed);
            Command.Parameters.AddWithValue("thu", assignedDoctors.Thu);
            Command.Parameters.AddWithValue("fri", assignedDoctors.Fri);
            Command.Parameters.AddWithValue("satTime", assignedDoctors.SatFromTime);
            Command.Parameters.AddWithValue("sunTime", assignedDoctors.SunFromTime);
            Command.Parameters.AddWithValue("monTime", assignedDoctors.MonFromTime);
            Command.Parameters.AddWithValue("tueTime", assignedDoctors.TueFromTime);
            Command.Parameters.AddWithValue("wedTime", assignedDoctors.WedFromTime);
            Command.Parameters.AddWithValue("thuTime", assignedDoctors.ThuFromTime);
            Command.Parameters.AddWithValue("friTime", assignedDoctors.FriFromTime);
            Connection.Open();
            bool rowAffected = Convert.ToBoolean(Command.ExecuteNonQuery());

            Connection.Close();
            return(rowAffected);
        }
        public string EditDoctorFees(AssignedDoctors aAssignedDoctor)
        {
            bool rowAffected = aDoctorGateway.EditDoctorFees(aAssignedDoctor);

            if (rowAffected)
            {
                return("Success");
            }
            else
            {
                return("Doctor fees editing failed.");
            }
        }
        public string EditDoctorSchedule(AssignedDoctors assignedDoctors)
        {
            bool rowAffected = aMedicalGateway.EditDoctorSchedule(assignedDoctors);

            if (rowAffected)
            {
                return("Success");
            }
            else
            {
                return("Doctor schedule editing failed.");
            }
        }
        public string AddDoctorFromOtherMedical(AssignedDoctors aAssignedDoctor)
        {
            bool rowAffected = aMedicalGateway.SaveAssignedDoctor(aAssignedDoctor);

            if (rowAffected)
            {
                return("Success");
            }
            else
            {
                return("Doctor assigning failed.");
            }
        }